CanBus on Neo, (flexcan)

Discussion in 'UDOO NEO' started by yaryn, Mar 1, 2016.

  1. yaryn

    yaryn New Member

    Joined:
    Mar 1, 2016
    Messages:
    10
    Likes Received:
    3
    Firstly,

    just received my Neo in the mail and extremely impressed with both the shipping and device itself so thanks for the great work,

    I'm having a lot of issues getting the can interface up and running and am hitting a point that I am out of my depth, I have a neo full and I require the Can Interfaces for J1939 data, to date I have been using RPI with a shield and socket can , can anyone advise how to get similar operation with the Neo?

    if possible can someone supply an operational image, I'm fairly new to Linux setup and come from a PLC/Controller background,

    any help would be appreciated

    thanks
     
  2. yaryn

    yaryn New Member

    Joined:
    Mar 1, 2016
    Messages:
    10
    Likes Received:
    3
    a little more info,

    if I attempt to setup the device I get the following,



    udooer@KingysUDOO:~$ ip link set can0 type can bitrate 250000
    Cannot find device "can0"

    please let me know anymore info that will help with this
     
  3. Andrea Rovai

    Andrea Rovai Well-Known Member

    Joined:
    Oct 27, 2014
    Messages:
    1,703
    Likes Received:
    240
    Dear @yaryn,
    first of all thank you for the good words and welcome in the forum!
    I'd like to let you know that a topic about Flexcan on UDOO NEO already exists so you could go there and explain your problem.
     
  4. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    To enable Flex CAN you need to enable the one or both of the can controllers in the dts file, this should also assign the external pins correctly i.e. something like this:

    Code:
    &flexcan1 {
       status = "ok";
    };
    Hopefully this should also trigger loading the kernel drivers which are located in /lib/modules/3.14.56-udooneo-02202-gfeef1c3/kernel/drivers/net/can . Also note the CAN pins are only 3.3v tolerant so make sure the attached devices are at the right voltage levels. If everything goes well you see a can device ie can0.

    At some point I'm hoping to get of hold can bus controller to test the interface, unless some ones willing to donate one ;).
     
    Last edited: Mar 1, 2016
  5. yaryn

    yaryn New Member

    Joined:
    Mar 1, 2016
    Messages:
    10
    Likes Received:
    3
    Thanks for the assistance,

    I had attempted to activate the can interface via the device tree as this was all that was indicated in the manual,

    Clearly ive misread the specs on the device,
    Am i able to conect an existing can device directly to the udoo neo pins or do i require an additional device?

    Asbim sure you can gather im not an expert when it comes to electronics ive come from an indutrial and mobile controls background,

    Any assistance and calrification would be appriciated to understand what i require to get a udoo neo recieving can data from an industrial engine

    Thanks
     
  6. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    If your attempting to interface to an industrial engine, then there 2 (or may be 3) parts to solve,

    1. Getting the CAN drivers working on the neo. I;m going to test this out so (may take a couple of days) then I provide a 'how to guide'.
    2. If you planning to connect to an external CAN device then a transceiver is normally required in front of the i.mx6sx CAN signals to ensure electrical compatibility with other devices on the bus. On the imx6sx the CAN signals are CAN-Tx & CAN-Rx while on the CAN bus these would normally be CAN-H and CHAN-L (although confusingly sometimes they are still referred to as CAN-TX/RX), the job of the transceiver is handle the electrical conversion. It would be useful if you can provide more details about the CAN interface on the engine side..
     
    Andrea Rovai likes this.
  7. yaryn

    yaryn New Member

    Joined:
    Mar 1, 2016
    Messages:
    10
    Likes Received:
    3
    Thanks for the assistance

    At this stage i will be interfacing with cat engines via j1939,

    Are there any ready made devices to convert the tx rx to can high can low?

    Im a little confused as it appears the board does not support can out of the box as described,

    Thanks for the support
     
  8. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    Although I haven't managed to get hold of one yet and I can't confirm it works, you can try using a SN65HVD230 like this board .

    I mentioned 'part 3' because you will need to read the raw CAN messages and decode J1939 yourself.
     
    yaryn likes this.
  9. yaryn

    yaryn New Member

    Joined:
    Mar 1, 2016
    Messages:
    10
    Likes Received:
    3
    Ok well thats a little confusing as its been advertised as haveing canbus support out of the box,

    I already have the data being dealt with on a raspberry pi with a canbus sheild,
    I purchased the udoo to avoid the need for an additional sheild, so to confirm i need an additional device to interface with a canbus on a udoo?

    Thanks

    Thanks
     
  10. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    The NEO does support CAN (it has an on board controller) and like most modern day cpu/mcu's the I/O pins are only 3.3v tolerant (same as rpi). So in theory you could setup a CAN network but all devices would need to 3.3v compliant plus the network distance would be limited. The transceiver is required to insulate the cpu from higher voltages/noise on the bus from other devices, signal conversion and allows for longer distances. If you chose another cpu/mcu that hosted a on board CAN controller then the same would apply. The rpi cpu has no on board CAN controller therefore the shield does two thing, firstly provides a CAN controller interface and other is to act as a CAN transceiver.
     
    Andrea Rovai likes this.
  11. yaryn

    yaryn New Member

    Joined:
    Mar 1, 2016
    Messages:
    10
    Likes Received:
    3
    Ok

    Thank you for the explination makes a little more sense but still means i require additional devices to interface properly with canbus,

    As you have mentioned i could get it working if all the devices on the can where 3.3v ill stick with that for now as it will allow me to bench test data rates etc,

    Any information in relation to getting the device to implement the can0 and can1 ports would be greatly appriciated,

    Thanks again for your assistance, id like to utilize udoo boards werever possible,
     
    Andrea Rovai likes this.
  12. jas-mx

    jas-mx Active Member

    Joined:
    Dec 31, 2013
    Messages:
    407
    Likes Received:
    118
    I have created a separate post with instructions on how to enable flexcan, you can use that as a starting point.
     
    Andrea Rovai likes this.
  13. Roborigger

    Roborigger UDOOer

    Joined:
    Feb 21, 2022
    Messages:
    4
    Likes Received:
    0
    Hi,
    I am using ubuntu 18.04.3 LTS and i can't get the flexcan to work
    Cheers
     
  14. Stacey Buker

    Stacey Buker New Member

    Joined:
    Mar 29, 2022
    Messages:
    3
    Likes Received:
    0
    Thanks for sharing such a helpful instruction, really appreciate for your article.

    IndigoCard Login
     

Share This Page