Reply To: Use stm32CubeMX and c++

Sysprogs forums Forums VisualGDB Use stm32CubeMX and c++ Reply To: Use stm32CubeMX and c++

#7469
jeremyvnc
Participant

Try this:  In STMCubeMX, go to Project Settings -> Code Generator tab.  Check the “Generate peripheral initialization as a pair of ‘.c/.h’ files per IP and check “Keep User Code when re-generating”  This “should” prevent cubeMX from generating anything important in main.c, then you can just delete main.c when you re-generate your project in CubeMX or have main.c just an empty file so CubeMX will see it and skip over generating it.

Hope this helps.