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?
已解决! 转到解答。
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.