Create an STM32 Bare Metal Project

Chip Select

Use the chip STM32F103RCT6.

../_images/W2_24-03-2024_9-22-57.png

Create an HAL project

../_images/Screenshot_2024-02-03_121438.png

Create an Bare Metal Project

../_images/Screenshot_2024-02-03_121948.png

Create the Drivers folder

../_images/Screenshot_2024-02-03_134825.png

Fig. 50 Create Folder Wizard. (Click on the Project -> New -> Folder )

../_images/Screenshot_2024-02-03_135044.png

Fig. 51 Create the Drivers Folder

Copy the CMSIS folder from the HAL project to the Bare Metal Project

../_images/Screenshot_2024-02-03_135540.png

Copy the system_stm32f1xx.c file from the HAL project to the Bare Metal Project

../_images/Screenshot_2024-02-03_140149.png

[Optional] Config the Debugging and MCU Post build outputs in the Project Properties

  • C/C++ Build -> Settings -> MCU Post build outputs -> Convert to Intel Hex file (-O hex)

../_images/Screenshot_2024-02-03_141545.png
  • C/C++ Build -> Settings -> MCU GCC Assembler -> Debugging -> Maximum (-g3)

  • C/C++ Build -> Settings -> MPU GCC Compiler -> Debugging -> Maximum (-g3)

Config Include Paths

../_images/Screenshot_2024-02-03_171013.png

Config the “STM32F103xEPreprocessor Symbol

../_images/Screenshot_2024-02-03_171543.png

References

  1. STM32 Register Level Programming and GPIO - HackMD

  2. STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and STM32F107xx advanced Arm®-based 32-bit MCUs - Reference manual.