flexcan on NEO?

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

  1. Paul Cox

    Paul Cox New Member

    Joined:
    Oct 31, 2015
    Messages:
    4
    Likes Received:
    2
    Hello,

    I'm running the NEO end of october Beta image, which has the Arduino IDE that programs the blink example of the Cortex-M nicely, and I see that the flexcan kernel module is built and included so I gave it a shot. modprobe flexcan works and the driver loads, but I don't think it finds the controller or something because no can0 device gets created so the typical "ip link set. blah blah" fails. Not sure what to try at this point, does anyone know is this is known to work yet?
    Thanks,
    Paul
    udooer@udooneo:~$ uname -a
    Linux udooneo 3.14.28-udooneo-04196-gb15f827 #23 SMP PREEMPT Tue Oct 27 11:27:53 CET 2015 armv7l armv7l armv7l GNU/Linux
    dmesg
    [ 3062.736003] can: controller area network core (rev 20120528 abi 9)
    [ 3062.736091] NET: Registered protocol family 29
    [ 3062.740214] can: broadcast manager protocol (rev 20120528 t)
     
    Last edited: Oct 31, 2015
  2. Flavio Battimo

    Flavio Battimo New Member

    Joined:
    Jun 8, 2015
    Messages:
    11
    Likes Received:
    1
    Hello,
    have you managed to work with FlexCAN on Neo board?
     
  3. Paul Cox

    Paul Cox New Member

    Joined:
    Oct 31, 2015
    Messages:
    4
    Likes Received:
    2
    I'm still waiting on some hints on how to make it work.

    My best guess is I need a kernel command line argument or a maybe some tweaking of the device tree.

    /boot/uenv.txt shows the dtb file in use and running the following command shows that the current dtb file does disable the two can interfaces:

    fdtdump /boot/dts/imx6sx-udoo-neo-hdmi-m4.dtb

    So maybe it's just a matter or enabling them (status="okay") and recompiling with dtc, but probably there's a bit more like figuring out how to enable the pins. There's a dtb for another board in the dts folder that shows how to do it (imx6q-sabreauto-flexcan1.dtb) so maybe that's enough of a hint, not sure....
     
    Last edited: Nov 11, 2015
  4. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear Paul,
    my colleague just send you a mail, anyway I'll copypaste it here so to have everyone engaged in the conversation.

    Unfortunately the flexcan channels exposed in the external pinout have not been enabled yet.
    All our BSP is still in a development stage, as we said in the kickstarter campaign.
    We will taking care of this in the next weeks, meanwhile I can send you some example of how the the CAN is implemented in other imx6 dts.
    At this link you can find the UDOO NEO Schematics (I also sent them as attachment with assembly plans processor's reference manual)
    http://udoo.org/download/files/schematics/UDOO_NEO_schematics.pdf
    At this link, from our documentation, you can see the pin interested for the CAN signals.
    http://www.udoo.org/docs-neo/img/gionji/DOCS_external_pinout.PNG

    Here an example of how flexcan is implemented in the sabre sdb board (reference board for iMX6 SoloX).
    https://github.com/UDOOboard/linux_...1.0.0_ga_neo/arch/arm/boot/dts/imx6sx-sdb.dts
    intrested node: &flexcan1, &flexcan2, pinctrl_flexcan1, pinctrl_flexcan2
    To use the flexcan by Cortex-A9 you should also make sure to DON'T "disable" the flexcan in this file
    https://github.com/UDOOboard/linux_...neo/arch/arm/boot/dts/imx6sx-udoo-neo-m4.dtsi
    (disable the flaxcan nodes in this file need to assign the can to the cortex-M4. )
    Let us know if this is useful for you.
     
  5. Flavio Battimo

    Flavio Battimo New Member

    Joined:
    Jun 8, 2015
    Messages:
    11
    Likes Received:
    1
    Hello Andrea,
    do you mean that disable state in dtb file means flexcan is accessible from M4?
     
  6. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Yes, to allow M4 to use a peripheral you need to set disable state in dtb file for Cortex A9.
    This is not enough to use it from Cortex-M4 because you need the software implementation based on MQX
     
  7. Flavio Battimo

    Flavio Battimo New Member

    Joined:
    Jun 8, 2015
    Messages:
    11
    Likes Received:
    1
    Hi Andrea,
    any update on the MQX software implementation and canbus documentation? I would like to start playing with can bus on UDOO NEO but I have no succeeded on this.
     
  8. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear Flavio,
    have you tried using the Device Tree Editor for such a purpose? You can find it in the Start button (it's not called this way but it's on the same position of the Start button in Windows)
     
  9. Davide Faconti

    Davide Faconti New Member

    Joined:
    Feb 10, 2016
    Messages:
    6
    Likes Received:
    1
    Hi Andrea and Flavio,

    I am trying to make CAN bus work on Udoo Neo Full as you did earlier, but it is not clear to me if anyone managed to make this work or not.
    First of all I used the Device Pinumux Utility as described in the Docs. I rebooted by system

    Once I run manually the commands:
    I get this from dmesg
    Next I try to use the command:
    But all I get is
    Any suggestion?

    Davide
     
    Last edited: Feb 10, 2016
  10. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Hi there @Davide Faconti,
    I've read your message in the other topic you opened. Please, delete that topic, so we have just one topic for FlexCAN on UDOO NEO.
    Quoting your question:
    My answer, to this and to your previous question:
    have you tried to verify with
    Code:
    ifconfig -a
    ?
    The peripheral is not up by default.
     
  11. Davide Faconti

    Davide Faconti New Member

    Joined:
    Feb 10, 2016
    Messages:
    6
    Likes Received:
    1
    Flavio,

    As you pointed up, the device will not be up by default. In fact the command you suggested doesn't show any can device.

    The command

    is the one supposed to "bringup" the network device.

    in the past (on other embedded systems) modprobe fixed the problem, but not on Udoo Neo... As anyone test that Device Pinmux Utility does actually work?

    Davide
     
  12. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear Davide, have you read my previous message? I mean, have you tried with
    Code:
    ifconfig -a
    ?
     
  13. Davide Faconti

    Davide Faconti New Member

    Joined:
    Feb 10, 2016
    Messages:
    6
    Likes Received:
    1
    Yes I did. I just have:

    eth0, lo, usb0, wlan0

    My previous post was the answer to yours. What I meant, in short, is:

    "ifconfig -a" won't show can0 because the command "sudo ip link set up can0" fails.
     
  14. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Could you post us the dmesg on pastebin?
    Is your image UDOObuntu 2 RC1 with no change? Since we made a test one second ago and it worked.
     
  15. Davide Faconti

    Davide Faconti New Member

    Joined:
    Feb 10, 2016
    Messages:
    6
    Likes Received:
    1
    uname -a return

     
  16. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    So you recompiled the kernel. Because RC1 was released on December 23 and according to what you posted your image was of Jan 11.
    Please, post us your dmesg on pastebin - just to avoid wall of text
    Would you mind verify anyway with a clean RC1 image? Because it works on our side
     
  17. Davide Faconti

    Davide Faconti New Member

    Joined:
    Feb 10, 2016
    Messages:
    6
    Likes Received:
    1
    I guess I recompiled the kernel in my sleep... it happens to me sometimes ;)

    Seriously though, here there is the pastebin:

    http://pastebin.com/YvU58zGc

    I will use a fresh RC1 image and I will let you know.
     
  18. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    From your dmesg it seems it doesn't even try to initialize CAN. Have you pressed SAVE before closing the device tree editor and rebooting?
     
  19. Flavio Battimo

    Flavio Battimo New Member

    Joined:
    Jun 8, 2015
    Messages:
    11
    Likes Received:
    1
    Hello Davide,
    my goal is to get access canbus from M4 core in order to reduce load on A9.
    So I'm waiting for software implementation based on MQX.
     
  20. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Actually the UDOO Team is not working on this, it's not a priority, but we've found an external collaborator who's going to work on this - but hasn't started yet, to be clear. I hope to give you more news soon, but it won't be anything near to be honest
     

Share This Page