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.

  • TI Thinks Resolved

DRA72XEVM: DRA7 EVM Jacinto 6 (ES1.0) running with SDK 5 - cansend does not work but candump does

Intellectual 600 points

Replies: 4

Views: 205

Part Number: DRA72XEVM

We have a DRA7 EVM Jacinto 6 (ES1.0) that we are running Arago / Yocto Linux with SDK 5.00.
I have noticed that there is a DCAN1 interface on this board. I intend to use it.

I connected it to my PC using a USB-CAN Analyzer.

On my Jacinto 6 (ES1.0) I used JP1 for the CAN connections. CAN_H pin to top pin, CAN_L pin to bottom pin. And middle pin left unconnected.
I noticed that middle pin on JP1 that is supposed to be ground is not grounded on my board. So instead I connected the ground from the CAN Analyzer to another ground on the board.

I added can-utils to the board. In order to configure the DCAN1, I simply did:

ip link set can0 type can bitrate 125000
ip link set up can0
[   35.955142] c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000

At this point I can read can messages from my PC via candump on Jacinto 6. So that at least should confirm the connections are correct I hope.
 
  root@dra7xx-evm:~# candump can0
  [   50.294194] can: controller area network core (rev 20170425 abi 9)
  [   50.300556] NET: Registered protocol family 29
  [   50.314986] can: raw protocol (rev 20170425)
  can0  00000001   [8]  11 22 33 44 55 66 87 88
  can0  00000001   [8]  11 22 33 44 55 66 87 88
  can0  00000001   [8]  11 22 33 44 55 66 87 88
  can0  00000001   [8]  11 22 33 44 55 66 87 88
  can0  00000001   [8]  11 22 33 44 55 66 87 88

However, I didn't manage to send any CAN messages via "cansend"

root@dra7xx-evm:~# cansend can0 01a#11223344AABBCCDD

Further information:

root@dra7xx-evm:~# lsmod | grep can

can_raw                20480  0
can                    28672  1 can_raw
c_can_platform         16384  0
c_can                  20480  1 c_can_platform
can_dev                24576  1 c_can



root@dra7xx-evm:~# dmesg | grep can

[    0.460881] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.461084] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.461432] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.461686] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.462043] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.462418] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.462785] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/fixedregulat'
[    0.667575] of_get_named_gpiod_flags: can't parse 'gpios' property of node '/ocp/axi@0/p'
[    0.667585] of_get_named_gpiod_flags: can't parse 'gpio' property of node '/ocp/axi@0/pc'
[    2.931812] of_get_named_gpiod_flags: can't parse 'hpd-gpios' property of node '/connect'
[    2.938574] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/displ'
[    2.938582] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/displa'
[    3.293766] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@'
[    3.293772] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@4'
[    3.294935] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@'
[    3.294941] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@4'
[    3.514725] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@'
[    3.514734] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@4'
[    3.896781] of_get_named_gpiod_flags: can't parse 'hpd-gpios' property of node '/connect'
[    3.897119] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/displ'
[    3.897124] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/displa'
[    3.910109] of_get_named_gpiod_flags: can't parse 'wp-gpios' property of node '/ocp/mmc@'
[    3.910115] of_get_named_gpiod_flags: can't parse 'wp-gpio' property of node '/ocp/mmc@4'
[    8.337118] of_get_named_gpiod_flags: can't parse 'gpio-reset' property of node '/ocp/i2'
[    8.388822] of_get_named_gpiod_flags: can't parse 'mux-gpios' property of node '/ocp/i2c'
[    8.388858] of_get_named_gpiod_flags: can't parse 'reset-gpios' property of node '/ocp/i'
[    8.388863] of_get_named_gpiod_flags: can't parse 'reset-gpio' property of node '/ocp/i2'
[    8.388881] of_get_named_gpiod_flags: can't parse 'powerdown-gpios' property of node '/o'
[    8.388885] of_get_named_gpiod_flags: can't parse 'powerdown-gpio' property of node '/oc'
[    8.625927] ahci 4a140000.sata: SSS flag set, parallel bus scan disabled
[   10.285194] of_get_named_gpiod_flags: can't parse 'id-gpios' property of node '/extcon_u'
[   10.285520] of_get_named_gpiod_flags: can't parse 'vbus-gpios' property of node '/extcon'
[   10.285524] of_get_named_gpiod_flags: can't parse 'vbus-gpio' property of node '/extcon_'
[   10.287148] of_get_named_gpiod_flags: can't parse 'id-gpios' property of node '/extcon_u'
[   10.287601] of_get_named_gpiod_flags: can't parse 'vbus-gpios' property of node '/extcon'
[   10.287607] of_get_named_gpiod_flags: can't parse 'vbus-gpio' property of node '/extcon_'
[   10.376541] c_can_platform 4ae3c000.can: c_can_platform device registered (regs=fce3c000)
[   10.695128] of_get_named_gpiod_flags: can't parse 'simple-audio-card,hp-det-gpio' proper'
[   10.695138] of_get_named_gpiod_flags: can't parse 'simple-audio-card,mic-det-gpio' prope'
[   35.955142] c_can_platform 4ae3c000.can can0: setting BTR=1c09 BRPE=0000
[   50.294194] can: controller area network core (rev 20170425 abi 9)
[   50.314986] can: raw protocol (rev 20170425)



