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.

TMS570LC4357: Problem sending CAN message

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello,

I am currently working with the Hercules TMS570LC43x LaunchPad Development kit. What I am trying to do is to send CAN message to another MCU, more specifically the Hercules Safety MCU Development Kit, TMS570 MCU. I have been able to send a CAN message from the Development kit to the LaunchPad, however, I am not able to send a message the other way around. I only have this problem with the LaunchPad.

I configured the LaunchPad in HALCoGen using the following configurations :

- TMS570LC4357ZWT chip

- enabled CAN1 driver

- disabled Identifier Extension (I need to use 11 bit identifiers)

- configured the first message box of CAN1 to TX and configured the identifier, and activated the message box

In the code :

- I enabled error notification on canREG1

- I read the canREG1 error and status register

- try to transmit

After a very short while, the canErrorNotification is triggered, with notification = 96, at this point the error and status register of canREG1 has the value 99, after reading the documentation of the MCU, this means that the bits EPass and EWarn are set, and the last error code is 3H, meaning Ack Error. I want to note that there is another node, as the LaunchPad is connected via CAN to the Hercules Development MCU, and in this same configuration I can send CAN messages from the development kit to the launchpad, triggering a canMessageNotification on the LaunchPad.

I do not know why there is an Ack Error when trying to transmit, I would think that there is a mismatch when configuring the two nodes, however, in HALCoGen, the general section of CAN1 on both mcus is the same.

I have read that a node writes a recessive bit int he ACK slot, i.e. does not acknowledge the message, if the CRC is not valid for that message. However, if I debug the development kit mcu, the receiver, and check the status and error register of CAN1, I do not see a CRC error.

If I can provide any more information please do not hesitate to ask.

Thank you.

  • CAN communication almost always exhibits early troubles that are cleared by getting the comm wiring correct. Correctly wired. Correctly setup with a terminating resister.

    I personally find a USB CAN logger to be useful to seeing what traffic is showing up.
  • I think that the wiring setup was correct since I was able to receive a message. However, upon further investigation, I discovered to my surprise, that the LaunchPad Development Kit board does not come with CAN transceivers. Which is why I was not able to send messages using the board. It was interesting that it received messages, however, the sender would never receive the acknowledgement confirmation.
    So all in all, I assume that the wiring and the code setup was correct, but I did not expect the LaunchPad to be missing CAN transceivers.
    Thank you for your help
  • Hi Adrian,

    The Launchpad doesn't have CAN transceiver. You can test your code using CAN1 and CAN2 on the HDK.