2021-11-09 07:19 AM
It is not realy a bug as the code works fine even if any comment is placed at a wrong line but comments should make life easier.
Steps done to generate a main.c with STM32CubeIDE 1.7.0:
Generated code of main.c at line 90ff:
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
What I think it should look like:
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
while (1)
{
/* USER CODE BEGIN WHILE */
/* USER CODE END WHILE */
}
/* USER CODE BEGIN 3 */
/* USER CODE END 3 */
Solved! Go to Solution.
2021-11-09 07:27 AM
That's not a bug, that's a feature. CubeMX will place sometimes generated code in the middle of the while loop, e.g. code for periodic background activities. The two user comment blocks leave you a choice placing your code before or after that generated code.
hth
KnarfB
2021-11-09 07:27 AM
That's not a bug, that's a feature. CubeMX will place sometimes generated code in the middle of the while loop, e.g. code for periodic background activities. The two user comment blocks leave you a choice placing your code before or after that generated code.
hth
KnarfB