cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the behavior of the while loop I wrote differ from the one generated by STM32CubeMX?

Shion
Associate II

Hello everyone.

Why does the behavior of the while loop I wrote differ from the one generated by STM32CubeMX? Since the code generated by STM32CubeMX is highly abstracted, is it possible that even the same while loop behaves differently due to internal processing? Where can I learn about such rules? I'm a beginner, so I would really appreciate any guidance. If anyone knows, I would be grateful for your help.

 

Here are the details of the issue.

 

1. When code is written inside the while loop generated by STM32CubeIDE

Code:

Shion_0-1755130651074.png

Result: It doesn't work correctly. It seems that something inside the while loop isn't functioning properly.

Shion_1-1755130821918.png

2. When code is written inside the while loop wrote by myself.

Code:

Shion_2-1755130908489.png

 

Result: It works correctly

Shion_3-1755130945747.png

 

 

 

 

 

1 REPLY 1
TDK
Super User

Probably due to the unconditional while loop that it gets stuck in. It never makes it to the other code.

TDK_0-1755132855670.png

 

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