CAN transmission can not be completed after starting one transmission

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN transmission can not be completed after starting one transmission

539 Views
kunxu
Contributor II


Hi , I started one transmission of MSCAN using the code as follows. However, the program is always running in the code"while ( (CAN1TFLG & txbuffer) != txbuffer);". And can not jump out. I checked the registers, and the CAN1TFLG=0b00000110. Which means TX0 buffer in not empty after I start one transmission. What is the problem?

___________________________________________________________________________

......

CAN1TBSEL = CAN1TFLG; /* Select lowest empty buffer */

txbuffer = CAN1TBSEL; /* Backup selected buffer */

......

CAN1TFLG = txbuffer; /* Start transmission */

while ( (CAN1TFLG & txbuffer) != txbuffer); /* Wait for Transmission* completion*/

_________________________________________________________________________

Labels (1)
0 Kudos
2 Replies

367 Views
RadekS
NXP Employee
NXP Employee

I guess that message from TX0 buffer cannot be delivered.

It means that MSCAN module try send this message again and again, but module didn’t receive any acknowledge from any other CAN node.

Note: this typically means cumulative increasing of MSCAN transmit error counter. Transmitter could continue in repeated sending until error counter(s) achieve dedicated level (bus-off).

Please check:

  1. your CAN bus topology. For example if second CAN node isn’t in listen-only mode, any hardware issue, transceiver status or any problems with acceptance filters.
  2. your error counters and potentially follow up Bus-Off Recovery.

When CAN module receives acknowledge, transmit buffer is released automatically.

367 Views
kunxu
Contributor II

    Hi Radek,

      Thank you very much for your quick and nice reply.  

     The codes run well now. I have a better unstanding of the transmission mechnism of CAN bus with your nice help. In fact, the problem lies in the isolation chip ISO 7221, which blocks the route of receiving message from CAN bus:smileylaugh:

0 Kudos