cancel
Showing results for 
Search instead for 
Did you mean: 

CAN RX Interrupt stops working; TX continues to function

marcusdufrane
Associate III
Posted on May 07, 2015 at 21:42

I'm trying to figure out a strange behavior on an STM32F302xB. The application communicates through CAN and for the most part functions correctly. The application was initially set up using the ST Cube application.

The problem occurs after about 5 minutes of run time. It appears that the USB_LP_CAN_RX0_IRQHandler ceases to fire while CAN traffic is surely coming in. 

My initial debugging tries included verifying that the TX interrupt was still working; it is. I then tried to see if the RX interrupt was just getting turned off. I monitored the NVIC Set and Clear registers as well as the NVIC_DisableIRQ function to no avail. The interrupt doesn't appear to have been disabled.

Can anyone provide me with any other avenues of debugging? Is there something in the CAN peripheral I'm not seeing that would cause the interrupt to stop?

#can-stm32f302-interrupt
4 REPLIES 4
Posted on May 07, 2015 at 22:07

I don't know, the FIFO's overrun and you have to clear some error condition?

Try outputting some data about the state of the CAN peripheral, don't park a debug view over it.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
marcusdufrane
Associate III
Posted on May 07, 2015 at 22:56

Any clues on what I should be monitoring. The user manual doesn't note anything about a overflow causing the receive to error out. Can you point me to anything there?

The generated code is set to grab the message at every interrupt and stick it into a global variable to be monitored. I would assume this would never lead to a full, or overflow condition though the FIFO0 register does indicate as such.

Posted on May 08, 2015 at 03:51

I don't have an F302, and haven't used CAN on it. If in doubt dump and review all the control, status, and error registers.

I'd look at the FOVR0 bit of CAN_RF0R, and FOVR1 but of CAN_RF1R.

Be aware that a receive interrupt need to clear everything out of the FIFO, as there can be more than one packet in there.

http://www.st.com/web/en/resource/technical/document/reference_manual/DM00094349.pdf

Make sure also you acknowledge that you've read each message.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
mdostalek9
Associate
Posted on January 11, 2017 at 08:21

Hi,

i have a similiar problem, i am using a STM32F429 and CAN intterupt driven communication on CANOpen stack, after some time the RX0 interrupt callbeck doesn't trigger (after 30s - 10minutes). Did you ever solved the problem you have? Or does someone have a clue of the solution?