How do you migrate the code generated by their CubeMx to the blank project created by platformio?
I used cubemx to generate stm32 code, and the code file directory is as follows:
Then I created a cubemx framework project using PlatformIO.I copied the ‘Core’ folder to the ‘src’ directory in the platformio project.
There were a lot of errors when I compiled the project.What configurations should I do to compile the project? And I don’t need to destroy the directory structure of the cubemx generation code.In order to compile successfully, I must copy the files under the “Core/Src/” path to the “src” directory in the project and the files under the “Core/Inc/” path to the “include” directory in the project.
1 Like
This problem has been solved, just configure the path to compile successfully!
Here’s what I configured:
[env:disco_l152rb]
platform = ststm32
board = disco_l152rb
framework = stm32cube; change microcontroller
board_build.mcu = stm32l151rbt6; change MCU frequency
board_build.f_cpu = 32000000Lupload_protocol = jlink ; SWD interface
debug_tool=jlinkbuild_flags = -DL1
-Isrc/Core/Inc
1 Like