Verdin iMX8MM: Use A53 to control M4F

Hi there!

I would like to realize the following application:
Use the A53 to start-up and turn off the M4.
The M4 should be able to periodically do a task and save some Data (ideally with a running RTOS on it).
The A53 should be able to get the Data generated by the M4, save it and ideally send commands to the M4.

Basic Idea:
Use a docker container to control the A53 which in turn starts the M4 (with RTOS on it)which does a blinky or so for a minute and the the A53 turns the M4 off again. Something like that…

Problem:
I am a newbie without much experience (Haven’t even used docker before, nor Uboot nor real Linux, just Raspbian stuff). I have got some really basic experience with Microcontrollers (PWM, Blinky, basic RTOS knowledge).

I went through the reference manual of the i.MX 8M Chip and found sth. called a Ressource Domain Controller. I did go through the Quickstartguide. And i checked out how to get FreeRTOS on the M4.
But i don’t know how to connect the Information i found. Is there already an Interface, or some sort of solution for my problem? is it even possible?

I am thankful for any advice information or hints!

Hi,

What you want is possible, though perhaps not so easy for newbie. remoteproc should allow you to start/stop M4 FW and perhaps implement some services in the same M4 FW. RPMSG could be used to communicate data/settings to/from M4. But… according to NXP, at least for iMX7 M4 has to be started from U-Boot only, so you may expect the needs to digg deeper into kernel drivers and mod them for your own purposes…

Regarding RDC. Yeah, sounds great but totally no support for it in Linux. You may only use RDC to cut access to something like GPIO /SPI etc from Linux side, and that’s it, nothing more. For example iMX7D GPIO has no bit toggle / set /clear registers, which could be used to quite safely manipulate pins belonging to the same GPIOn unit, some pins from M4 and some from A7. RDC could compensate the lack of these registers, but no one wrote GPIO driver with RDC and SEMA4. So, since RDC is not supported in Linux, you have no choice but dedicate whole GPIOn unit to either M4 or A7, which seriously restricts and quite complicates design process. RDC could allow even something like sharing serial port between Cortex-M and -A, so that both CPUs could send meaningful debug data over same port, full message from one, full message from another…

Edward

Hi Edward

Thank you very much for your answer. Well, that sounds indeed very demanding. Nevertheless thanks for the hints. I didn’t even consider that ther might not be any support in a Linux environment. As far as i undestand i could use “RPMSG” to realize some sort of communication. Now i have never heared of it. Now i just googled what it ist. Wikipedia states that “An rpmsg file is a restricted-permission message with an extension of rpmsg.”. Perhaps you could tell me where i find more informations about rpmsg files and how to utilize them for my purpose?

I did some further reading and found something called Messaging Unit (MU). It is described in the “i.MX 8M Mini Applications Processor Reference Manual”, Chapter 4.3. It states that “The Messaging Unit module enables two processors within the SoC to communicate and coordinate by passing messages (e.g. data, status and control) through the MU interface.”

I thought that i might be able to use the MU Interface in a c Programm and run it in a docker container on torizon. Have you (or anyone else here) ever heared of it, and succesfully used it?

Thanks for the help !!!

Hi @tadegiac,

Well, sometimes Toradex pages seem hard for me to find something. Clearly you should bookmark KNOWLEDGEBASE. Look there for M4 and FreeRTOS. Check not only articles for Verding, but as well VF61 and other variants. Even if there are no instructions for your derivative, kernel still has drivers for RPMSG and other things mentioned there.

MU unit is exactly what is used by RPMSG to exchange messages between Cortex A and Cortex M. Here’s another link which could be useful LINK. Please search around for more answers.

Regards,

Edward

Hi @Edward

Thanks for your Input.
Hi @tadegiac, is your issue solved?

Best regards,
Jaski

Hi @jaski.tx

Well, partly yes.
I found out about RPMSG, i was able to load rpmsg examples as .bin files on the
m4 core. Sadly it doesn’t really work. I am having the similar problems like the people here:

I actually wanted to answer this question for others like me, as soon as i get the example working. But i am not there yet.

Thank you for cheking in on me, i really appreciate it!

Hi @tadegiac

Thanks for your feedback. As you maybe already found out, something is broken in the new version of U-Boot and we don’t have much experience with M4 on iMX8MM or iMX8MP.
We hope to solve this soon.

Best regards,
Jaski

Hi @jaski.tx

Thank you for your answer. Well the most promising posts i found to get the RPMSG working on the latest Torizon version are these:

Especially the second one seems very promising. You said that “you don’t have much experience with M4 on iMX8MM”. Do you mean in general or just for the latest torizon? I am asking, because I thought that i could, as a last resort, install an older version of Torizon and try it again Do you think that would increase my chances of success?

Best Regards, tadegiac

Hi @tadegiac

Currently, loading the M4 firmware in U-Boot should work. For the support of RpMsg, we are checking to find a solution.

You said that “you don’t have much experience with M4 on iMX8MM”.

I mean that in general, since iMX8MM is a new Product. We don’t support any older Bsp von Verdin iMX8MM. Regarding the M4, @gustavo.tx can also provide an update here.

Best regards,
Jaski

Greetings @tadegiac!

Latest I tried I was able to run the RPMsg examples on Torizon and the Verdin iMX8M Mini.

The only change I made was to use this device tree overlay, as I mentioned in the other post. Did you have a chance to try this? I might also give this a go again with the latest Torizon nightly.