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.

TMS320F28377D: can_external_transmit does not receive message

Part Number: TMS320F28377D
Other Parts Discussed in Thread: SN65HVD235

Hi all,

I have been trying to set a CAN communication between CANA and CANB based on can_external_transmit.c example

I have no access to the same example PINs for CANbus, namely 30,31, 10 and 8. However, my board has transceivers (SN65HVD235) with RXA and TXA for 36 and 37, and TXB and RXB for 38 and 39,  respectively.

I have modified accordingly the GPIO muxing as follows, and I thought it was the only modification needed, given that the HW is in place:

//

GPIO_SetupPinMux(36, GPIO_MUX_CPU1, 6); //GPIO36 - CANRXA
GPIO_SetupPinOptions(36, GPIO_INPUT, GPIO_ASYNC);
GPIO_SetupPinMux(37, GPIO_MUX_CPU1, 6); //GPIO37 - CANTXA
GPIO_SetupPinOptions(37, GPIO_OUTPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(39, GPIO_MUX_CPU1, 6); //GPIO39 - CANRXB
GPIO_SetupPinOptions(39, GPIO_INPUT, GPIO_ASYNC);
GPIO_SetupPinMux(38, GPIO_MUX_CPU1, 6); //GPIO38 - CANTXB
GPIO_SetupPinOptions(38, GPIO_OUTPUT, GPIO_PUSHPULL);

//

I have already come across some help given on a similar issue in here: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/780470/tms320f28379d-can_external_transmit-code-not-working-with-changed-cantxa-canrxa-pin-to-gpio19-and-gpio18

However this has not helped in my case. I have a connection between CANA and B, so I have no missing node. 

The firmware executes the TXmessage update, but it seems to never perform a reception, as the interrupt is never triggered. 

Any help is very much appreciated.

Thanks,

Nicola

  • It appears you are using bit-fields and not the Driverlib. To rule out any hardware issues, I suggest running the driverlib example “as is” with the exception of the modification needed for the GPIO pin reassignment. The example C file has the following statements:

    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXA);
    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXA);
    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANRXB);
    GPIO_setPinConfig(DEVICE_GPIO_CFG_CANTXB);
    

    • The function GPIO_setPinConfig(uint32_t pinConfig) is in gpio.c file.
    • The argument DEVICE_GPIO_CFG_CANRXA is in device.h file

    #define DEVICE_GPIO_CFG_CANRXA      GPIO_30_CANRXA  // "pinConfig" for CANA RX

    The constant #define GPIO_30_CANRXA         0x00081C01U  is defined in pin_map.h file 

    To change the GPIO mapping, edit the device.h file as follows:

    // Modified configuration (GPIOs 70,71,72,73 shown as an example)
    #define DEVICE_GPIO_CFG_CANRXA      GPIO_70_CANRXA  // "pinConfig" for CANA RX
    #define DEVICE_GPIO_CFG_CANTXA      GPIO_71_CANTXA  // "pinConfig" for CANA TX
    #define DEVICE_GPIO_CFG_CANRXB      GPIO_73_CANRXB  // "pinConfig" for CANB RX
    #define DEVICE_GPIO_CFG_CANTXB      GPIO_72_CANTXB  // "pinConfig" for CANB TX
    

    Note: device.h file is unique to every example directory in the workspace. The edits you make for one project will not get carried over across other projects.

     

    Please download my Application report http://www.ti.com/lit/sprace5. It has many tested examples. I request you to look at the Debug tips provided. Most CAN issues can be resolved by going through this checklist.