Load M4 firmware

Started by SteffenFuchs, May 15, 2023, 08:55:09 PM

Previous topic - Next topic

SteffenFuchs

Dear all,

I am currently migrating a project from the STM32MP157 Discovery Board to the Olimex SOM, which uses both the M4 and the A7 cores, the M4 firmware being loaded by some userspace Linux software of the project

On the STM Discovery board I there is a file interface in these places to load a M4 firmware image and run it:
/sys/class/remoteproc/remoteproc0/state
/sys/class/remoteproc/remoteproc0/firmware
/sys/module/firmware_class/parameters/path

Further there are files
/dev/ttyRPMSG0 and /dev/ttyRPMSG1 acting as a virtual serial interface to pass messages between M4 and A7.

Is there some similar mechanism for the Olimex Linux system?

Johannes

Hi Olimex Team,

I got exactly the same question!!!!

Is there already a solution?

Thanks a lot in advance!

LubOlimex

Technical support and documentation manager at Olimex

Johannes

Thx will try and let you know if it worked!

SteffenFuchs

Quote from: LubOlimex on June 07, 2023, 04:32:57 PMRemoteproc should work: https://www.youtube.com/watch?v=wfIMQpKSaSg&t=1s

Thank you for uploading the video. I tried using it, however I get this error:

olimex@stm32mp1-olinuxino-som:~$ cat /sys/class/remoteproc/remoteproc0/status
cat: /sys/class/remoteproc/remoteproc0/status: No such file or directory

/sys/class/remoteproc is just empty. I used the SD card image that you provide on your web site (tried both STM32-OLinuXino-SOM-BASE-bullseye-minimal-20230515-130040.img and STM32-OLinuXino-SOM-bullseye-minimal-20220928-143706.img).

When you did your test, did you use a different image or did you install additional packages? Were any changes to the device tree made?

Thank you!
Steffen

LubOlimex

#5
It wasn't enabled. Try doing update and upgrade now and test again.

apt update
when done

apt dist-upgrade
when done

reboot
then check again.

Edit: also check this link on the usage:

https://wiki.st.com/stm32mpu/wiki/Linux_remoteproc_framework_overview
Technical support and documentation manager at Olimex

SteffenFuchs

Thank you so much, whit the new update you prepared
/sys/class/remoteproc/remoteproc0 does exist now and is populated with various files.

I will check if I can load firmware and report.

SteffenFuchs

With your updated kernel remoteproc is now working, so I can load the M4 firmware now.

However /dev/ttyRPMSG0 and /dev/ttyRPMSG1 are still not there for communication between M4 firmware () and Linux as described here by STM:

https://wiki.st.com/stm32mpu/wiki/Linux_RPMsg_framework_overview

Johannes

The update worked for me as well! Thanks a lot to @LubOlimex!

Nevertheless I am still facing the same issue, that I do not get the ttyRPMSG1 to work.

Your support is highly appreciated!

Johannes

LubOlimex

Developers told me that it appears this requires kernel 6.x.x and we are still at 5.x.x. Will see when we can migrate to 6.x.x.
Technical support and documentation manager at Olimex

LubOlimex

Guys, both @Johannes and @SteffenFuchs, can you send us some test firmware that works with rpmsg tty - we don't have such and can't test ourselves (we will first have to learn how to write such which will slow us additionally). Upload it somewhere and post link here, maybe give us instructions. Sorry for this we are not very experienced with RPMsg.
Technical support and documentation manager at Olimex

LubOlimex

Alternatively, you can try testing the following:

Use the image that you got already (default image that had been updated with apt dist-upgrade) and then manually install the backported drivers. You can get the deb packages from here:

https://images.olimex.com/test/

then install with

dpkg -i <deb-file-name>

For example,

dpkg -i linux-headers-olimex_5.10.180-20230719-100939_armhf.deb

Install all files and then test and give us feedback.
Technical support and documentation manager at Olimex

LubOlimex

Alright it should all be available as updgrade package in apt-get as of now. After updating and upgrading, type:

"apt-get update && apt-get dist-upgrade"

Let me know how it goes.


Technical support and documentation manager at Olimex

SteffenFuchs

Dear Lub, thank you very much for your messages.

I did exactly as suggested by you, and then ran the communication test project I also sent to you.

It worked the same as with the direct installation of packets via dpkg -i as suggested further below.

So we have working:

  • Loading firmware for the M4 core from Linux side via the remoteproc system
  • Starting and stopping it
  • Communicating between M4 and Linux side via RPmsg framework.
   
Thank you so much!

LubOlimex

Thanks for the update. Glad that it works now.
Technical support and documentation manager at Olimex