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.

DCAN Loopback TMS570LS3137

Other Parts Discussed in Thread: HALCOGEN

Hi everyone,

I'm having issues with the loopback, I've tried the example here but it does not work the code just stays in canIsRxMessageArrived() and does not progress despite canTransmit() returning success.

I gather messageBox is ignored when the identifier extension is disabled?

Would messageBox also be ignored for any interrupts?


cheers

Alan

  • Hi Alan,

    The link you embedded is broken, would you please post it again?

  • Hi, i've fixed the link, it appended the text of the hyperlink....

  • Thanks Alan,

    I haven't had a chance to try the code yet, might need to get Haixiao...


    But quick look at it - your first question is related to the parameter messageBox in the function canIsRxMessage arrived - correct?

     

    I don't see why messageBox would be related to the extended identifier use or not - message box is a block of RAM in the DCAN's message RAM that is programmed to match a can bus message.   So whether or not that message RAM entry is configured to use the extended address - I don't think matters as far as the status of this message goes. 

    Am I off-base on the original question?

    EDIT:  also back to the original question - I understand that you can't get this project to work is that right?  Which hardware platform / device are you trying, and have you made any mods to the project?

    Also do you have any connections made to the can bus even if it's just jumpering the two CAN bus connectors on the HDK together?

  • Hi,


    I've continued trying other setups and it looks like CAN is not functioning properly, I'm not sure if i have missed something, I've simplified as much as I can.  I'm using the TMS570LS31HDK.

    My halcogen file is attached, in the main function I have the following

        _enable_IRQ();
        vimInit();
        canInit();

        canTransmit(canREG1, canMESSAGE_BOX1, tx_data);
        while(!canIsRxMessageArrived(canREG2, canMESSAGE_BOX1));
        canGetData(canREG2, canMESSAGE_BOX1, rx_data);

    I have attached CAN1 H to CAN2 H and CAN1 L to CAN2 L


    What am i missing?

    Alan

    2727.PIF_DCAN.zip

    5008.can.c

  • Alan,

    I tried to build based on what you posted in the previous message, but I'm missing the definition of rx_data and tx_data.

    It would be great if you could attach your entire main file - in case there's anything else.  I pasted the code from the message into the body of sys_main.c and added #includes for can.h and vim.h but that didn't take care of rx_data and tx_data.

     

  • Hi,

    here is a zip file with the whole code

    Alan

    5822.Copy of PIF_DCAN.zip

  • With DCAN1_H connected to DCAN2_H & DCAN1_L connected to DCAN2_L; DCAN2 receives tx_data in canMESSAGE_BOX1 and copies it to rx_data.

    My intended interrupts work too, I've attached the full code just in case it helps people, it works well with tms570lshdk as I have visual verification with 2 flashing LEDs for all is OK and a third for when CAN fails.

    I have no idea how to get the internal or external loopback to work but personally this is now a moot point.

    1512.PIF_DCAN.zip