Best way of setting up remoteproc on Verdin iMX8M Plus

Hi,

I am using a Verdin iMX8M Plus module (currently on a Verdin Development Board), developing firmware for the cortex M core. I am using remoteproc to upload new firmare versions directly from the cortex A cores (Toradex Embedded Linux Reference Multimedia Image 6.8.0).

But to get remoteproc working, I need to first upload an image using this guide:
https://developer.toradex.com/software/cortex-m/how-to-load-binaries
And then to the steps in this guide:
https://developer.toradex.com/software/cortex-m/how-to-use-remoteproc

Ideally I want to be able to upload firmwares on new devices using remoteproc without going into U-Boot first.

I see this warning in the remoteproc documentation:

You need a special kernel command line argument for remoteproc to be functional. Add either clk-imx8mp.mcore_booted=1 or clk-imx8mm.mcore_booted=1 to the kernel command line and reboot before following the rest of this document.

I guess this might be the cause of the issue? But I have not been able to do this successfully. What are the specific steps to add this to kernel command line?

EDIT: If I only do the steps from the remoteproc documentation the behavior is this:
(I initiate the firmware upload through SSH)

  1. SSH disconnects
  2. “powering up imx-rproc” and “Booting fw image …” shows up in the Linux log over serial
  3. After ~30 seconds a reboot happens, but no log prints from the M7 core

image

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To set up remoteproc on your Verdin iMX8M Plus module and upload firmware to the Cortex-M core without using U-Boot for each update, you need to ensure that the kernel command line includes the necessary argument for remoteproc functionality. This involves adding clk-imx8mp.mcore_booted=1 to the kernel command line.

Here are the steps to modify the kernel command line:

  1. Access the Bootloader Environment:

    • Connect to your device via a serial console.
    • Reboot the device and interrupt the boot process to access the U-Boot prompt by pressing any key when prompted.
  2. Modify the Kernel Command Line:

    • At the U-Boot prompt, you can view the current boot arguments using:
      printenv
      
    • To add the required argument, use the following command:
      setenv bootargs "${bootargs} clk-imx8mp.mcore_booted=1"
      
    • Save the changes to the environment variables:
      saveenv
      
  3. Reboot the Device:

    • After saving the changes, reboot the device to apply the new kernel command line:
      reset
      

Once this setup is complete, you can manage firmware updates directly from the Linux environment without needing to go through U-Boot each time. Ensure that your firmware binaries are correctly placed in the /lib/firmware directory or another specified location, and use sysfs to manage the remote processor as described in the Toradex documentation.

This approach should streamline your firmware update process on new devices.

Best regards,
Toradex AI Assistant.

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

Use remoteproc to start M7 core on Verdin iMX8M-Plus.

I have tried adding bootargs=clk-imx8mp.mcore_booted=1 in U-boot, but I still need to do the steps listed in my first post.

Not possible, unfortunately, because of a choice by NXP to not patch buggy remoteproc
u-boot is the only way with Torizon OS 6

I’m going to test with Torizon OS 7 to see if something changed

Thank you for the quick reply!

I am not using Torizon OS, but the Linux BSP builds. Currently version 6.8.0. Does these match in bugfixes etc., meaning if a bugfix is implemented in Torizon OS 7 it should also be implemented in Linux BSP 7.x.x?

EDIT: I tried version 7.0.0 of BSP now (Toradex BSP Layers and Reference Images for Yocto Project), it seems like it behaves the same as 6.8.0.

Hello @erikr,

Do you have the UART for Cortex-M7 connected and accessible? If not, it should be accessible on ttyUSB2.
Also, do you have the correct device tree overlay applied?
Does the device reboot after 30 seconds as you said?

What are the specific steps to add this to kernel command line?

You can add the command-line argument using the fw_setenv command from the Linux user space, as shown in the following example:
fw_setenv tdxargs "clk-imx8mm.mcore_booted=1"

Hi @rudhi.tx ,

Thank you for the answer, and sorry for the late reply.

Doing fw_setenv tdxargs “clk-imx8mm.mcore_booted=1” from Linux seems to make remoteproc work as expected. I see that this exact command is mentioned in the doc. Either I missed this, or it has recently been added.

Thanks.

Hello @erikr,

Thanks for confirming. We updated the article after you reported this issue. So you did not miss it. Also, thanks to you fro bringing it up!

1 Like