udev can rule related

22 views
Skip to first unread message

Rifo Turs

unread,
Jun 6, 2017, 8:38:40 AM6/6/17
to ISOBlue
Hello Yang,

I am trying to get the know isoblue 2.0 in a more detailed way.  The system is designed in a very elegant way :)  I am learning quite many things. Thank a lot to isoblue team again for sharing this with the community


In the isoblue2-can udev rule where did we get the 2090000 and 2094000 numbers?  I wasn't able to understand how this udev rule was triggered. Can you please guide me about this?

KERNEL=="can[0-9]*", KERNELS=="2090000.can", NAME="tra", TAG+="systemd", ENV{SYSTEMD_WANTS}="can...@tra.service"
KERNEL=="can[0-9]*", KERNELS=="2094000.can", NAME="imp", TAG+="systemd", ENV{SYSTEMD_WANTS}="can...@imp.service"


Yang Wang

unread,
Jun 6, 2017, 10:44:25 AM6/6/17
to ISOBlue
Hello Rifo,

This is how this udev rule gets triggered:

It will check if there is any match against CAN interface named can0 to can9 and kernel name of "2090000.can" (or "2094000.can"). If any matches, it will rename the the CAN interface to "tra" or "imp" and then trigger a corresponding systemd service that set up each CAN interface's bitrate and bring it up.

"2090000.can" and "2094000.can" are device nodes that the Toradex's device tree assigned to the two CAN interfaces on the NXP iMX6 device.

If you want to learn more information about writing udev rules, please check this link: http://www.reactivated.net/writing_udev_rules.html


In addition, the "2090000.can" and "20940000.can" is outdated. For ISOBlue2s, we are using the latest Toradex kernel and they renamed them to "2090000.flexcan" and "2094000.flexcan". The changes are reflected in our meta-isoblue repo: https://github.com/OATS-Group/meta-isoblue/blob/master/recipes-core/udev/files/70-isoblue2-can.rules

Regards,
Yang

On Tuesday, June 6, 2017 at 8:38:40 AM UTC-4, Rifo Turs wrote:
Hello Yang,

I am trying to get the know isoblue 2.0 in a more detailed way.  The system is designed in a very elegant way :)  I am learning quite many things. Thank a lot to isoblue team again for sharing this with the community


In the isoblue2-can udev rule where did we get the 2090000 and 2094000 numbers?  I wasn't able to understand how this udev rule was triggered. Can you please guide me about this?

KERNEL=="can[0-9]*", KERNELS=="2090000.can", NAME="tra", TAG+="systemd", ENV{SYSTEMD_WANTS}="can_up@tra.service"
KERNEL=="can[0-9]*", KERNELS=="2094000.can", NAME="imp", TAG+="systemd", ENV{SYSTEMD_WANTS}="can_up@imp.service"


Rifo Turs

unread,
Jun 8, 2017, 3:00:21 PM6/8/17
to ISOBlue
Hello Yang,

Thanks a lot for your help :)

6 Haziran 2017 Salı 17:44:25 UTC+3 tarihinde Yang Wang yazdı:
Reply all
Reply to author
Forward
0 new messages