An open API service indexing awesome lists of open source software.

https://github.com/hana0212/embedded-stm32-projects

Explore bare-metal drivers and hands-on examples for STM32L4xx microcontrollers. Perfect for low-level embedded programming enthusiasts! 🚀💻
https://github.com/hana0212/embedded-stm32-projects

arduino beginner-friendly c cortex-m3 cprogramming embedded embedded-graphics embedded-rust esp flac hal music rtfm rust software stm32 stm32f103 stm32f103c8t6

Last synced: 12 months ago
JSON representation

Explore bare-metal drivers and hands-on examples for STM32L4xx microcontrollers. Perfect for low-level embedded programming enthusiasts! 🚀💻

Awesome Lists containing this project

README

          

# Bare-Metal STM32L4 Embedded Projects with Custom Drivers

![STM32](https://img.shields.io/badge/STM32-Embedded%20Projects-brightgreen.svg)
![C Language](https://img.shields.io/badge/C%20Language-Embedded%20Systems-blue.svg)
![FreeRTOS](https://img.shields.io/badge/FreeRTOS-Ready-orange.svg)

Welcome to the **embedded-stm32-projects** repository! This collection features bare-metal projects designed for the STM32L4 microcontroller series. Each project includes custom drivers written in C, showcasing real sensor integration, interrupt handling, and is ready for FreeRTOS.

You can download the latest releases [here](https://github.com/hana0212/embedded-stm32-projects/releases). Follow the instructions to execute the files.

## Table of Contents

- [Project Overview](#project-overview)
- [Features](#features)
- [Getting Started](#getting-started)
- [Project Structure](#project-structure)
- [Drivers](#drivers)
- [Sensors](#sensors)
- [Interrupt Handling](#interrupt-handling)
- [FreeRTOS Integration](#freertos-integration)
- [Building the Projects](#building-the-projects)
- [Testing the Projects](#testing-the-projects)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## Project Overview

The **embedded-stm32-projects** repository focuses on bare-metal programming for the STM32L4 microcontroller. This means you will work directly with hardware without an operating system. The projects aim to provide a hands-on experience with embedded systems.

## Features

- **Bare-metal Programming**: Directly interact with hardware.
- **Custom Drivers**: Built for various peripherals.
- **Sensor Integration**: Use I2C and SPI protocols.
- **Interrupt Handling**: Efficiently manage asynchronous events.
- **FreeRTOS Ready**: Prepare your projects for real-time operating systems.

## Getting Started

To get started, clone the repository:

```bash
git clone https://github.com/hana0212/embedded-stm32-projects.git
```

Next, navigate into the project directory:

```bash
cd embedded-stm32-projects
```

For detailed instructions, refer to the [Releases](https://github.com/hana0212/embedded-stm32-projects/releases) section.

## Project Structure

The project is organized as follows:

```
embedded-stm32-projects/
│
├── drivers/
│ ├── i2c.c
│ ├── spi.c
│ ├── uart.c
│ └── ...
│
├── sensors/
│ ├── temperature_sensor.c
│ ├── humidity_sensor.c
│ └── ...
│
├── interrupts/
│ ├── timer_interrupt.c
│ ├── gpio_interrupt.c
│ └── ...
│
├── freertos/
│ ├── tasks.c
│ └── ...
│
└── main.c
```

## Drivers

The drivers folder contains the essential code to interface with various peripherals. Each driver is modular, allowing for easy integration into your projects.

### I2C Driver

The I2C driver facilitates communication with multiple devices using the I2C protocol. It includes functions for:

- Initialization
- Sending data
- Receiving data

### SPI Driver

The SPI driver allows for high-speed communication with devices. It supports:

- Full-duplex communication
- Master and slave modes

### UART Driver

The UART driver enables serial communication. Key features include:

- Configurable baud rates
- Transmit and receive functions

## Sensors

The sensors folder includes example code for integrating various sensors. Each sensor module is designed to work seamlessly with the provided drivers.

### Temperature Sensor

This module demonstrates how to read temperature data using an I2C temperature sensor. The implementation includes:

- Sensor initialization
- Data reading functions

### Humidity Sensor

Similar to the temperature sensor, this module integrates a humidity sensor. It provides:

- Initialization code
- Functions to retrieve humidity data

## Interrupt Handling

Efficient interrupt handling is crucial for responsive embedded applications. The interrupts folder includes examples for managing hardware interrupts, such as:

- Timer interrupts for periodic tasks
- GPIO interrupts for button presses

Each example shows how to set up the interrupt service routine (ISR) and handle events.

## FreeRTOS Integration

For projects that require multitasking, FreeRTOS can be integrated. The freertos folder contains example tasks that demonstrate:

- Task creation
- Task scheduling
- Inter-task communication

These examples are ready to be modified and expanded based on your needs.

## Building the Projects

To build the projects, ensure you have the necessary tools installed, such as:

- ARM GCC toolchain
- Make utility

Use the following command to compile a project:

```bash
make
```

This command will generate the binary files needed to upload to your STM32L4 microcontroller.

## Testing the Projects

Once built, you can upload the binary to your microcontroller using tools like ST-Link or OpenOCD. Follow these steps:

1. Connect your STM32L4 to your computer.
2. Use the appropriate flashing tool.
3. Load the generated binary file.

For further testing, you can use serial output to debug and monitor your application.

## Contributing

Contributions are welcome! If you want to improve the projects or add new features, please follow these steps:

1. Fork the repository.
2. Create a new branch for your feature.
3. Make your changes and commit them.
4. Submit a pull request.

Your contributions help enhance the quality and functionality of this repository.

## License

This project is licensed under the MIT License. Feel free to use and modify it as needed.

## Contact

For questions or suggestions, please reach out via GitHub issues or contact me directly.

You can download the latest releases [here](https://github.com/hana0212/embedded-stm32-projects/releases). Follow the instructions to execute the files.