Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 227333

Forum Post: MSPM0G3507: CAN RX gets stuck when multible message are incoming

$
0
0
Part Number: MSPM0G3507 Other Parts Discussed in Thread: SYSCONFIG Tool/software: Hey there, I adapted the example project mcan_message_rx_LP_MSPM0G3507_nortos_ticlang for receiving of CAN message. If I send a CAN message from my PC CAN dongle (PCAN VIEW) the MSPM0G3507 triggers a CAN-RX-Interrupt and receives and processes the received message. From time to time a single message does not trigger and interrupt.. But when I send a second message before the first one is processed, the second one is not processed. And when I send multiple messages in a short time the CAN reveive seems to get completely stuck. Even if I wait some time a new CAN message won't trigger a new interrupt. I need to restart my debug session to be able to receive CAN messages again. I made a "watch expression" on "gInterruptLine1Status". It changes to 0x0002000C or 0x00020004 when the receiving stops. From the technical reference manual I found out that this seems to be the (raw or masked) interrupt status register value. And the SEC (single error correction) and/or the DED (dual error detection) bits are set. I added/edited the following configurations to my sysconfig to somehow trigger an interrupt or anything else to be able to deal with the "getting stuck". MCAN1.m0interrupts = ["DL_MCAN_MSP_INTERRUPT_DOUBLE_ERROR_DETECTION","DL_MCAN_MSP_INTERRUPT_LINE0","DL_MCAN_MSP_INTERRUPT_LINE1","DL_MCAN_MSP_INTERRUPT_SINGLE_ERROR_CORRECTION "]; MCAN1.interruptLine = ["DL_MCAN_INTR_LINE_NUM_0","DL_MCAN_INTR_LINE_NUM_1"]; MCAN1.rxFIFO0size = 10; MCAN1.rxFIFO0waterMark = 8; MCAN1.interruptFlags = ["DL_MCAN_INTERRUPT_RF0F","DL_MCAN_INTERRUPT_RF0N","DL_MCAN_INTERRUPT_RF0W"]; MCAN1.interruptLine0Flag = ["DL_MCAN_INTERRUPT_RF0F","DL_MCAN_INTERRUPT_RF0W"]; But none of my interrupt cases get triggered apart from the rx interrupt. This is my CAN-interrupt-handler: void MCAN0_INST_IRQHandler(void) { printf("\nCAN_IRQ_handler"); switch (DL_MCAN_getPendingInterrupt(MCAN0_INST)) { case DL_MCAN_IIDX_LINE0: // RX FIFO 0 Full - interrupt __BKPT(0); /* Check MCAN interrupts fired during TX/RX of CAN package */ gInterruptLine0Status |= DL_MCAN_getIntrStatus(MCAN0_INST); DL_MCAN_clearIntrStatus(MCAN0_INST, gInterruptLine0Status, DL_MCAN_INTR_SRC_MCAN_LINE_0); printf("\nCAN_IRQ_Line0"); gServiceInt0 = true; break; case DL_MCAN_IIDX_LINE1: // RX FIFO 0 New Message - interrupt /* Check MCAN interrupts fired during TX/RX of CAN package */ gInterruptLine1Status |= DL_MCAN_getIntrStatus(MCAN0_INST); DL_MCAN_clearIntrStatus(MCAN0_INST, gInterruptLine1Status, DL_MCAN_INTR_SRC_MCAN_LINE_1); printf("\nCAN_IRQ_Line1"); gServiceInt1 = true; break; case DL_MCAN_IIDX_SINGLE_ERROR_CORRECTION: __BKPT(0); break; case DL_MCAN_IIDX_DOUBLE_ERROR_DETECTION: __BKPT(0); break; default: __BKPT(0); break; } } Can anyone please help me? If you need any more information, please let me know ;) Thanks a lot in advance! Matze

Viewing all articles
Browse latest Browse all 227333

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>