Olimex Support Forum

OLinuXino Android / Linux boards and System On Modules => STMP1 => Topic started by: SteffenFuchs on May 15, 2023, 08:55:09 PM

Title: Load M4 firmware
Post by: SteffenFuchs on May 15, 2023, 08:55:09 PM
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?
Title: Re: Load M4 firmware
Post by: Johannes on June 01, 2023, 06:29:18 PM
Hi Olimex Team,

I got exactly the same question!!!!

Is there already a solution?

Thanks a lot in advance!
Title: Re: Load M4 firmware
Post by: LubOlimex on June 07, 2023, 04:32:57 PM
Remoteproc should work: https://www.youtube.com/watch?v=wfIMQpKSaSg&t=1s
Title: Re: Load M4 firmware
Post by: Johannes on June 19, 2023, 09:30:28 PM
Thx will try and let you know if it worked!
Title: Re: Load M4 firmware
Post by: SteffenFuchs on June 20, 2023, 06:44:19 PM
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
Title: Re: Load M4 firmware
Post by: LubOlimex on June 23, 2023, 11:35:38 AM
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
Title: Re: Load M4 firmware
Post by: SteffenFuchs on June 23, 2023, 07:01:56 PM
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.
Title: Re: Load M4 firmware
Post by: SteffenFuchs on June 24, 2023, 01:26:32 PM
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 (https://wiki.st.com/stm32mpu/wiki/Linux_RPMsg_framework_overview)
Title: Re: Load M4 firmware
Post by: Johannes on June 27, 2023, 08:50:18 PM
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
Title: Re: Load M4 firmware
Post by: LubOlimex on July 19, 2023, 10:09:43 AM
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.
Title: Re: Load M4 firmware
Post by: LubOlimex on July 21, 2023, 12:59:09 PM
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.
Title: Re: Load M4 firmware
Post by: LubOlimex on July 24, 2023, 08:32:34 AM
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.
Title: Re: Load M4 firmware
Post by: LubOlimex on July 25, 2023, 03:31:08 PM
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.


Title: Re: Load M4 firmware
Post by: SteffenFuchs on July 27, 2023, 02:24:01 AM
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:

   
Thank you so much!
Title: Re: Load M4 firmware
Post by: LubOlimex on July 27, 2023, 08:32:22 AM
Thanks for the update. Glad that it works now.