Load imx_rpmsg_tty module at boot in TorizonOS

TorizonOS 6.6.1+build.14 for Verdin iMX8M Plus contains imx_rpmsg_tty module, and I can load it with

sudo modprobe imx_rpmsg_tty

as described here and in other community topics.

I’ve already built my customized TorizonOS using Torizon Core Builder for other needs (splashscreen, add overlays, …).
Is there a way to having imx_rpmsg_tty module loaded automatically at the boot?
Maybe using tcbuild.yaml?
Here I see how to build a module and to have it loaded at boot.
But imx_rpmsg_tty module is already built and included in TorizonOS, and I only need to load it.

Is there an easy way?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To have the imx_rpmsg_tty module loaded automatically at boot in TorizonOS, you can utilize the systemd service to create a custom service that loads the module during the boot process. This method does not require modifications to the tcbuild.yaml since the module is already included in TorizonOS.

Here are the steps to create a systemd service for loading the imx_rpmsg_tty module:

  1. Create a systemd service file: On your device, create a new file named imx_rpmsg_tty.service in the /etc/systemd/system/ directory.

    sudo nano /etc/systemd/system/imx_rpmsg_tty.service
    
  2. Add the following content to the service file:

    [Unit]
    Description=Load imx_rpmsg_tty module at boot
    
    [Service]
    Type=oneshot
    ExecStart=/sbin/modprobe imx_rpmsg_tty
    
    [Install]
    WantedBy=multi-user.target
    

    This service runs the modprobe imx_rpmsg_tty command at boot to load the module.

  3. Enable the systemd service to ensure it starts at boot:

    sudo systemctl enable imx_rpmsg_tty.service
    
  4. Reboot your device to verify that the imx_rpmsg_tty module loads automatically:

    sudo reboot
    

After rebooting, you can check if the module is loaded by using the lsmod command or checking dmesg output. This approach allows you to load the module at boot without needing to modify the build configuration or the tcbuild.yaml file.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Cortex-M RPMsg Guide | Toradex Developer Center.

I see that you suggest me to do something on a device running TorizonOS.
In this way, how can I make this change persistent?
I mean, retained after I build the next release of my TorizonOS?

You could load a kernel module on boot via /etc/modprobe.d then capture the change with TorizonCore Builder so it can be mass-deployed on your devices.

Best Regards,
Jeremias

Hi @jeremias.tx
sorry but I’m so expert of Linux.
Can you give me detailed steps on how to load a kernel module on boot via /etc/modprobe.d?
Should I create some file?
Or apend some lines to a given file?
Or anything else?

Well actually you have some options here. You could use /etc/modprobe.d as I said earlier if you want to load your kernel module with some more advanced options/configurations. But, if you just simply want to load your kernel module on boot then using /etc/modules-load.d/ is probably simpler. In fact we even mention using /etc/modules-load.d/ in our documentation here: Running FreeRTOS on the Cortex-M4 of a Colibri iMX7 | Toradex Developer Center

For examples of both you can look at this: Kernel module - ArchWiki

Either change can be captured via TorizonCore Builder.

Best Regards,
Jeremias