2020-11-28 03:24 AM
Hi,
I am using STM32CUBEIDE, project creation is simple. i modified that code and i add the more function. After i need to add another peripherals, so i use .ioc (stm32cubemx) add another peripherials , after save it ask create, when into my project modified code doesnot exist, new fresh code will appear. Can anyone tell me how to overcome this one.??
Solved! Go to Solution.
2020-11-28 11:34 PM
@Community member has provided you right answer. You have to take care to USER CODE sections.
According your video you've get rid of some ... this is not supported. Each USER CODE section is having a BEGIN and a END ...
WHILE section is:
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
section 3 is:
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
Your code addon is only supported between related BEGIN / END statements.
According your video your code is included ok between a BEGIN and a END BUT they are not related ... WHILE is not 3 counterpart ...
Once your issue solved please mark such post as answered it will help community to access shortly to best material.
2020-11-28 07:34 AM
I guess this is one of the downsides of auto code generation.
There should be a check-box item about how it replaces files.
You should be putting your code within USER CODE BLOCK constraints.
With tools that behaviour this way, you should generate into a sandbox project, and merge into your live one, and always have a backup / repository.
2020-11-28 07:29 PM
2020-11-28 11:34 PM
@Community member has provided you right answer. You have to take care to USER CODE sections.
According your video you've get rid of some ... this is not supported. Each USER CODE section is having a BEGIN and a END ...
WHILE section is:
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
section 3 is:
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
Your code addon is only supported between related BEGIN / END statements.
According your video your code is included ok between a BEGIN and a END BUT they are not related ... WHILE is not 3 counterpart ...
Once your issue solved please mark such post as answered it will help community to access shortly to best material.
2020-11-29 08:45 PM
Thanks sir... Its working... I didn't notice that once.. Thanks for saving my time