This repository documents my journey with STM32 microcontrollers while studying "Mastering STM32 - Second Edition" book by Carmine Noviello. The goal is to reinforce concepts, explore embedded systems development, and share useful resources.
Here's a simplified diagram explaining the internal bus architecture in ARM-based STM32 microcontrollers:
graph TD
Memory_Controller[Memory Controller]
AHB_External_Bridge[AHB External Bridge]
subgraph 1[ ]
ARM_Processor[ARM Processor]
Interrupt_Controllers[Interrupt<br>Controllers]
AHB
ARM_Processor <--> Interrupt_Controllers
ARM_Processor <---> AHB
AHB <---> Memory_Controller
AHB <---> AHB_External_Bridge
end
subgraph 2[ ]
AHB_APB_Bridge[AHB - APB Bridge]
AHB_APB_Bridge <--> USART
AHB_APB_Bridge <--> RTC
AHB_APB_Bridge <--> Ethernet
AHB_APB_Bridge <--> Timers
end
AHB <--> AHB_APB_Bridge
class 1 1;
class 2 2;
class ARM_Processor arm;
class Interrupt_Controllers ic;
class AHB ahb;
class Memory_Controller mc;
class AHB_External_Bridge ahb_eb;
class AHB_APB_Bridge ahb_apb;
class USART usrat;
class RTC rtc;
class Ethernet ethernet;
class Timers timers;
classDef 1 fill:transparent,stroke:transparent;
classDef 2 fill:transparent,stroke:transparent;
classDef arm fill:#FE774310,stroke:#FE7743,stroke-width:2px,color:#FE7743;
classDef ic fill:#F5C45E10,stroke:#F5C45E,stroke-width:2px,color:#F5C45E;
classDef ahb fill:#81E7AF10,stroke:#81E7AF,stroke-width:2px,color:#81E7AF;
classDef mc fill:#3A59D110,stroke:#3A59D1,stroke-width:2px,color:#3A59D1;
classDef ahb_eb fill:#FFA95510,stroke:#FFA955,stroke-width:2px,color:#FFA955;
classDef ahb_apb fill:#3D90D710,stroke:#3D90D7,stroke-width:2px,color:#3D90D7;
classDef usrat fill:#BE598510,stroke:#BE5985,stroke-width:2px,color:#BE5985;
classDef rtc fill:#5F8B4C10,stroke:#5F8B4C,stroke-width:2px,color:#5F8B4C;
classDef ethernet fill:#E5202010,stroke:#E52020,stroke-width:2px,color:#E52020;
classDef timers fill:#A89C2910,stroke:#A89C29,stroke-width:2px,color:#A89C29;
linkStyle 0 stroke:#FE7743,stroke-width:2px;
linkStyle 1 stroke:#FE7743,stroke-width:2px;
linkStyle 2 stroke:#81E7AF,stroke-width:2px;
linkStyle 3 stroke:#81E7AF,stroke-width:2px;
linkStyle 8 stroke:#81E7AF,stroke-width:2px;
linkStyle 4 stroke:#3D90D7,stroke-width:2px;
linkStyle 5 stroke:#3D90D7,stroke-width:2px;
linkStyle 6 stroke:#3D90D7,stroke-width:2px;
linkStyle 7 stroke:#3D90D7,stroke-width:2px;
I'm using the Nucleo-F446RE
board for learning and experimenting with STM32 microcontrollers. This board is based on the STM32F446RET6
MCU and provides a great balance between performance and flexibility for embedded systems development.
- Datasheet: Contains the STM32F446xC/E datasheet, reference manual, and the Nucleo-F446RE board schematic.
- Docs: Notes extracted from the Mastering STM32 book.
- Examples: C and Assembly programs to explore low-level concepts.
- Notes: Quick summaries and explanations from various sources.
- Projects WS: Hands-on implementations and learning experiments.
- Nucleo-F446RE: Projects tailored for the Nucleo-F446RE board.
- Learn by Building: Folder for project-based learning. Project names and paths are listed in
projects.txt
, while actual implementations are found inProjects WS
.
Here are some essential tools for STM32 development:
- STM32CubeIDE: An all-in-one IDE that integrates a compiler, debugger, and project manager for STM32 development.
- STM32CubeMX: A graphical tool to configure STM32 microcontrollers and generate initialization code.
- STM32CubeProgrammer: A tool for flashing firmware onto STM32 microcontrollers via various interfaces, without the need for an external/onboard debugger.
- STM32CubeCLT: A command-line tool for building, debugging, and flashing STM32 projects.
- STM32CubeMonitor: A monitoring tool to test STM32 applications at run-time.
- STMCUFinder: A search tool to find STM32 and STM8 microcontrollers and their technical documentation.
The Hardware Abstraction Layer
(HAL) is an STM32 API that simplifies peripheral control by hiding low-level register manipulation.
- Portability: Code written using HAL can be easily adapted to different STM32 models with minimal changes.
- Ease of Use: HAL provides user-friendly functions for configuring and controlling peripherals without dealing with complex register settings.
- Reliability: It includes built-in error handling and debugging features.
- Compatibility: Works with STM32CubeIDE, allowing seamless integration with ST's software ecosystem.
HAL is widely used for rapid development, but it has performance trade-offs compared to direct register manipulation or LL (Low Layer) drivers.
I've created some video animations using Manim
to visualize some STM32 concepts. These animations aim to simplify complex topics and enhance learning. You can check them out in manim-animation.
Whether you're just starting with STM32 or revisiting key concepts, I hope this repo helps you learn and grow. Contributions and suggestions are always welcome!