How can I build a CAN communication kernel?

How can I build a CAN communication kernel?

Can I watch this video?

Or should I rebuild separately?

And is the socketcan and can utility the same? Or should I install separately?

I don’t know what CAN requirements are, and that video is for a TX1 instead of a TX2, but much of what is done in that video is still valid on a TX2.

If you know what is needed you might want to start by comparing it against the running kernel’s config. You can see that via:

zcat /proc/config.gz | less

You will see CONFIG_ items, and if “=m” it is there as a module, and if “=y”, then that feature is integrated directly into the kernel. So basically you will want to research what feature is required in terms of those CONFIG_ items. On my TX2 I see one example is:

#
# CAN Device Drivers
#
CONFIG_CAN_VCAN=m
CONFIG_CAN_SLCAN=m
CONFIG_CAN_DEV=m
CONFIG_CAN_CALC_BITTIMING=y
...

I don’t know enough about CAN to be more specific. If you happen to have a specific CAN device you can post information on, then someone may know. There can be specific CAN drivers for particular CAN devices in addition to generic protocol style drivers.