Skip to main content
DFari.11
Associate
March 15, 2022
Solved

Code generator removes my application code from the main.c file

  • March 15, 2022
  • 2 replies
  • 1143 views

Hello i'm new at using stm32ide

every time i make a change in the pin editor the generated code remove my application from the main.c file

i try to find solutions online i couldn't find any how can i edit my MCAL layer without losing my code ?

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

In the generated files, there are regions marked with USER CODE BEGIN and USER CODE END. You may only modify code within those sections.

Here are three of many such sections:

0693W00000KckJ0QAJ.png

2 replies

TDK
Super User
March 15, 2022

Keep your code within USER CODE blocks and don't make modifications outside of those.

"If you feel a post has answered your question, please click ""Accept as Solution""."
DFari.11
DFari.11Author
Associate
March 15, 2022

thanks for your reply

it works with me

TDK
TDKBest answer
Super User
March 15, 2022

In the generated files, there are regions marked with USER CODE BEGIN and USER CODE END. You may only modify code within those sections.

Here are three of many such sections:

0693W00000KckJ0QAJ.png

"If you feel a post has answered your question, please click ""Accept as Solution""."