This is a minimal Stm32 "hello world" project for CLion IDE based on STM32 Standard Peripheral Library
Target CPU is STM32F411CC
- install gcc-arm-none-eabi compiler set
- make sure you can reach gcc-arm-none-eabi-gcc and gcc-arm-none-eabi-g++ from your shell (add bin directory (ex: C:\Program Files (x86)\GNU Arm Embedded Toolchain\10 2021.10\bin) to the system PATH variable)
- make sure you can reach cmake from your shell. You can use the one shipped with you CLion distribution, ex: C:\Program Files\JetBrains\CLion 2021.3.3\bin\cmake\win\bin
- setup toolchain
File -> Settings -> Build, Execution, Deployment -> Toolchains
: - now you must be able to build the progect
Build -> Build Project
. You could attempt restarting you IDE in case of any problem - add debug configuration
Run -> Edit Configurations
. Choose the only availableTarget
andExecutable
, selectBoarding config file
from the project root: - at this point you must be able to run and debug your source code:
Run -> Debug stm32StdLibTemplate
- in order to view peripherals state during debug you have to provide a
*.svd
file, located at the project root directory:STM32F411.svd
(Search in the internet if you need any other)