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.

TCAN4550EVM: TX and RX is not working properly.

Part Number: TCAN4550EVM
Other Parts Discussed in Thread: TCAN4550

Hi Team,

We are testing CAN bus communication by using our application. We have connected one can slave and can analyzer for debugging.

We are trying to send and receive custom messages. Can analyzer is able to capture few messages but we are observing failure log in driver.

we are using these configuration for frequency and mram. 

spi-max-frequency = <18000000>;
bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;

Please find the below mentioned error messages.

[  126.003756] tcan4x5x spi1.0 can0: __can_get_echo_skb: BUG! Trying to access can_priv::echo_skb out of bounds (65/max 1)

  126.082237] tcan4x5x spi1.0 can0: can_put_echo_skb: BUG! echo_skb 0 is occupied!

[  126.292696] tcan4x5x spi1.0 can0: __can_get_echo_skb: BUG! Trying to access can_priv::echo_skb out of bounds (199/max 1)

Could you please check and update on this.

.

Regards

Ramji Mishra

  • Hello Ramji,

    I can't determine too much from the error messages, but one of the most common issues with CAN communication is with the CAN message bit timing configuration.  They need to be set the same as with your CAN Analyzer.  Can you confirm the CAN bit timings match for all devices on your test system?

    Regards,

    Jonathan

  • Hi Jonathan,

    Bit timing configuration seems ok. We debugged. we got few points.

    1)We got beer counter error during driver loading itself.

    [ 35.188165] TCAN4X5X_ENABLE_TCAN_INT_DATA= 0x00008032
    [ 35.205807] ****INSIDE M_CAN SETUP RET=0******
    [ 35.210625] **********GET_BERR_COUNTER********
    [ 35.215209] ****INSIDE THE REGISTER MCAN RET=0******
    [ 35.216988] **********GET_BERR_COUNTER********
    [ 35.220225] tcan4x5x spi1.0: m_can device registered (irq=147, version=32)
    [ 35.226682] **********GET_BERR_COUNTER********
    [ 35.231605] ******MCAN-CLASS-RET=0
    [ 35.231605] ******
    [ 35.236056] tcan4x5x spi1.0 can0: TCAN4X5X successfully initialized.
    root@CT-100:~# [ 35.268560] **********GET_BERR_COUNTER********

    2)We checked RX handler function (m_can_rx_handler). it is going inside m_can_handle_bus_errors.

    if (irqstatus & IR_ERR_BUS_30X){
    work_done += m_can_handle_bus_errors(dev, irqstatus, psr);
    }

    then it is going to m_can_handle_other_err.

    /* other unproccessed error interrupts */
    m_can_handle_other_err(dev, irqstatus);

    Is interrupt creating any issue.

    Could you please check and update on this.

    Regards

    Ramji Mishra

  • Hello Ramji,

    1)We got beer counter error during driver loading itself.

    I'm a little confused.  How are you expecting to have valid CAN communication before or during the device initialization?  The TCAN4550 should be completely configured before being placed in Normal mode and clearing the Initialization (INIT) bit in the Control Register (0x1018[0])?

    Bus errors are usually caused by one of two reasons.  The first is poor signal integrity from an improperly terminated bus, improper wire type, or a long bus with stubs, etc.  If you are just trying to get communication running between your analyzer and the test board, check that there is a set of termination resistors at both ends.  If possible use a scope to check the signals for any obvious imperfections.

    The second common issue is the sample point locations for the nominal bit timing configuration is set differently on the nodes when doing CAN FD with Bit Rate Switching.  I assume you are trying to do CAN FD messages with a faster data rate.  If so, the change from the slower Arbitration or Nominal bit rate to the faster Data rate occurs at the sample point (SP) in the Bit Rate Switch (BRS) bit.  This sample point location is set by assigning a number of time quantum (tq) before the SP and a number of tq after the SP.  The total number of tq defines the bit period and therefore the bit rate.

    If two devices on the bus have the same number of tq configured, they will operate at the same bit rate.  However, if the SP is different and they have a different number of tq before and after the SP, the nodes will switch from the slower nominal bit rate to the faster data bit rate at different times.  This can cause the devices to sample the faster FD bits at an incorrect location and this can result in a bus error frame getting generated. 

    I would suggest that you verify the SP location for the Nominal and Data bit timing for both the TCAN4550 and the Analyzer.  If there is a mismatch, this could be the reason you are getting bus errors.

    Regards,

    Jonathan