Hi everyone,
I’ve been experimenting with bare-metal programming on my STM32H-series MCU and wrote a simple C program to blink the on-board LEDs without using HAL or any libraries. It was a good exercise to understand how peripheral registers actually work under the hood.
Here’s what I’ve done so far
Enabled the RCC clock for GPIO ports B, C, and E
Configured GPIOB pins 14 and 0, and GPIOE pin 1 as outputs
Set the output type to push-pull
Defined the output speed directly through register access
I’m now looking to take this a step further. how can I optimize the code or make it more bare-metal in terms of structure and efficiency? Id love to hear how others handle low-level register operations or organize code in professional embedded projects.
Any pointers or examples…
Hi everyone,
I’ve been experimenting with bare-metal programming on my STM32H-series MCU and wrote a simple C program to blink the on-board LEDs without using HAL or any libraries. It was a good exercise to understand how peripheral registers actually work under the hood.
Here’s what I’ve done so far
Enabled the RCC clock for GPIO ports B, C, and E
Configured GPIOB pins 14 and 0, and GPIOE pin 1 as outputs
Set the output type to push-pull
Defined the output speed directly through register access
I’m now looking to take this a step further. how can I optimize the code or make it more bare-metal in terms of structure and efficiency? Id love to hear how others handle low-level register operations or organize code in professional embedded projects.
Any pointers or examples would be great!