2012-03-29 12:32 PM
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
2012-03-29 01:28 PM
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?