Infinite loop instead of break loop

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello, I do need your help,

I do need some break times to initalize an ENC28J60 component with a XMC1200 via Keil.
It works well in "Debug Mode" but not in real time.

For example: The Led will only go out in debug mode!

int volatile a = 0;

P0_0_set(); //Led On
do{
a += 1;
}while(a < 20000);
P0_0_reset(); //Led Out

I tried to change the "Optimization Option" of the Project without any success.

Thank you for any help,
Bernd
0 Likes
3 Replies
User8620
Level 2
Level 2
you should not use "int". instead use uint8_t, uint16_t, int8_t, etc...
but this will not solve your problem
0 Likes
Not applicable
My "Keil myVision5" compiler is the problem because of a lot of stupid mistakes.
I tried to make an update but it seems that Keil doesn't assisted Infineon anay more.

I have a support infineon case (3531032) but didn't get any feedback until now.

Regards,
Bernd
0 Likes
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Try with :

        
int a = 0;

do
{
__nop();
a += 1;
} while (a < 20000);

Regards,
Jesus
0 Likes