Hi Erwan, Arnaud, et all
I am using the Open-AMP ping pong example available in STM32CubeMX/IDE on a STM32H7 SoC. The example (not sure if it it is the same version) is at https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32... It is a Bare-metal example. I am trying find out which example in Zephyr can interface with this example. Currently I am using https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/ipc/op... since it uses resource table as in the PingPong Bare-metal example. But as you know the open-amp package used in Zephyr side is very new (I am using Zephyr 3.4.0). I have made couple of changes listed below to work with the PingPong example 1. resource_table in linker file to use the SRAM4 on STM32H7 SoC that I am using 2. I had to define CONFIG_RAM_CONSOLE=y since without it, the shared memory resource table offsets are different as seen by the Bare-metal side. 3. The PingPong application is using name service. So I have updated Zephyr side to use name service. 4. Remove tty application. Modify the Client application to receive a 4 byte data, increment and send it back to Master
With these changes, I can see the NS message sent out by CM4 running Zephyr. But my CM7 Bare-metal application doesn't see the message.
So the first question is if Open-AMP/Shared memory structs are compatible? Other piece of information is Zephyr runs on CM4 and Bare-metal on CM7. On my debug, I found that the vring struct in memory has len = 0 instead of 100. Not sure where that goes wrong. Still debugging
Hi,
ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, September 22, 2023 10:06 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Open-AMP compatibility question
Hi Erwan, Arnaud, et all
Erwan does probably not subscribe to this mailing list. If you want to discuss with him you need to add the Zephyr mailing list
I am using the Open-AMP ping pong example available in STM32CubeMX/IDE on a STM32H7 SoC. The example (not sure if it it is the same version) is at https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects /STM32H747I-DISCO/Applications/OpenAMP/OpenAMP_PingPong It is a Bare-metal example. I am trying find out which example in Zephyr can interface with this example. Currently I am using https://github.com/zephyrproject- rtos/zephyr/blob/main/samples/subsys/ipc/openamp_rsc_table/src/main_re mote.c since it uses resource table as in the PingPong Bare-metal example. But as you know the open-amp package used in Zephyr side is very new (I am using Zephyr 3.4.0). I have made couple of changes listed below to work with the PingPong example 1. resource_table in linker file to use the SRAM4 on STM32H7 SoC that I am using 2. I had to define CONFIG_RAM_CONSOLE=y since without it, the shared memory resource table offsets are different as seen by the Bare-metal side. 3. The PingPong application is using name service. So I have updated Zephyr side to use name service. 4. Remove tty application. Modify the Client application to receive a 4 byte data, increment and send it back to Master
With these changes, I can see the NS message sent out by CM4 running Zephyr. But my CM7 Bare-metal application doesn't see the message.
So the first question is if Open-AMP/Shared memory structs are compatible?
Yes, it should, the zephyr and baremetal don't use the same version of the open-amp library but they should be compatible.
Other piece of information is Zephyr runs on CM4 and Bare-metal on CM7. On my debug, I found that the vring struct in memory has len = 0 instead of 100. Not sure where that goes wrong. Still debugging
Unclear, please could specify the name of the structure you mention and the core you debug here. You probably have to check that the M7 firmware fills the resource table fw_rsc_vdev_vring and fw_rsc_vdev structures to provide vring addresses to The Zephyr.
Regards, Arnaud
-- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
Arnaud POULIQUEN wrote:
Hi, ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, September 22, 2023 10:06 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Open-AMP compatibility question Hi Erwan, Arnaud, et all Erwan does probably not subscribe to this mailing list. If you want to discuss with
him you need to add the Zephyr mailing list
I am using the Open-AMP ping pong example available in STM32CubeMX/IDE on a STM32H7 SoC. The example (not sure if it it is the same version) is at https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects /STM32H747I-DISCO/Applications/OpenAMP/OpenAMP_PingPong It is a Bare-metal example. I am trying find out which example in Zephyr can interface with this example. Currently I am using https://github.com/zephyrproject- rtos/zephyr/blob/main/samples/subsys/ipc/openamp_rsc_table/src/main_re mote.c since it uses resource table as in the PingPong Bare-metal example. But as you know the open-amp package used in Zephyr side is very new (I am using Zephyr 3.4.0). I have made couple of changes listed below to work with the PingPong example 1. resource_table in linker file to use the SRAM4 on STM32H7 SoC that I am using 2. I had to define CONFIG_RAM_CONSOLE=y since without it, the shared memory resource table offsets are different as seen by the Bare-metal side. 3. The PingPong application is using name service. So I have updated Zephyr side to use name service. 4. Remove tty application. Modify the Client application to receive a 4 byte data, increment and send it back to Master With these changes, I can see the NS message sent out by CM4 running Zephyr. But my CM7 Bare-metal application doesn't see the message. So the first question is if Open-AMP/Shared memory structs are compatible? Yes, it should, the zephyr and baremetal don't use the same version of the
open-amp library but they should be compatible.
Other piece of information is Zephyr runs on CM4 and Bare-metal on CM7. On my debug, I found that the vring struct in memory has len = 0 instead of 100. Not sure where that goes wrong. Still debugging Unclear, please could specify the name of the structure you mention and the
core you debug here. You probably have to check that the M7 firmware fills the resource table fw_rsc_vdev_vring and fw_rsc_vdev structures to provide vring addresses to The Zephyr.
M4 runs Zephyr sample application https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/op... M7 runs v2018.010 Ping/Pong application using STM32CubeIDE and Bare-metal
The problem is the Name Service message doesn't reach to M7 side.
In https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/ipc/op... the client code calls rpmsg_create_ept() ->rpmsg_send_ns_message() ->rpmsg_send_offchannel_raw() ->rpmsg_virtio_send_offchannel_raw() ->rpmsg_virtio_get_tx_payload_buffer()
Inside this function just before https://github.com/zephyrproject-rtos/open-amp/blob/42b7c577714b8f22ce82a901...
I have checked the rdev->vdev->vring_info->vq->vq_ring->num = 4 rdev->vdev->vring_info->vq->vq_ring->desc->addr = 2048 rdev->vdev->vring_info->vq->vq_ring->desc->len= 100 rdev->vdev->vring_info->vq->vq_ring->desc->flags= 2 rdev->vdev->vring_info->vq->vq_ring->desc->next = 1
But when stepped over https://github.com/zephyrproject-rtos/open-amp/blob/42b7c577714b8f22ce82a901...
I see that rdev->vdev->vring_info->vq->vq_ring->desc->len= 0
When I use Bare-metal, this remains as 100. How this gets modified when I step over this code -> rp_hdr->reserved = idx; I suspect this causes the message to be lost??
Hope this helps.
Regards, Arnaud
-- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
murali.karicheri@sandc.com wrote:
Arnaud POULIQUEN wrote:
Hi, ST Restricted -----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Friday, September 22, 2023 10:06 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Open-AMP compatibility question Hi Erwan, Arnaud, et all Erwan does probably not subscribe to this mailing list. If you want to discuss with him you need to add the Zephyr mailing list I am using the Open-AMP ping pong example available in STM32CubeMX/IDE on a STM32H7 SoC. The example (not sure if it it is the same version) is at https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects /STM32H747I-DISCO/Applications/OpenAMP/OpenAMP_PingPong It is a Bare-metal example. I am trying find out which example in Zephyr can interface with this example. Currently I am using https://github.com/zephyrproject- rtos/zephyr/blob/main/samples/subsys/ipc/openamp_rsc_table/src/main_re mote.c since it uses resource table as in the PingPong Bare-metal example. But as you know the open-amp package used in Zephyr side is very new (I am using Zephyr 3.4.0). I have made couple of changes listed below to work with the PingPong example 1. resource_table in linker file to use the SRAM4 on STM32H7 SoC that I am using 2. I had to define CONFIG_RAM_CONSOLE=y since without it, the shared memory resource table offsets are different as seen by the Bare-metal side. 3. The PingPong application is using name service. So I have updated Zephyr side to use name service. 4. Remove tty application. Modify the Client application to receive a 4 byte data, increment and send it back to Master With these changes, I can see the NS message sent out by CM4 running Zephyr. But my CM7 Bare-metal application doesn't see the message. So the first question is if Open-AMP/Shared memory structs are compatible? Yes, it should, the zephyr and baremetal don't use the same version of the open-amp library but they should be compatible. Other piece of information is Zephyr runs on CM4 and Bare-metal on CM7. On my debug, I found that the vring struct in memory has len = 0 instead of 100. Not sure where that goes wrong. Still debugging Unclear, please could specify the name of the structure you mention and the core you debug here. You probably have to check that the M7 firmware fills the resource table fw_rsc_vdev_vring and fw_rsc_vdev structures to provide vring addresses to The Zephyr. M4 runs Zephyr sample application https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/subsys/ipc/op...
M7 runs v2018.010 Ping/Pong application using STM32CubeIDE and Bare-metal The problem is the Name Service message doesn't reach to M7 side. In https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/ipc/op... the client code calls rpmsg_create_ept() ->rpmsg_send_ns_message() ->rpmsg_send_offchannel_raw() ->rpmsg_virtio_send_offchannel_raw() ->rpmsg_virtio_get_tx_payload_buffer() Inside this function just before https://github.com/zephyrproject-rtos/open-amp/blob/42b7c577714b8f22ce82a901... I have checked the rdev->vdev->vring_info->vq->vq_ring->num = 4 rdev->vdev->vring_info->vq->vq_ring->desc->addr = 2048 rdev->vdev->vring_info->vq->vq_ring->desc->len= 100 rdev->vdev->vring_info->vq->vq_ring->desc->flags= 2 rdev->vdev->vring_info->vq->vq_ring->desc->next = 1 But when stepped over https://github.com/zephyrproject-rtos/open-amp/blob/42b7c577714b8f22ce82a901... I see that rdev->vdev->vring_info->vq->vq_ring->desc->len= 0 When I use Bare-metal, this remains as 100. How this gets modified when I step over this code -> rp_hdr->reserved = idx;
So subsequently it calls buff_len = virtqueue_get_buffer_length(rvdev->svq, idx); at https://github.com/zephyrproject-rtos/open-amp/blob/42b7c577714b8f22ce82a901... and get buff_len = 0 and call rpmsg_virtio_enqueue_buffer(). With zero buff_len, I think on the remote end it would discard the message since buff_len = 0.
I suspect this causes the message to be lost?? Hope this helps.
Regards, Arnaud -- Openamp-rp mailing list -- openamp-rp@lists.openampproject.org To unsubscribe send an email to openamp-rp- leave@lists.openampproject.org
This issue is resolved. The Zephyr client gets its Shared memory address and size from DT. So it was pointing the shared memory region to start of SRAM where it collide with the resource table. I had to add an offset to the read address to fix this.
Regards,
Murali
Thank you for the feedback, it's great that it's working for you now!
ST Restricted
-----Original Message----- From: Murali Karicheri via Openamp-rp <openamp- rp@lists.openampproject.org> Sent: Tuesday, October 3, 2023 3:25 PM To: openamp-rp@lists.openampproject.org Subject: [Openamp-rp] Re: Open-AMP compatibility question
This issue is resolved. The Zephyr client gets its Shared memory address and size from DT. So it was pointing the shared memory region to start of SRAM where it collide with the resource table. I had to add an offset to the read address to fix this.
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@lists.openampproject.org