In the devicetree, I have:

dra7.dtsi

dcan1: can@4ae3c000 {
            compatible = "ti,dra7-d_can";
            ti,hwmods = "dcan1";
            reg = <0x4ae3c000 0x2000>;
            syscon-raminit = <&scm_conf 0x558 0>;
            interrupts = <GIC_SPI 222 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&dcan1_sys_clk_mux>;
            status = "disabled";
        };

        dcan2: can@48480000 {
            compatible = "ti,dra7-d_can";
            ti,hwmods = "dcan2";
            reg = <0x48480000 0x2000>;
            syscon-raminit = <&scm_conf 0x558 1>;
            interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&sys_clkin1>;
            status = "disabled";
        };

dra7-evm.dts

...

dcan1_pins_default: dcan1_pins_default {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x37d0, PIN_OUTPUT_PULLUP | MUX_MODE0) /* dcan1_tx */
            DRA7XX_CORE_IOPAD(0x3818, PULL_UP | MUX_MODE1) /* wakeup0.dcan1_rx */
        >;
    };

    dcan1_pins_sleep: dcan1_pins_sleep {
        pinctrl-single,pins = <
            DRA7XX_CORE_IOPAD(0x37d0, MUX_MODE15 | PULL_UP)    /* dcan1_tx.off */
            DRA7XX_CORE_IOPAD(0x3818, MUX_MODE15 | PULL_UP)    /* wakeup0.off */
        >;
    };

...

&dcan1 {
    status = "ok";
    pinctrl-names = "default", "sleep", "active";
    pinctrl-0 = <&dcan1_pins_sleep>;
    pinctrl-1 = <&dcan1_pins_sleep>;
    pinctrl-2 = <&dcan1_pins_default>;
};


Why might the cansend not be working? Any help is greately appreciated.

  • Hi Mustafa,

    can you try to run 'cansend' like this:

    cansend can0 123#11223344

    and see if it works?

    Regards,

    Yordan

  • In reply to Yordan Kamenov:

    Unfortunately it does not work still.

    root@dra7xx-evm:~# cansend can0 123#11223344
    [  160.256158] can: controller area network core (rev 20170425 abi 9)
    [  160.263152] NET: Registered protocol family 29
    [  160.274740] can: raw protocol (rev 20170425)

  • In reply to Mustafa Ozcelikors:

    Hi,

    Did you try the CAN loopback mode?

    Also, please post the output of the following - 

    ip -details link show can0

     


    Regards,

    Karan

  • In reply to Karan Saxena:

    Hi,

    I haven't heard back from you, I'm assuming you were able to resolve your issue.

    If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Regards,

    Karan

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.