- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CAN bus cannot transmit complete interrupt
I try to use all Interrupt for can
can erro and can RX can be use
but can TX all Interrupt invalid。
i need this to clear busoff flag
Solved! Go to Solution.
- Labels:
-
Automotive Traveo_II
- Tags:
- BusOff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OKay, in this case, there might be some problems with your TX interrupt handler.
Can you double check your CAN_TxMsgCallback function? Is that successfully implemented in main.c?
Here is a demo call back function, RxMsgCallback. I put it here for your reference.
Meanwhile, don't forget to update your canCfg configuration struct. The .txCallback feild is set to NULL by default, but you want to set it to your interrupt handler (namely CAN_TxMsgCallback())
Check if these changes bring it back to work.
Kind Regards,
Finn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bill-li,
So you are having some difficulties to trigger CAN interrupt on complete TX Transmission, right?
Have you set the interrupt enable bit accordingly? The "un_CANFD_CH_TXBTIE_t" bit in "stc_CANFD_CH_M_TTCAN" configure struct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your response!
I have set the relevant interrupt bit。
unIE.stcField.u1TCE = 1; /* Transmission Completed */
But still can not trigger send interrupt!However, errors and received interrupts can be triggered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OKay, in this case, there might be some problems with your TX interrupt handler.
Can you double check your CAN_TxMsgCallback function? Is that successfully implemented in main.c?
Here is a demo call back function, RxMsgCallback. I put it here for your reference.
Meanwhile, don't forget to update your canCfg configuration struct. The .txCallback feild is set to NULL by default, but you want to set it to your interrupt handler (namely CAN_TxMsgCallback())
Check if these changes bring it back to work.
Kind Regards,
Finn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you! I've already solved the problem。
Now there's a new problem。
I couldn't access the interrupt to receive new messages。
Which registers are set for this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Bill-li,
Glad to hear your last question is solved.
When you refers to "can't access receive interrupt", do you mean that you can not enter RX interrupt service routine? But in your first post, you said it works fine, not any longer now?
If you can not enter interrupt routine, you can try to set every bits in unIE.stcField to "1" according to TRM. (Though I think only the bits in your red circles matters in this case, I don't have a can device to test, so...better follows TRM). There are some other steps suggested in TRM, Chapter 23.6.6.3.
You can follow the whole process in Chapter 23.6.6.3 to see if it works. If works, then you can try disabling some irrelevant bits. If not works, you might check the TX terminal you are communicating with, whether it is correctly sending CAN messages or not.
Regards,
Finn