Skip to main content
GCrow.1
Associate
November 12, 2020
Solved

Hello STM32 Forum, If I modify and then generate code in SMT32CubeIDE (Version: 1.4.0 Build: 7511_20200720_0928 (UTC)), any code I add to main.c is deleted. I saw on a forum post that 'keep user generated code' must be ticked but I cannot find it

  • November 12, 2020
  • 4 replies
  • 1034 views

..

This topic has been closed for replies.
Best answer by sivaram

open the .ioc file in IDE, then click the 'project manager' tab of the ioc file and then click the 'Code Generator' from the left, you will find the option.

4 replies

sivaram
sivaramBest answer
Associate III
November 12, 2020

open the .ioc file in IDE, then click the 'project manager' tab of the ioc file and then click the 'Code Generator' from the left, you will find the option.

GCrow.1
GCrow.1Author
Associate
November 12, 2020

Great, thank you, just figured it out! I am going to have to get used to having code deleted if its not in the correct place.

TDK
November 12, 2020

Code between USER CODE tags will not be deleted. Don't put code anywhere else:

 /* USER CODE BEGIN *** */
 
 // your code here
 
 /* USER CODE END *** */

"If you feel a post has answered your question, please click ""Accept as Solution""."
ST Technical Moderator
November 13, 2020

Hi @GCrow.1​ ,

When your question is answered, please close this thread by choosing "Select as Best".

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks