When creating the new STM32CubeMX project from CLion,after generating code from STM32CubeMX,Clion failed to generate the CMake files. When using Tool - CMake -Update CMake Projects with STM32CubeMX it has error message in the shell in which Clion is run like. OpenOCD + STM32CubeMX support for ARM embedded development. CMakeLists.txt and toolchain file for building STM32 HAL-based projects generated with STM32CubeMX with arm-none-eabi-gcc. STM32CubeMX settings. Toolchain: SW4STM32. ☑ Generate under root. Clion下开发STM32 0 前言 多数人在开发STM32的时候用的都是keil这个老牌IDE,很大一部分原因是因为很多人都是从51单片机过来的,那个时候就用keil去开发. STM32CubeMX integration If you develop for STMicroelectronics boards, benefit from integration with STM32CubeMX. CLion can create a new.ioc project or open an existing one, and generate a CMake file to correctly work with it. And you can start STM32CubeMX any time directly from CLion to update board settings and generate code.
STM32CubeMX integration
If you develop for STMicroelectronics boards, you’ll be happy to know that CLion integrates with STM32CubeMX:
- CLion can create a new .ioc project or open an existing one, and generate a CMake file to correctly work with it.
- You can start STM32CubeMX any time directly from CLion to update board settings and generate code.
- CLion reminds you to select a board config and suggests a list of options in the UI.
PlatformIO
PlatformIO is a new generation ecosystem that is gaining popularity quickly. To benefit from it in your embedded projects, take advantage of a PlatformIO for CLion plugin, which:
- Adds the PlatformIO project type to the New Project wizard.
- Generates the corresponding PlatformIO CMake-based project.
- Automatically creates configurations for debug and upload.
- Allows for debugging with the PIO Unified Debugger from CLion right on chip.
And much more! Check the official documentation for details.
Stm32cubemx Can
IAR Toolchain
If you use the IAR compiler/toolchain in your embedded projects, you can do so in CLion. Projects using the IAR toolchain load successfully and work in CLion.
A few things to note here:
- MinGW is required.
- Ninja is recommended as a CMake generator.
- A few tips on using CMake with IAR Embedded Workbench.
Open On-Chip Debugger
Stm32cubemx Cannot Load This Mcu
![Stm32cubemx Clion Stm32cubemx Clion](https://www.programmersought.com/images/882/f2d8fe0373ee9ad83b34f50893379c7a.png)
Stm32cubemx Blink
Debugging with the Open On-Chip Debugger is supported by CLion. Use the new Run/Debug configuration template, ‘OpenOCD Download and Run’ to debug on your microcontroller.
If you work with a STM32CubeMX project in CLion, an OpenOCD Run/Debug configuration will be created for you automatically.
Learn more about STM32CubeMX & OpenOCD integration
On-Chip debugging with GDB Server
Stm32cubemx Can Bus
If it’s possible to debug on the microcontroller of your choice with a GDB Server, you can do it from CLion using a special Embedded GDB Server Run/Debug configuration. It covers OpenOCD, ST-Link GDB Servers, Segger J-Link GDB Server, QEMU, and many other specific GDB Servers.
Create a configuration, providing a path to GDB Server, arguments to run the server, and other appropriate settings, and you are all set and ready to debug on-chip from CLion!
Stm32cubemx Clock
Peripheral View for ARM Devices
When debugging on-chip, it’s crucial to have the ability to view the peripherals. In CLion, this view is available for two types of Run/Debug configurations: Embedded GDB Server and OpenOCD Download & Run. In both cases, a Peripherals tab appears in the debug tool window when you start debugging. Load the appropriate .svd file for your board and select the active peripherals you need to see.
MISRA C and C++
CLion comes with partial support for MISRA C 2012 and MISRA C++ 2008, guidelines used widely in embedded development and especially in the automotive industry. This support speeds up the development of such projects by revealing incompatibilities earlier in the development cycle. The list of currently supported checks is available on CLion’s Confluence page .