Skip to main content
totally
Associate II
March 29, 2012
Question

CAN TX, RX interrupt not working!

  • March 29, 2012
  • 1 reply
  • 755 views
Posted on March 29, 2012 at 21:32

Hello,

I'm trying to get the CAN Example (

http://www.keil.com/download/docs/asp

) to work properly, but I have problems with the RX and TX interrupts. When the message was sent and is pending in receive FIFO0, the NVIC sets TX and RX interrupt to ''pending'', but it doesnt execute them.

/*----------------------------------------------------------------------------
CAN transmit interrupt handler
*----------------------------------------------------------------------------*/
void USB_HP_CAN_TX_IRQHandler (void) {
if (CAN->TSR & CAN_TSR_RQCP0) { // request completed mbx 0
CAN->TSR |= CAN_TSR_RQCP0; // reset request complete mbx 0
CAN->IER &= ~CAN_IER_TMEIE; // disable TME interrupt
CAN_TxRdy = 1; 
}
}
/*----------------------------------------------------------------------------
CAN receive interrupt handler
*----------------------------------------------------------------------------*/
void USB_LP_CAN_RX0_IRQHandler (void) {
if (CAN->RF0R & CAN_RF0R_FMP0) { // message pending ?
CAN_rdMsg (&CAN_RxMsg); // read the message
CAN_RxRdy = 1; // set receive flag
}
}

Any help welcome! regards, raz draz
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    March 29, 2012
    Posted on March 29, 2012 at 22:28

    Then you probably need to check that the vector table is at the right address, and the handlers are correctly named in the startup.s (STM32F10x.s) file.

    Are you using the example as is, for the MCBSTM32, or are you modifying it?

    Have you tried talking with your Keil support rep?

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..