This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CAN receive problems

Other Parts Discussed in Thread: HALCOGEN

Hello,

I have some problems with the DCAN receive on the Launchpad XL2-RM46, my setup is the following:

I have an external CAN Master (PCAN). This master is connected to the CAN1 of the Launchpad. I can send CAN messages to the PCAN but I have problems receiving messages from PCAN. I have configured the MessageBox1 as RX channel with ID 1.

I do the following:

1) Send a message with ID 0x1 to the Launchpad. ( I am sure that this message is received by the Launchpad because I am checking the CAN Rx line with a scope)

2) On the Launchpad I have the following program running:

canInit();
int rx_data[10];
while (1){
    while(!canIsRxMessageArrived(canREG1, canMESSAGE_BOX1));
    canGetData(canREG1, canMESSAGE_BOX1, rx_data);  
}

The program got stuck in the while loop (canIsRxMessageArrived).

But I do see the CAN message is acknowledge from the Launchpad (the PCAN does not try any retransmission) and I also see in the DCAN1_ES register the bit 4 (RX.Ok) is set (what does mean a CAN messages was received). But I don't understand how can I receive a CAN message without the DCAN1->NWDAT12 bit being set. Are there any hardware background processing overwriting this bit? 

All code I am using is generated with Halcogen version 4.05.02

Another strange fact: sometimes when playing around with the hardware, doing minor software modifications, ... I do receive Rx messages. But I can not at all reproduce this effect and it is definitely not related to software changes.

best

Matthias

  • Are you sending the message with an extended ID (29 bit ID)? Make sure you have the "Enable Identifier Extension" check box set or cleared to match the ID being sent by the PCAN tool.
  • Hi,

    no that's not the problem.
    But I figures something out, I just tested it with a new Launchpad and now everything is working. The following problem did also disappear when using a new Launchpad.
    e2e.ti.com/.../1931744

    So I guess I am having some hardware effect but what hardware problem could lead to these effects? I have strong arguments to point to the hardware but my gut feeling is not yet happy ;-)

    best
    Matthias