Waiting for a flag to set - hangs

cancel
Showing results for 
Search instead for 
Did you mean: 

Waiting for a flag to set - hangs

Jump to solution
76 Views
Contributor II

Many of the various code examples have simple wait instructions. For example:

while (CAN_A.MCR.B.NOTRDY == 0) {};

And these generally work. However, I occasionally (often) find that they do not work. For example:

while (eSCI_B.IFSR1.B.TDRE == 0) {};

This one (checking for LIN to be ready) hangs; when I stop the debugger / halt execution it is just sitting on that line of code. I have in some cases created multiple lines of code to create an "equivalent" function, but that is sort of silly.

I'm using S32DS and mpc5777C. I've got most of the other peripherals (CAN, SPI, etc.) working. Any ideas?

1 Solution
36 Views
Contributor II

My bad. Was working too fast and was trying to use IFSR1.B.TDRE. I should have been using IFSR2.B.TXRDY.

Code seems to work okay now. Sorry for the distraction.

View solution in original post

1 Reply
37 Views
Contributor II

My bad. Was working too fast and was trying to use IFSR1.B.TDRE. I should have been using IFSR2.B.TXRDY.

Code seems to work okay now. Sorry for the distraction.

View solution in original post