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