cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX not preserving my user code

p.walker
Associate

I'm running v1.26.1 of CubeMX and any code that I add between the /* USER CODE BEGIN.. and /* USER CODE END.. comments gets deleted every time I (re)generate the project. I have the 'Keep User Code when re-generating' option ticked. What am I missing?

2 REPLIES 2
Khouloud GARSI
Lead II

Hi @p.walker​ ,

I assume you're using CubeMX version 4.26.1 (Please feel free to correct me if I'm wrong).

I couldn't reproduce your issue (I have generated a project and my user code was kept after regenerating it). Thus, could you share your ioc file for further debug.

Khouloud.

Vincent HUE
Associate II

I am experiencing similar issues with 4.26.1. today... :(

All my code is wiped out.

Vincent