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 Supportplugin - 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 Managertab,Toolchain/IDEfield 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
TODOcomments in theCMakeLists.txtfile 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 Prpjectfrom the main menu. Repeat until everything is fixed and the CMakeLists is successfully parsed. - Create
Run Configurationsfor both core binaries - CM4 and CM7.- Select create new Embedded GDB Server run configuration.
- Select
TargetandExecutablefor correaponding core. - Set
tcp::<port number>to'target remote' argsfield. 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_gdbserverexecutable and select for asGDB serverThe executable resides in the inSTM32CubeIDEinstallation 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_CLIexecutable 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-cpkey value toGDB Server argsfield - Add
-t -d -p <port number> -m <core num>keys toGDB Server argsfield.- The
<core num>parameter is0for Cortex-M7 or3for 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.txtand sources. - Click
Debugfor 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