flexcan on NEO?

Discussion in 'General Discussion' started by Paul Cox, Oct 31, 2015.

  1. Davide Faconti

    Davide Faconti New Member

    Joined:
    Feb 10, 2016
    Messages:
    6
    Likes Received:
    1
    All right, just installed a fresh RC1 image. uname -a returns, as expected

    At the beginning there is no can bus visible through ifconfig -a, as expected.

    I used the Device tree editor as follows:
    -) drag and dropped CANBUS 1,
    -) pressed "SAVE",
    -) waited for confirmation message on screen
    -) rebooted.

    This time things looks a little better

    The entire dmesg can be found here http://pastebin.com/a3Qx6sSa

    Unfortunately ifconfig -a doesn't show any can0 device,
     
  2. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Then I suggest to try to put those pins as GPIO to verify if the GPIO lines are working
     
  3. Flavio Battimo

    Flavio Battimo New Member

    Joined:
    Jun 8, 2015
    Messages:
    11
    Likes Received:
    1
    Hi Andrea,
    I have checked GPIOs and actually each line I have tested is not working. I tried with:
    GPIO_4
    GPIO_116
    GPIO_127
    GPIO_124
    GPIO_119
    GPIO_203

    it seems that they works only in input but trying with echo 1 > value after set direction to out does not change voltage on line.
    I think this is really strange even if not related to flexcan.
    I will try with a fresh OS image.

    @Davide, any news on this?

    Thanks
     
  4. Paul Cox

    Paul Cox New Member

    Joined:
    Oct 31, 2015
    Messages:
    4
    Likes Received:
    2
    I just tried the RC1 image and still not able to bring up can0. I followed the instructions to set the device tree for using can0. Dmesg seems to show a big problem at boot time: http://pastebin.com/RGtXVMGd
     
  5. Jean-Philippe Suter

    Jean-Philippe Suter New Member

    Joined:
    Feb 18, 2016
    Messages:
    2
    Likes Received:
    1
    I don't now why, and it's a big problem for me, but the fexcan drivers load correctly only if the M4 CORE IS DISABLED ! (in uEnv.txt)
    Can sombody tell me why ????
     
  6. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
  7. Jean-Philippe Suter

    Jean-Philippe Suter New Member

    Joined:
    Feb 18, 2016
    Messages:
    2
    Likes Received:
    1
    YES ! it's working. Many thank's
     
    Andrea Rovai likes this.
  8. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    You're welcome!
     
  9. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    What is this hidden link (ruby888) doing behind the sentence in your post?
     
    Andrea Rovai likes this.
  10. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Who knows? Surely it won Somchai0320 a ban.
     
    waltervl likes this.
  11. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    Did anyone figured out how to enable it on boot? Adding below entry to /etc/networking/interfaces does not do usual trick

    # CAN Bus
    auto can0
    iface can0 inet manual
    pre-up /sbin/ip link set $IFACE type can bitrate 250000 tripple-sampling on
    up /sbin/ip link set up $IFACE
    down /sbin/ifconfig $IFACE down

    udooer@udooneo:~$ uname -a
    Linux udooneo 3.14.56-udooneo-02046-gacf7670 #7 SMP PREEMPT Tue Jan 24 10:26:38 UTC 2017 armv7l armv7l armv7l GNU/Linux

    EDIT: to make it work I could not use $IFACE. Here is working version below

    # CAN Bus
    auto can0
    iface can0 inet manual
    pre-up /sbin/ip link set can0 type can bitrate 250000 triple-sampling on
    up /sbin/ifconfig can0 up
    down /sbin/ifconfig can0 down
     
    Last edited: Feb 10, 2017
  12. oxoocoffee

    oxoocoffee Member

    Joined:
    Sep 13, 2016
    Messages:
    57
    Likes Received:
    6
    Ok So I have been running CAN for some time on UDOObuntu 2.1.2 Minimal (14.04 LTS) and not I am trying to enable
    CANFD. Looks like the "ip" command is missing "fd on/off".. Needs to be updated?

    udooer@udooneo:~$ ip -V
    ip utility, iproute2-ss131122

    Here is command options
    udooer@udooneo:~$ ip link set can0 type can help

    Usage: ip link set DEVICE type can
    [ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
    [ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
    phase-seg2 PHASE-SEG2 [ sjw SJW ] ]

    [ loopback { on | off } ]
    [ listen-only { on | off } ]
    [ triple-sampling { on | off } ]
    [ one-shot { on | off } ]
    [ berr-reporting { on | off } ]

    [ restart-ms TIME-MS ]
    [ restart ]

    Where: BITRATE := { 1..1000000 }
    SAMPLE-POINT := { 0.000..0.999 }
    TQ := { NUMBER }
    PROP-SEG := { 1..8 }
    PHASE-SEG1 := { 1..8 }
    PHASE-SEG2 := { 1..8 }
    SJW := { 1..4 }
    RESTART-MS := { 0 | NUMBER }

    And it should be (from other hardware)

    [ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
    [ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
    phase-seg2 PHASE-SEG2 [ sjw SJW ] ]

    [ dbitrate BITRATE [ dsample-point SAMPLE-POINT] ] |
    [ dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1
    dphase-seg2 PHASE-SEG2 [ dsjw SJW ] ]

    [ loopback { on | off } ]
    [ listen-only { on | off } ]
    [ triple-sampling { on | off } ]
    [ one-shot { on | off } ]
    [ berr-reporting { on | off } ]
    [ fd { on | off } ]
    [ fd-non-iso { on | off } ]
    [ presume-ack { on | off } ]

    [ restart-ms TIME-MS ]
    [ restart ]

    Where: BITRATE := { 1..1000000 }
    SAMPLE-POINT := { 0.000..0.999 }
    TQ := { NUMBER }
    PROP-SEG := { 1..8 }
    PHASE-SEG1 := { 1..8 }
    PHASE-SEG2 := { 1..8 }
    SJW := { 1..4 }
    RESTART-MS := { 0 | NUMBER }


    Here is kernel doc https://www.kernel.org/doc/Documentation/networking/can.txt
    Section 6.5.1 Netlink interface to set/get devices properties

    Would it be possible to get image updated at some point to support CANFD?
     

Share This Page