To install modules

  1. On the target, determine whether following modules are loaded, by running the lsmod command in the Linux shell.

    can-raw.ko
    can.ko
    can-dev.ko
    mttcan.ko
    
  2. If the modules did not load, determine if they are in following directory:
    /lib/modules
  3. If the modules are not in this directory, use menuconfig to enable the CAN kernel module. The instructions are in steps 6 and 7 in Compiling the Kernel (Kernel 5.15).
  4. In menuconfig, select following CAN modules.
    make -C kernel O=${PWD}/out-linux 
    DEFCONFIG_PATH=$PWD/t23x/arch/arm64/configs menuconfig
    [*] Networking support --->
        <M> CAN bus subsystem support ---> 
        <M> Raw CAN Protocol (raw access with CAN-ID filtering)
        <M> CAN Device Drivers --->
        <M> Platform CAN drivers with Netlink support
        <M> Bosch M_TTCAN Devices
        
  5. Exit and save.
  6. Rebuild the kernel and copy the kernel Image from the kernel out directory to:
    drive-linux/kernel

    For additional information, refer to Compiling the Kernel (Kernel 5.15).

  7. Reflash the target.

    For additional information, see Flashing.

  8. Load all required modules.
    # modprobe mttcan
    

    This command assumes module dependencies are properly set.

  9. If the modprobe command fails, manually load the modules:
    insmod /lib/modules/<KERNEL_VERSION>/kernel/net/can/can-raw.ko
    insmod /lib/modules/<KERNEL_VERSION>/kernel/net/can/can.ko
    insmod /lib/modules/<KERNEL_VERSION>/kernel/drivers/net/can/can-dev.ko
    insmod /lib/modules/<KERNEL_VERSIONextra/drivers/net/can/mttcan/mttcan.ko
    
Note:

The <KERNEL_VERSION> is in the form of x.x.xx-rtxx-tegra. For example, 5.15.116-rt-tegra.