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.

Linux/PROCESSOR-SDK-AM335X: CAN error in data transfer

Part Number: PROCESSOR-SDK-AM335X


Tool/software: Linux

Hi All,

I have enabled the CAN in driver using following commands. I can able to up the driver, I cannot able to transfer and receive data.

I followed this Ti link ===>  processors.wiki.ti.com/.../Linux_Core_DCAN_User's_Guide

What am i missing ?

=>canconfig can0 bitrate 50000 ctrlmode triple-sampling on

can0 bitrate: 50000, sample-point: 0.875
can0 ctrlmode: loopback[OFF], listen-only[OFF], tripple-sampling[ON],one-shot[OFF], berr-reporting[OFF]

=>canconfig can0 start

[   80.111516] c_can_platform 481cc000.can can0: setting BTR=0500 BRPE=0001

can0 state: ERROR-ACTIVE

=>ifconfig

can0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          UP RUNNING NOARP  MTU:16  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:165


Here my dts file with respect to dcan0,
        dcan0_pins_default: dcan0_pins_default {
                pinctrl-single,pins = <
                        AM33XX_IOPAD(0x978, PIN_OUTPUT | MUX_MODE2)                                       /* d_can1_tx:             CANA_TXD */
                        AM33XX_IOPAD(0x97C, PIN_INPUT_PULLDOWN | MUX_MODE2)                 /* d_can1_rx:             CANA_RXD */
                        AM33XX_IOPAD(0x83C, PIN_OUTPUT_PULLUP | MUX_MODE7 )                   /* (U13) gpio1[15]:    CANA_EN */
                        AM33XX_IOPAD(0x8A0, PIN_OUTPUT_PULLDOWN | MUX_MODE7 )            /* (R1) gpio2[6]:         CANA_SLOPE */
                        AM33XX_IOPAD(0x8D8, PIN_OUTPUT_PULLDOWN | MUX_MODE7 )            /* (V4) gpio0[10]:      CANA_TERM */
                >;
        };

                         AM33XX_IOPAD(0x9E4, PIN_OUTPUT_PULLUP | MUX_MODE7 )                  /* (C14) gpio3[7]:      CAN_POWER_ENABLE*/

I m exporing the gpios with respect to dcan0, as mentioned below

echo 1 > /sys/class/gpio/gpio47/value    [CANA_EN]

echo 0 > /sys/class/gpio/gpio70/value    [CANA_SLOPE]

echo 1 > /sys/class/gpio/gpio10/value    [CANA_TERM]

echo 1 > /sys/class/gpio/gpio103/value  [CANA_POWER_EN]

I m using BUSMASTER and PCAN to view the transferred data. Its showing errors. No packets are transmitting.

Command : cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88

Can anyone help me to resolve this issue ?