2017-11-30 12:59 AM
Hi,
I have some issue setting up CAN for STM32F302 using Keil. As a starting point I used the Keil STM32 CAN Example:
http://www.keil.com/download/docs/351.asp
Everything seems to work, except the interrupt handling. After startup can only send one CAN message (verified with external CAN-USB monitor), and I�m not able to receive any CAN messages.
After sending the first successful CAN message, CAN_TxRdy[0] is NOT set to �1�.
Interrupt related code:
NVIC_EnableIRQ(USB_HP_CAN1_TX_IRQn); /* enable CAN TX interrupt */
/*----------------------------------------------------------------------------
CAN transmit interrupt handler *----------------------------------------------------------------------------*/void USB_HP_CAN1_TX_IRQHandler (void) {if (CAN1->TSR & CAN_TSR_RQCP0) { /* request completed mbx 0 */
CAN1->TSR |= CAN_TSR_RQCP0; /* reset request complete mbx 0 */ CAN1->IER &= ~CAN_IER_TMEIE; /* disable TME interrupt */ CAN_TxRdy[0] = 1; } }Why I can only send one message, or whats causing the CAN TX interrupt handler not being called?
Thanks
#can-stm32f302-interrupt #can-communitation2018-08-10 09:11 AM
Sorry, bumping old zombie unanswered threads off my feed