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.

TCAN4550: Cannot transfer or receive CAN messages

Part Number: TCAN4550

Hi Team, 

Good day. I'm posting this for our customer and they are using TCAN4550 demo program.

Main concern of the customer is they cannot transfer messages with this IC. They are using the TCAN4550 demo program, and have updated the SPI abstraction layer as mentioned in the TCAN45xx Software User's Guide.

None of the functions called from the Init_CAN function return false, we can assume that they have configured the SPI abstraction layer correctly. However, when running the CAN_Test function, there is no no messages being transceived on the CAN_HI or CAN_LO pins while using a logic analyzer. The TCAN4550 connected to another microcontroller which is waiting to receive CAN messages - it is not seeing the messages either. 

Could you please help us what we are missing here. 

Thank you for your support. 

Best regards, 

Jonathan

  • Jonathan,

    I've assigned this thread to an expert, but first, can you verify the mode of the device when attempting to transfer the messages, and have the register contents also been verified after configuration has been completed? Can the register configuration be shared?

    Regards,

    Eric Hackett 

  • Hi Jonathan,

    I would not assume the SPI abstraction layer has been correctly updated simply based upon the lack of false responses from the functions in the Init_CAN.  Since they have a logic analyzer, can they capture the SPI waveforms for all 4 of the SPI signals (nCS, SCLK, SDO, and SDI)?  

    Also, can they verify that they successfully write and read the registers through returning the values?  For example, can they read the Device ID registers 0x0000 and 0x0004 and does the values of 0x4E414354 and 0x30353534 get returned?

    The Test and Scratch Pad Register 0x0808 can be used to test the SPI write function and allows the ability to write a custom value that can be read back for verification. 

    If all the SPI Read/Write functions appear to be working properly, can they read back the Status and Interrupt Registers so that we can verify the device is functioning properly?  Please tell us the values for registers 0x000C, 0x0820, 0x0824, and 0x0830.

    If there is a problem with the SPI Abstraction Layer, we should be able to verify this by the previous tests.  But if all of the SPI Read/Write and Status/Interrupt register values appear correct, there is likely something that needs to be adjusted in the configuration. Eric has already asked for the configuration registers, but please provide this as well.  

    Regards,

    Jonathan

  • Hi Jonathan,

    Thank you for your resonse. Here is our customer's feedback as shown below.

    "I can confirm that the mode of the device is in standby prior to the Init_CAN function running. The device is then in normal mode immediately after initialization, and immediately prior to sending messages. I check this by storing the return value of (AHB_READ_32(0x0800) & (BIT7|BIT6)) >> 6 in variables and checked them while debugging. I can also confirm the register contents are being written correctly, at least in the Init_CAN function. I've placed all of the initialization functions which return a boolean value inside of an if statement, and none of the functions return false. I've also verified this on a logic analyzer. I will copy the code into the post following this one.

    So the code is too long, but I am using the same Init_CAN function from the demo code."

    Best regards,

    Jonathan

  • Hi Jonathan,

    Thanks for confirming that the SPI is functioning properly.  Can the customer verify the status registers I mentioned in my previous post? 

    Also, can we get the value of the Control Register 0x1018?  This is the CAN FD Controller control register and we need to verify that the INIT and CCE bits are set to "0" after the initialization routine is complete.  If these bits are "1" then the controller is in "initialization mode" and will not participate in activity on the CAN bus, even if the device may be in Normal Mode.  These bits are always set to "1" when making changes to any of the CAN configuration registers that are considered "protected." Also, when there are errors on the bus and the error counters exceed the maximum levels, these bits will be set to 1 to prevent the device from activity on the bus.  It is always good to verify the value of these bits in the debug process.

    If the code can't be shared in this forum, could it be shared directly through email?  If so I can send you an email.

    Regards,

    Jonathan

  • I've assigned this thread to an expert, but first, can you verify the mode of the device when attempting to transfer the messages, and have the register contents also been verified after configuration has been completed? Can the register configuration be shared?

    Hi Eric,

    Apologies for the delayed response. Here it is.

    uint32_t SI_registers[4];

    bool TCAN_Test_Registers(void)

    {

    // For example, can they read the Device ID registers 0x0000 and 0x0004 and does the values of 0x4E414354 and 0x30353534 get returned?

    if(AHB_READ_32(0x0000) != 0x4E414354) return false;

    if(AHB_READ_32(0x0004) != 0x30353534) return false;

    // The Test and Scratch Pad Register 0x0808 can be used to test the SPI write function and allows the ability to

    // write a custom value that can be read back for verification.

    uint16_t scratchpad_register = 0x0808;

    uint32_t custom_value = 0x88776655;

    AHB_WRITE_32(scratchpad_register, custom_value);

    if(AHB_READ_32(scratchpad_register) != custom_value) return false;

    // If all the SPI Read/Write functions appear to be working properly, can they read back the Status and Interrupt Registers

    // so that we can verify the device is functioning properly? Please tell us the values for registers

    // 0x000C, 0x0820, 0x0824, and 0x0830.

    SI_registers[0] = AHB_READ_32(0x000C);

    SI_registers[1] = AHB_READ_32(0x0820);

    SI_registers[2] = AHB_READ_32(0x0824);

    SI_registers[3] = AHB_READ_32(0x0830);

    return true;

    }

    Values for registers 0x000C, 0x0820, 0x0824, and 0x0830:

    - 0x00000008

    - 0x00000000

    - 0x00000000

    - 0x809628FF

  • Thanks for confirming that the SPI is functioning properly.  Can the customer verify the status registers I mentioned in my previous post? 

    Our customer had confirmed that the INIT and CCE bits of the Controller Register (0x1018) are both 0 after initialization.

  • Hi Jonathan,

    It doesn't look like the interrupt registers have any bits getting set, but it also looks like many of the interrupt bits have been disabled in the interrupt enable register.  We will need to know how the device is configured (both registers and MRAM) so that we can check for any configuration errors that may prevent the message transmission.

    Since you have indicated that you tried to share the full code, but were unable to do so because of the size, I will send you an email so that you can try to share it directly with me.

    Regards,

    Jonathan

  • Hi Jonathan, 

    Noted. I will update you the full code directly through your email. thank you

    Best regards,

    Jonathan

  • Hi Jonathan,

    Thanks.  I saw your recent email that had the code already posted in this thread.  I will be waiting for the rest of the code so that we can review it for errors and a reason messages are not being transmitted.

    Best Regards,

    Jonathan

  • Hi Jonathan,

    Thanks for sharing the customer code for my review.  I hope my feedback about the FDOE and BRSE bits being set to "0" to disable the CAN FD mode while the message header still has the FDF and BRS bits set to "1" is helpful.  I also hope the link to the full Bosch M_CAN User's Manual that gives additional detailed information about the configuration of the CAN registers and MRAM will be of value to the customer as well.

    Also, thanks for the follow up information that the customer found they were missing the 10uF capacitor on the VCCOUT pin and that adding it resolved the issue.  The VCCOUT is the internal 5V LDO that powers the CAN driver and it requires that cap for stability.  It is large enough to source extra current to an external circuit which is why it is called VCCOUT, but it is also used internally and the cap is not optional if they do not chose to use the LDO to power anything else.

    Best Regards,

    Jonathan