Hello,
I am new to this mailing list. I have done some work recently to get the RPMSG sample running on a dual core STM32H device from ST and it works. In this case both Host and Remote runs Zephyr. My goal is to replace the Remote with a bare-metal and did some research and found open-amp can be used for the same. However, I don't see any libmetal port on STM32 under lib/system/generic. My understanding is that with this, I would be able to modify an existing example in open-amp (under https://github.com/OpenAMP/open-amp/tree/main/apps/examples/rpmsg_sample_ech...) to work with the Zephyr rpmsg example at https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/rp...)
Has anyone attempted anything like this that I can leverage on? Other than the libmetal port, what else would be needed to get this inter-work with Zephyr RPMSG sample or should I attempt a different sample from Zephyr to work with open-amp sample? Any help to get me in the right direction would be appreciated.
Thanks. Murali Karicheri
Hello Murali,
ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Wednesday, June 21, 2023 5:05 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] open-amp for bare-metal on STM32H7
Hello,
I am new to this mailing list. I have done some work recently to get the RPMSG sample running on a dual core STM32H device from ST and it works. In this case both Host and Remote runs Zephyr. My goal is to replace the Remote with a bare-metal and did some research and found open-amp can be used for the same. However, I don't see any libmetal port on STM32 under lib/system/generic. My understanding is that with this, I would be able to modify an existing example in open-amp (under https://github.com/OpenAMP/open- amp/tree/main/apps/examples/rpmsg_sample_ech...) to work with the Zephyr rpmsg example at https://github.com/zephyrproject- rtos/zephyr/tree/main/samples/subsys/ipc/rp...)
Has anyone attempted anything like this that I can leverage on? Other than the libmetal port, what else would be needed to get this inter-work with Zephyr RPMSG sample or should I attempt a different sample from Zephyr to work with open-amp sample? Any help to get me in the right direction would be appreciated.
For bare metal implementation on H7, you have an example on stm32cube H7 github : https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32...
The version of OpenAMP used is quite Old (2018.010) but should be compatible for RPMsg https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Middlewares/Th...
Regards, Arnaud
Thanks. Murali Karicheri -- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
Hello Arnaud,
Thanks for your quick response!
What you meant by ST Restricted?
I cloned the above repos and extracted the cmake toolchain files and other metal port files and am I able to build the latest upstream open-amp and libmetal libraries using those files. But the application builds are failing since it is unable to find the platform_info.h and platform_info.c and other related files. There should be a stm32h7 specific folder under system or machine that contains files for building application for STM32H7 device per my understanding. By restricted you meant I need to get these files from ST directly through some kind of agreement?
Other question that was in my previous email was that do I need to develop my own application to work with Zephyr RPMSG sample application? I can't find a compatible application under examples of open-amp in ST's repo or in upstream open-amp repo example folder.
Thanks,
Murali
Hello Arnaud,
I was able to create a project in STMCubeIDE for open-amp ping pong application and run successfully on STM32H745i-disco board. Since you have mentioned that this is compatible with RPMSG application on Zephyr, I will use this version for now to interface with Zephyr and will defer upgrade to latest version. Still if you have any information as to what changes are needed to STM code to upgrade to the latest version of open-amp, please let me know. I may be able to work on this and contribute to upstream.
Regards, Murali
Hello,
ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, June 23, 2023 5:00 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Re: open-amp for bare-metal on STM32H7
Hello Arnaud,
I was able to create a project in STMCubeIDE for open-amp ping pong application and run successfully on STM32H745i-disco board. Since you have mentioned that this is compatible with RPMSG application on Zephyr, I will use this version for now to interface with Zephyr and will defer upgrade to latest version. Still if you have any information as to what changes are needed to STM code to upgrade to the latest version of open-amp, please let me know. I may be able to work on this and contribute to upstream.
As the stm32cubeIDE does not support cmake for now ( this should come soon) it is not straightforward to update it. I suggest you to create a post on https://community.st.com/ for that
If you want to try it by your self 1) cmake -DCMAKE_TOOLCHAIN_FILE=template-generic -DCROSS_PREFIX=$CROSS_COMPILE with $CROSS_COMPILE that point to the arm gcc prefix
2) Rename some files ( compatibility of the ST projects with multi IDE) rename from lib/system/generic/device.c to lib/system/generic/generic_device.c rename from lib/system/generic/init.c to lib/system/generic/generic_init.c rename from lib/system/generic/io.c to lib/system/generic/generic_io.c rename from lib/system/generic/shmem.c to lib/system/generic/generic_shmem.c
3) Fix in Stm32cube project issues linked to the lrebase of the openamp libs
Regards Arnaud
Regards, Murali -- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
Thanks Arnaud for your quick response! I have some follow up questions below. Hope you can clarify that as well.
Arnaud POULIQUEN wrote:
Hello, ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, June 23, 2023 5:00 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Re: open-amp for bare-metal on STM32H7 Hello Arnaud, I was able to create a project in STMCubeIDE for open-amp ping pong application and run successfully on STM32H745i-disco board. Since you have mentioned that this is compatible with RPMSG application on Zephyr, I will use this version for now to interface with Zephyr and will defer upgrade to latest version. Still if you have any information as to what changes are needed to STM code to upgrade to the latest version of open-amp, please let me know. I may be able to work on this and contribute to upstream. As the stm32cubeIDE does not support cmake for now ( this should come soon)
it is not straightforward to update it. I suggest you to create a post on https://community.st.com/ for that
OK will do.
1. I was curious why OpenAMP is not supported for ST devices upstream. Is that planned to be added soon? Also on Zephyr I don't see any ST platforms supported either for RPMSG sample application. I was able to add this support on STM32H745i-disco and run it successfully for a Zephyr host and Zephyr remote. I am working for approval from my company to send a patch for this. However just wondering when can I expect to see STM32H7xxx devices supported upstream OpenAMP. I see that you are one of the Maintainer listed in OpenAMP and eager to hear from you on the plan.
2. I have a use case for which I am trying to use OpenAMP with Baremetal running on M4 and Zephyr on M7. This is different from the way the OpenAMP Ping Pong application is written. In our use case, CM4 boots first and wake up CM7. In this scenario, should I run Host on CM4 and Remote on CM7? So I assume I need to switch the code on CM7 and CM4 for this. The CM4 is responsible for system configuration in our case. So I think CM7 should go to stop mode and and exit the mode after CM4 does system clock configuration and then proceed to start the RPMSG application. So In this case I assume CM4 does the resource table init and CM7 wait. I am planning do this change and test the code, but would appreciate if you could comment if I am on the right track. Later I plan to update and test Zephyr remote RPMSG application to work with this CM4 Baremetal RPMSG application for evaluation.
3. I am planning to use Zephyr v3.4.0 which is using the latest OpenAMP version (2023.04.0). So on Zephyr we will have the latest code base for OpenAMP. Later when we are ready to update the the Baremetal version to 2023.04.0 , will try out below suggestion at that time. Hope the ST Baremetal support for latest OpenAMP release will be available soon.
Thanks and Regards,
Murali Karicheri
If you want to try it by your self
cmake -DCMAKE_TOOLCHAIN_FILE=template-generic -DCROSS_PREFIX=$CROSS_COMPILE with $CROSS_COMPILE that point to the arm gcc prefix 2) Rename some files ( compatibility of the ST projects with multi IDE) rename from lib/system/generic/device.c to lib/system/generic/generic_device.c rename from lib/system/generic/init.c to lib/system/generic/generic_init.c rename from lib/system/generic/io.c to lib/system/generic/generic_io.c rename from lib/system/generic/shmem.c to lib/system/generic/generic_shmem.c 3) Fix in Stm32cube project issues linked to the lrebase of the openamp libs Regards Arnaud
Regards, Murali -- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
Hello,
ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, June 30, 2023 8:59 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Re: open-amp for bare-metal on STM32H7
Thanks Arnaud for your quick response! I have some follow up questions below. Hope you can clarify that as well.
Arnaud POULIQUEN wrote:
Hello, ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, June 23, 2023 5:00 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Re: open-amp for bare-metal on STM32H7 Hello Arnaud, I was able to create a project in STMCubeIDE for open-amp ping pong application and run successfully on STM32H745i-disco board. Since you have mentioned that this is compatible with RPMSG application on Zephyr, I will use this version for now to interface with Zephyr and will defer upgrade to latest version. Still if you have any information as to what changes are needed to STM code to upgrade to the latest version of open-amp, please let me know. I may be able to work on this and contribute to upstream. As the stm32cubeIDE does not support cmake for now ( this should come soon)
it is not straightforward to update it. I suggest you to create a post on https://community.st.com/ for that
OK will do.
- I was curious why OpenAMP is not supported for ST devices upstream. Is
that planned to be added soon? Also on Zephyr I don't see any ST platforms supported either for RPMSG sample application.
On the stm32MP1, it is supported through the Zephyr: https://elixir.bootlin.com/zephyr/latest/source/samples/subsys/ipc/openamp_r...
I was able to add this support on STM32H745i-disco and run it successfully for a Zephyr host and Zephyr remote. I am working for approval from my company to send a patch for this.
Great!
However just wondering when can I expect to see STM32H7xxx devices supported upstream OpenAMP. I see that you are one of the Maintainer listed in OpenAMP and eager to hear from you on the plan.
The stm32H7 is supported through the stm32Cube distribution. No track yet for the upstream on this project. That said, any contribution is welcome, so feel free to propose something in libmetal , see even a baremetal exemple in https://github.com/OpenAMP/openamp-system-reference
- I have a use case for which I am trying to use OpenAMP with Baremetal
running on M4 and Zephyr on M7. This is different from the way the OpenAMP Ping Pong application is written. In our use case, CM4 boots first and wake up CM7. In this scenario, should I run Host on CM4 and Remote on CM7? So I assume I need to switch the code on CM7 and CM4 for this. The CM4 is responsible for system configuration in our case. So I think CM7 should go to stop mode and and exit the mode after CM4 does system clock configuration and then proceed to start the RPMSG application. So In this case I assume CM4 does the resource table init and CM7 wait. I am planning do this change and test the code, but would appreciate if you could comment if I am on the right track. Later I plan to update and test Zephyr remote RPMSG application to work with this CM4 Baremetal RPMSG application for evaluation.
It depends on with core is managing the memories. If you are using static vring implementation in zephyr, I suppose that it should work keeping CM7 as host. If you are using the resource table ( that seems the case), the https://elixir.bootlin.com/zephyr/latest/source/samples/subsys/ipc/openamp_r... Should be quite easily adapted to support CM7
- I am planning to use Zephyr v3.4.0 which is using the latest OpenAMP
version (2023.04.0). So on Zephyr we will have the latest code base for OpenAMP. Later when we are ready to update the the Baremetal version to 2023.04.0 , will try out below suggestion at that time. Hope the ST Baremetal support for latest OpenAMP release will be available soon.
As said ST supports the bare metal through the stm32cubeH7. If you need information about the plan of the stm32H7 project the best place for such question is the ST community forum. You can also have a look on the stm32MP1Cube which is based on the v2022.04 version: https://github.com/STMicroelectronics/STM32CubeMP1/tree/master/Middlewares/T...
Regards, Arnaud
Thanks and Regards,
Murali Karicheri
If you want to try it by your self
cmake -DCMAKE_TOOLCHAIN_FILE=template-generic -DCROSS_PREFIX=$CROSS_COMPILE with $CROSS_COMPILE that point to
the
arm gcc prefix 2) Rename some files ( compatibility of the ST projects with multi IDE) rename from lib/system/generic/device.c to lib/system/generic/generic_device.c rename from lib/system/generic/init.c to lib/system/generic/generic_init.c rename from lib/system/generic/io.c to lib/system/generic/generic_io.c rename from lib/system/generic/shmem.c to lib/system/generic/generic_shmem.c 3) Fix in Stm32cube project issues linked to the lrebase of the openamp libs Regards Arnaud
Regards, Murali -- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
-- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
Hi Arnaud,
Arnaud POULIQUEN wrote:
Hello,
----Cut----------
I have a use case for which I am trying to use OpenAMP with Baremetal
running on M4 and Zephyr on M7. This is different from the way the OpenAMP Ping Pong application is written. In our use case, CM4 boots first and wake up CM7. In this scenario, should I run Host on CM4 and Remote on CM7? So I assume I need to switch the code on CM7 and CM4 for this. The CM4 is responsible for system configuration in our case. So I think CM7 should go to stop mode and and exit the mode after CM4 does system clock configuration and then proceed to start the RPMSG application. So In this case I assume CM4 does the resource table init and CM7 wait. I am planning do this change and test the code, but would appreciate if you could comment if I am on the right track. Later I plan to update and test Zephyr remote RPMSG application to work with this CM4 Baremetal RPMSG application for evaluation. It depends on with core is managing the memories.
By managing the memories, I assume you are referring to the VirtIO buffer management? I am new to this code and I am not able to see any document. So please bear with me.
In the OpenAMP ping-pong example is the memory managed by CM7 (Host)? I see that resource_table is initialized by CM7 (Host) and I assume CM7 is also managing memories. Correct? So Can I assume memory management is Host's responsibility in this design?
I am trying to use OpenAMP in our use case and looking for direction as to how to customize it for our application. What I have tested is OpenAMP Bare-metal ping-pong which is based on resource table. As you have correctly gathered, I have tested the static vring implementation in zephyr. Glad to know that there is a resource table based remote example on CM4 in Zephyr to run on a STM32 SoC. I am interested in that since I am planning to run resource table based Bare-metal example on CM4. First I would like to switch role and get the code working on a Bare-metal project. Then integrate the CM4 side with Zephyr Remote example on CM7.
Since you had suggested to me to modify Zephyr side Remote example to run on CM7 as Remote in the below response, I assume I am on right track and should be running the Bare-metal Host/Master on CM4. Please correct me otherwise.
If you are using static vring implementation in zephyr, I suppose that it should work keeping CM7 as host. If you are using the resource table ( that seems the case), the https://elixir.bootlin.com/zephyr/latest/source/samples/subsys/ipc/openamp_r... Should be quite easily adapted to support CM7
Yes, I will use the resource table based remote/slave example on Zephy (CM7) and modify the code as needed.
Regards,
Murali
Murali
Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org -- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
openamp-rp@lists.openampproject.org