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: Unable to receive data over CANbus

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hello

We recently acquired the TMS570lc dev kit. We are trying to establish can communication. In DCAN1 msgbox1 is configured as transmitter and msgbox2 is configured for receiving messages. Interrupt is enabled for receiving the data. We are able to run the sample code of internal loopback for CAN successfully. Now we need to test the communication with other nodes. On the other end we are using a CanBus Analyser.

We are successfully able to transmit data from the dev board but we are able receive data back. Neither in interrupt mode nor in polling mode.

The Rx interrupts are enabled in VIM channel. In the attachment you can find the project that is created to check CAN communication. The drivers were created using HalCoGen v04.06.00.

Kindly help us in resolving the issue

8270.TMS_CANTEST2.rar

Regards

Aditya Saini

  • Hello Aditya,
    Please check the Mask for acceptance filtering.
    You could set mask to 0x000 to accept all messages while debugging this issue.

    Best regards,
    Miro

  • Hello,
    can you specify which sample code for internal loopback you use for test to take a look?

    Thanks
    Michail
  • Hello Miroslav

    By acceptance filtering mask, do you mean the mask on IF2MSK for message box2 register? I tried changing that but I am not seeing any data activity on receiving end.

    Regards
    Aditya Saini
  • Hello Michail

    The one given in C:\ti\Hercules\HALCoGen\v04.07.00\examples\TMS570LC43x in this directory, example_canCommunication_loopback.c .
  • Hello Aditya,
    Yes, in your HALCoGen project, I saw that mask is 0x7FF. This means that all bits of ID are checked. If you change it to 0x00 all messages will be accepted. On HDK board (I assume this is the board you are using: www.ti.com/.../TMDX570LC43HDK ) you have 2 CAN transceivers. Did you try to connect those two nodes and use only onboard devices as two nodes (connect CANH on CAN1 to CANH on CAN2, CANL --> CANL ).

    Best regards,
    Miro
  • Hello Miroslav

    Thanks for your input. I changed the mask and connected the two nodes on the board and I was able to transmit and receive data successfully. I tried with another TMS570lc dev kit and that too is working fine. But the receiving of data from can analyser still doesnt work.

    Also, since it works only if the mask is 0x00, am I now always suppose to keep that mask as 0x00 to make it work?

    Regards
    Aditya Saini
  • Hello,
    You can set the mask according to messages that you want to be received by the message box. Message box with mask 0x00 will accept all messages. When mask is set to 0x7FF (if 11-bit ID is used) only messages with the same ID as receiver will be accepted. A '1' in mask bits means that the corresponding bit in message identifier is used for acceptance filtering.
    In case your message box is with ID 01 and mask is 0x7FF then only messages with ID 01 will be accepted.

    Please, refer to Figure 27-4 and Table 27-2 in device TRM (  ) where structure of message box is described.

    Best regards,
    Miro

  • Hello Miroslav

    Thanks for the quick reply. So if there is a mask then the device shall accept data from that particular device which has that particular ID. But what if I need to have multiple message IDs for the device ? In that case do I need to keep the mask as 0x00?

    Also that still doesnt explain why its not working with can-analyser tool even without the mask.

  • Hello,
    Regarding can-analyzer, I am not familiar with this analyzer. What I can say is, check whether all settings corresponds to settings of Hercules board.
    About mask. Every bit of mask defines whether corresponding bit of incoming ID will be checked.
    Good example could be found here: e2e.ti.com/.../248476

    Best regards,
    Miro