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.

TMS320F28386D: CAN communication problems with CM core

Part Number: TMS320F28386D

Tool/software:

Hi,

I'm trying to handle the DCAN_A with the core CM. I test my CAN hardware with CPU1 and it works ok.

I use the examples can_config_c28x for CPU01 and can_ex1_polling for CM.

I changed the CAN GPIO to GPIO62 and GPIO63:

The result is that with loopback external test mode it works fine.

But when I remove the test mode it receives messages ok; but to transmit it can't transmit last error, here registers:

Before sending message:

After sending message:

Last error is ACK error but I can use this DCAN_A fine with CPU01. So I don't think is a hardware problem.

I'm sending and receiving messages with PCAN. And the status after CM sends is Error Passive.

Any idea?

  • Hi Antonio,

    DCAN module can be allocated to either cores, CPU1/2 or CM and if allocated to a core, only that core can configure the CAN module.  This is done through API  SysCtl_allocateSharedPeripheral() called from CPU1.   Can you make sure that this API is executed first before CM configures DCAN_A?

    Regards,

    Joseph

  • Thanks for your reply Joseph.

    Yes. I'm using both examples: can_config_c28x in CPU01 and can_ex1_polling in cpu02. Then only change I've made is CAN_RX and CAN_TX GPIOs.

    I confirm that SysCtl_allocateSharedPeripheral() is called from CPU1 before CM is up.

    In addition I can receive messages to CM so the configuration must be ok. The problem is with ACK in transmit messages.

    Regards!

  • Hi Antonio,

    Thanks for the clarification.  When F28386D transmits data, is PCAN able to receive the data?  If PCAN is able to, you would need to disable the listen only mode so PCAN can send back an ACK bit after reception.  I assume you also have connected GPIO62/63 to an transceiver.

    Thanks.

    Joseph

  • Hi Joseph

    Yes, A transceiver is connected to GPIO62 and GPIO63. PCAN doesn't receive any data when F28386D transmit. 

    When listen only mode is disabled PCAN detects passive error in the bus. 

    With listen only mode enabled PCAN bus is ok, but no message is received.

  • Hi Antonio,

    Can you let me know which CAN example test case you ran on CPU1 where you were able to prove that CAN is able to receive and transmit messages with GPIO62 as RX and GPIO63 as TX?  Just trying to establish first that RX, TX and CAN Bus did not have issues when you ran example can_ex1_polling on CM.  By the way, are you using your custom F28386D board or are you using the ControlCard?  Just curious to see how GPIO63 is connected on your hardware.

    Thanks,

    Joseph

  • Hi Joseph,

    I ran my own app on CPU1 and CAN works ok (I've also checked on CPU2 and it works as well) . I tried to move CAN comms to CM core but CAN transmit message fails. Then I tried with C2000 (can_ex1_polling on CM and can_config_c28x on CPU1) examples but it also fails (I only changed GPIO to 62 and 63 in can_config_c28x example). This example with external loopback emulation works fine.

    I'm using my custom hardware and GPIO62 and GPIO 63 are connected to an transceiver

  • Hi Antonio,

    Can you check that CM clock is configured and running at 125MHz?  This should be set in the Device_init() function if you are running the the examples.

    Regards,

    Joseph