To keep short, doing this makes you end up with cleaner code, faster compilaton time, more memory available for you to use as you want and less buggy-prone code. Here's a complete list:
As mentioned on book Bare-Metal Embedded C Programming[1]:
Bare-metal programming is all about working directly with the registers in the microcontroller without going through a library [...]. This approach enables us to optimize our firmware for speed and efficiency, which are two very important parameters in embedded systems where resources are limited.
- Israel Gbati[1]
There are multiple layers companies like ST make available for progammers that need to develop a Microcontroller application. This is done so that developers with multiple experience levels can program to the target, which makes the microcontrollers more "accessible". Of course, that comes with a cost.
The table below showcases the different levels available and their main characteristics:
| Layer | Complexity Level | Optimization Level | Suitable for |
|---|---|---|---|
| MAINSTREAM FRAMEWORKS (ex ARDUINO) | Easiest | Lowest | Suitable for Students, Hobbists, Quick Prototyping |
| HARDWARE ABSTRACTION LAYER (HAL) | Easy | Average | Firmware Developers (Beginners), Highly Verbose |
| LOW LEVEL LAYER (LL) | Average | Good | Used for a mix of portability and optimizaiton. More advanced controlls. |
| BARE-METAL C | Hard | Great | Granular controll and memory optimized. Used on final product lines. |
| ASSEMBLY | Hardest | Great, but dangerous | Not very used since it is extremely time-consuming to implement and have limited portability |
The below list is a what I consider a must. It's important to state that learning Bare-metal C using a micrcontroller can be a plesant experience or just hell depending on the tools you have.
STMCubeIDE. Since most developers have one that they already code, CLion, which is free at the of this writting and will be the tool used, or even Visual Studio Code can be used with some extensions. If you're in doubt, pick STMCubeIDE which is the safest option.
NUCLEO-WB55RG. You can pick whatever, as long an STM32 microcontroller is present, and includes the ST-Link debug interface embedded accessible via USB.
Since the Reference Manual is the most important document you'll use, it's important to know how to navigate through it.
Take a first look on the table of contents. There, you'll find the first headers pointing to overall details (which include the memory map), and then each section will be a peripheral, or a main feature of the microcontroller. Each one of this sections will guide you with the relevant details, register names, their actions, and if they are read/write. The most important section is the register map for each of the features.
Once you start navigating through the manual, you'll get confortable on identifying the correct place to go. Basically the thought process is the following:
| ^ | [1] | Gbati, I. (2024). Bare-Metal Embedded C Programming: Develop high-performance embedded systems with C for Arm microcontrollers. Packt Publishing Ltd. |
| ^ | [2] | RM0434 Reference Manual. ST. (2025, January 1). https://www.st.com/resource/en/reference_manual/rm0434-multiprotocol-wireless-32bit-mcu-armbased-cortexm4-with-fpu-bluetooth-lowenergy-and-802154-radio-solution-stmicroelectronics.pdf |