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.

Receiving CAN messages

Other Parts Discussed in Thread: HALCOGEN

Hi,

I"m trying to get the TMDX570LS04HDK to receive CAN messages.

I was able to send messages but not to receive anything, using both canIsRxMessageArrived() as in example_canCommunication.c and using interrupts as in example_canIntCommunication.c.

I even tried to set the mask on the message box to 0, nothing seems to work.

The demo CAN program is also not receiving anything (is it listening on specific identifiers?), both on my lab setup and also on a real vehicle network.

Am I missing something?

Thanks

  • Yaron,

    I assume the examples are the examples included with HalCoGen.  They require some setup in the HalCoGen GUI.  Sometimes this is missed.  These setup instructions are in the head of the C file as comments:

    For example:

    *   @b Step @b 3:
    *
    *   Configure CAN Baudrate:
    *
    *   Navigate: -> TMS570LSxx /RM4 -> CAN
    *
    *   @image html can1baud.JPG "Figure: CAN1 BaudRate Configuration"
    *   @image html can2baud.JPG "Figure: CAN2 BaudRate Configuration"

    They really show up better as documentation if you open the help.

    So you probably already did these steps, but the first thing I'd ask is to confirm that you have.

    Second question would be assuming that you are using HalCoGen which version are you using. The 3.08.00 update had some problems in typecasting that made a few examples not work so maybe it's one of those.

    Regarding the CAN demo program - is this the safety demo that you're referring to?  Did you rebuild anything there or are you using one of the pre-built binaries?

  • Yes I"m trying to run the safety demo using the pre-built binaries.

    Is it listening on specific CAN identifiers?

    I'm suspecting the default HalCoGen configuration is set to send and receive extended CAN identifiers. Is that right?

     

    Thanks

  • Yaron,

    In the Safety Demo, the CAN module is using extended CAN identifiers.
    The baud rate is programmable as 125 kBit/s, 500 kBit/s, 750 kBit/s, 1000 kBit/s.
    Only messages with ID=1 will be displayed.

    Please let me know if I've answered your question.

  • Yaron,

    attached is a step-by-step procedure to transmit and receive with CAN. First part is HalCoGen, 2nd part is CCS.

    Regards

    Frank

     

    RM48HDK_Lab3_2(DCAN1 transmit and receive).pdf