IMX8MMEVK: Remoteproc to reboot M4 from Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MMEVK: Remoteproc to reboot M4 from Linux

6,600 Views
andreasbuchner
Contributor II

Hello all,

I have the following unresolved issue with the remoteproc framework on the i.MX8MM-EVK to boot the M4 core from Linux with sysfs commands (https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-remoteproc) with the latest Linux image:

I can successfully load any binaries (in *.elf format), start and stop the M4 through the remoteproc commands. However, when loading a different binary and starting the M4 core again then the old firmware is still started. A new binary will only be accepted after the whole system is rebooted.

Can you please explain what can be done to load and run a new M4 binary, without restarting the whole system?

Thanks for your response,

Andreas

0 Kudos
15 Replies

5,008 Views
michaelwalton
Contributor II

We had the same problem, solved by leaving the M4 core enabled when reloading (as per default). The imx_rproc.c incorrectly disables the M4 core block after stopping it, which prevents the TCM from being written. After debugging and solving, we found this had already been taken care of in the kernel by someone with the same problem. See https://github.com/torvalds/linux/commit/da87976921bba27199ee4df94081ac10fa0cf76f for solution.

4,983 Views
tylernol
Contributor IV

imx_rproc.c on linux master has a bunch of fixes. It is not clear why NXP has not merged these fixes to their releases yet. 

5,076 Views
Thai_Phan
Contributor I

Having the same exact issue here.

My investigation leads me first to the AN5317, where it shows the supposedly correct steps to reload firmware for M4. However, in the driver `imx_rproc.c` the order of the reset bits are somewhat different. Tried to change that and it won't boot.

If you have any solution for this matter please update.

 

6,039 Views
tylernol
Contributor IV

correction. It works fine for elf files linked for TCM, but not DRAM (0x80000000). So is there a default assumption in the rproc driver path when it tries to launch this way?

0 Kudos

6,053 Views
tylernol
Contributor IV

I am also seeing this issue on an imx8mn eval board. 

0 Kudos

6,510 Views
stephen1
Contributor I

Any progress on this?  I have the same issue.

0 Kudos

6,530 Views
ddeyo1
Contributor I

Hello,

I am seeing the same problem on the Nitrogen8M_Mini SOM.  It's also an i.MX8MM.

On another note, I can't get my elf to start correctly.  The .bin file works correctly from u-boot, but the elf says:

[  137.662803] remoteproc remoteproc0: powering up imx-rproc

[  137.684501] remoteproc remoteproc0: Booting fw image rpmsg_lite_str_echo_rtos_imxcm4.elf, size 525856

[  137.693768] remoteproc remoteproc0: no dtb rsrc-table

[  137.698961] remoteproc remoteproc0: bad phdr da 0x80000000 mem 0x240

[  137.705347] remoteproc remoteproc0: Failed to load program segments: -22

[  137.712203] remoteproc remoteproc0: Boot failed: -22

Could you possibly provide me your DTS node for the m4 and linker memory layout?

0 Kudos

6,592 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

Can you provide the all your steps?

 

BR

Zhiming

0 Kudos

5,348 Views
utopia61
Contributor II

hello,Zhiming

i also using remoteproc, but the platform is imx8mp.

I want to boot M7 from linux. But the SDK using RPMSG-lite, what should i do to port openamp and libmetal?

thanks! Is there any reference?

with best wishes!

@Zhiming_Liu 

0 Kudos

6,548 Views
andreasbuchner
Contributor II

Any news on this topic?

6,539 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

I have reproduced the issue and trying to find solution

 

BR

Zhiming

6,343 Views
andreasbuchner
Contributor II

Hello,

Are there still no updates on this issue?

Thanks for your reply!

Andreas

0 Kudos

6,484 Views
gary_bisson
Senior Contributor III

Hi,

Any update on this issue?

Regards,

Gary

0 Kudos

6,582 Views
andreasbuchner
Contributor II

Hello Zhiming,

sure, here are all steps and commands I used:

- Loaded latest image L5.4.70-2.3.0_images_MX8MMEVK on SD-Card of my IMX8M Mini EVK which has already some M4 binaries in path /lib/firmware (e.g. imx8mm_m4_TCM_hello_world.elf and imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf which I will use later)
- Setting the correct dtb file imx8mm-evk-rpmsg.dtb in u-boot:
* interrupt auto boot
* type setenv fdt_file 'imx8mm-evk-rpmsg.dtb'
* type save
* type boot to boot linux
* login with root
- type following commands to start hello world firmware:
* echo -n /lib/firmware > /sys/module/firmware_class/parameters/path
* echo -n imx8mm_m4_TCM_hello_world.elf > /sys/class/remoteproc/remoteproc0/firmware
* echo start >/sys/class/remoteproc/remoteproc0/state
- now "hello world." is printed in M4 console terminal
- type cat /sys/class/remoteproc/remoteproc0/firmware to check which firmware is loaded (prints: imx8mm_m4_TCM_hello_world.elf)
- stop firmware, load different firmware and start M4 again:
* echo stop >/sys/class/remoteproc/remoteproc0/state
* echo -n imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf > /sys/class/remoteproc/remoteproc0/firmware
* echo start >/sys/class/remoteproc/remoteproc0/state
- M4 console terminal prints "hello world." again and cat /sys/class/remoteproc/remoteproc0/firmware prints imx8mm_m4_TCM_rpmsg_lite_str_echo_rtos.elf

Last step is the unexpected behavior. I expect that the rpmsg binary would run (as indicated in firmware print by cat /sys/class/remoteproc/remoteproc0/firmware).

If you need additional information I am happy to provide it.

Regards,

Andreas

0 Kudos

5,388 Views
utopia61
Contributor II

hello,andreasbuchner

i also using remoteproc, but the platform id imx8mp.

I want to boot M7 from linux. But the SDK using RPMSG-lite, what should i do to port openamp and libmetal?

thansk!

with best wishes!

0 Kudos