Example project for STM32H745 Nucleo-144 board. Only CM7 is actually used.
This example is specially made for multi-core MCUs, like some of STM32H7xx chips
Single-core STM32 MCUs are supported out-of-the-box
- STM32CubeMX and STM32H7 software pack
- CLion 2022.2+ and it's bundled
Embedded Development Support
plugin - GNU Arm Embedded Toolchain
- STM32CubeIDE
- (Windows only) MinGW
- Install and configure all the required tools. See CLion Quick start guide
- Start STM32CubeMX and make a new project.
- Note I. On the
Project Manager
tab,Toolchain/IDE
field must be set toSTM32CubeIDE
- Note II. Do not use space, international, or special characters for project name or path
- Note I. On the
- Generate the project code. STM32CubeMX will create a project folder with two separate subprojects
- Download and put CMakeLists.txt for this gist to the projects root
- Now check all the
TODO
comments in theCMakeLists.txt
file and put actual values instead. TODO tool window - Open the root project in CLion.
- Your CMake project will be parsed. If there are errors, correct them and select
Tools -> CMake -> Reset Cache and Reload Prpject
from the main menu. Repeat until everything is fixed and the CMakeLists is successfully parsed. - Create
Run Configurations
for both core binaries - CM4 and CM7.- Select create new Embedded GDB Server run configuration.
- Select
Target
andExecutable
for correaponding core. - Set
tcp::<port number>
to'target remote' args
field. The port number may be virtually any in range 1024..65535 but it must nt clash with the conterpart project port number. Use the same number below - Locate
ST-LINK_gdbserver
executable and select for asGDB server
The executable resides in the inSTM32CubeIDE
installation folder,plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.????/tools/bin/
subfolder. Actual name varies from version to version, and exact name can't be provided - Locate
STM32_Programmer_CLI
executable similar way, but the folder expected to beplugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.???/tools/bin/
then add path to the folder as a-cp
key value toGDB Server args
field - Add
-t -d -p <port number> -m <core num>
keys toGDB Server args
field.- The
<core num>
parameter is0
for Cortex-M7 or3
for Cortex-M4 kernels. Other MCU models may support other numbers. - Final arguments form is
-cp <STM32_Programmer_CLI bin folder path> -t -d -p <port number> -m <core num>
- The
- Try to build both executables. If something goes wrong, fix your
CMakeLists.txt
and sources. - Click
Debug
for both executables. The firmware for both kernels should be flashed and started. - Enjoy your newly-created project.
Follow the guide with respect that we're working with CLion
- Additional memory mapping is done via user-defined linker script
- Some lines a