cancel
Showing results for 
Search instead for 
Did you mean: 

Export STM32CubeMX Project to CMake

zeflo
Associate

Hi, 

i wanted to export this Project:
https://github.com/mirzafahad/nucleo_stm32f429zi_lwip_examples/tree/master/UDP_Echo_Client

to CMake, so i can import it via the STM32 VSCode extension. 

I was following this short Video: https://www.youtube.com/watch?v=DDVdq47Dd94

Unfortunately when i click on "GENERATE CODE", most of the code written in main.c is lost. How can i prevent this?

Thanks for any help!

1 REPLY 1
unsigned_char_array
Senior III

"Unfortunately when i click on "GENERATE CODE", most of the code written in main.c is lost. How can i prevent this?"
Only write code in user code sections "USER CODE BEGIN x" and "USER CODE END x". Sometimes it can be tricky if you want to change some code outside of these sections, but you can use pre-processor tricks to solve that. Let me know how it works out.

 

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.