MTTCAN as a Kernel Built-in Driver

When you build the MTTCAN driver along with the kernel, it is part of the kernel binary.

  1. Follow the steps above in MTTCAN as a Module.
  2. Set the following CONFIG options in defconfig.

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

    CONFIG_CAN=y
    CONFIG_CAN_RAW=y
    CONFIG_CAN_DEV=y
    CONFIG_MTTCAN=y
    
  3. Alternatively, these options can be set as described in Compiling the Kernel (Kernel 5.15), steps 1-3, to:
    • Setup the environment macros
    • Set the kernel source directory
    • Create an output directory and configure the kernel for the board
  4. Execute the following command.
    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. Build the kernel and copy the modules from the kernel Image and zImage as follows:
    cp ${PWD}/out-linux/arch/arm64/boot/zImage
     <top>/drive-linux/kernel
    cp ${PWD}/out-linux/arch/arm64/boot/Image 
    <top>/drive-linux/kernel

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

  7. Reflash the target system.

    For additional information, refer to Flashing.