Part Number: TMS320F28035
hi expert
Recently, the program of our company's vehicle motor controller (MCU 28035) got stuck in the can reception on the vehicle. The code is shown in the following figure.
The can message is received by querying, the RMP bit is cleared, and then it is read whether the RMP bit is cleared. It is found that sometimes it is not cleared, causing the program to be stuck in the while loop and unable to exit. However, this situation occurs very randomly. When used in a vehicle, it can happen within ten minutes to several hours after being powered on.
Then, by using the following method, the RPM flag was continuously cleared in the while loop, and the program did not freeze. The code is as follows. I would like to ask if this approach is correct and if there are any other impacts? Or could a suitable non-interrupt type of receiving method be provided?