-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples/ipc/openamp: Introduce OpenAMP v2018.10 Remote Echo Sample #11934
samples/ipc/openamp: Introduce OpenAMP v2018.10 Remote Echo Sample #11934
Conversation
Just need to review the last commit: |
55c1f27
to
278df68
Compare
If I remember it correctly I've got -2005 on endpoint creation on Zephyr console. Maybe just some memory allocation problem or something on Zephyr side.
I've been using UDOObuntu version of Linux kernel (something old like 3.15), patched for RPMsg - it worked with RPMsg-Lite examples previously.
Yes, it matches (except for the shared memory region which I have adjusted correspondingly in the Zephyr application).
I will try it on Wednesday. But I remember grep -i rpmsg returned just two rows. If I modprobe imx_rpmsg_tty, it proceeds without error but the /dev/ttyRPMSG is not created. |
931453b
to
51a3445
Compare
Can you please make this change on this file and post the output?
|
Sorry I could not test this change in the Linux kernel today. And I am not available till end of the year. Maybe we can remove this example from UDOO board? This return 0.
|
This print will help to see what is the beginning of the shared memory address.
This can be happening because it is looking into the wrong VRING_TX address. In the VRING_TX the master puts the available virtqueues. I'm not sure if it is possible to plug a debugger into the Udoo Neo, because using a debugger helped me a lot. |
Since there's an official release lets update to it. Signed-off-by: Kumar Gala <[email protected]>
Update to new OpenAMP v2018.10 release. This release allows us to utilize just rpmsg without remoteproc. The API set has changed and requires updates to the openamp sample. Additionally, the changes in this release reduce the code size footprint, and support a static allocation memory model. Signed-off-by: Kumar Gala <[email protected]>
…default The lpcxpresso54114_m0 tends to be the secondary core so doesn't typically have a UART setup for it. We had SEGGER support enabled by default previously, but the new Kconfig option CONFIG_USE_SEGGER_RTT needs to be set as well now. Signed-off-by: Kumar Gala <[email protected]>
The v2018.10 release of OpenAMP reworks the API set and splits the remoteproc vs rpmsg interfaces so one can use rpmsg without remoteproc. This helps drastically reduce the code footprint utilized by OpenAMP. The remote see around 4k reduction in code size. Signed-off-by: Kumar Gala <[email protected]>
Introduces the OpenAMP Remote Echo Sample to have Linux and Zephyr communicating in i.MX7/6SX SoCs. Signed-off-by: Diego Sueiro <[email protected]>
51a3445
to
62c0d74
Compare
I'll wait for the others review because I think this PR will be merged next year anyway. And maybe we will have time to debug this on the Udoo Neo. Do you have a public repo where I can see the imx_rpmsg driver ported to the Udoo Neo kernel? |
@arnop2 and @wjliang, Can you please review this PR? |
@diegosueiro
|
@arnop2, Thanks for taking time to look into this.
Yes, that is right.
For the i.MX processors in the mainline there are only the mailbox driver and the remoteproc, but the later doesn't support "extracting" the resource table data from the remote firmware binary. And there is no rpmsg driver. This why we don't need to use the remoteproc framework for the lifecycle management and the vring data extraction. I already have Zephyr and Linux communicating by using the RPMsg-lite: slides and video.
|
Thank for the clarification! now i better understand your implementation. |
I reviewed your patch, i did not see anything wrong. |
At the moment this sample is tight up to the iMX processors and RPMsg driver implementation in the Linux side only for the virtio operations. Is there any other place in this sample that is specific to the imx? |
i'm not sure that we speak about the same things, so lets me precise my thinking. When i spoke about the rpmsg sample client, i was referred to this one that is already in the kernel mainline |
UDOO Neo kernel is here and it was patched like described here. Ignore the "Build M4 Image" section. Also ignore the "rpmsg" branch in UDOO kernel repo, I haven't used it. One more difference is that I have used later version of UDOO kernel than described in the readme and patched the latest commit (5111ea94bbd0818035351fce39c83f1dbf81457b).
I used Lauterbach Trace 32 to debug UDOO Neo's M4 core before. There are only pads for the debug connector, so one have to solder the connector or the wires directly. Pausing the debugger stops also the A9 core and having it stopped for longer time stops also the USB connection with a PC. But it is still usable. |
CONFIG_HAVE_IMX_RPMSG=y | ||
CONFIG_RPMSG=y | ||
CONFIG_RPMSG_VIRTIO=y | ||
CONFIG_IMX_RPMSG_TTY=m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to enable IMX_RPMST_TTY driver?
Just check the .c file, it looks like it implements the echo, from meta-openamp, there is userspace demo which uses the kernel rpmsg_char driver, as @arnop2 mentioned, there is also kernel sample driver.
Here is the OpenAMP apps for the kernel sample driver: https://github.com/OpenAMP/open-amp/blob/master/apps/examples/rpmsg_sample_echo/rpmsg-sample-ping.c
It looks like only the virtio operation implementation is different, maybe you can reuse that application.
} | ||
|
||
/* setup vdev */ | ||
vq[0] = virtqueue_allocate(VRING_SIZE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function will do dynamic memory allocation. Just in case, if you want to avoid dynamic allocation, you can statically defined the virtqueue. As your demo is RPMSG_REMOTE, you can try static virtqueue vq[2].
|
||
/* Send data back to master */ | ||
memset(payload, 0, RPMSG_BUFFER_SIZE); | ||
memcpy(payload, data, len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to do memset 0.
Just from this commit: 62c0d74 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for doc changes, thanks.
@diegosueiro could you rebase this PR, if there's a plan to work on it again? |
closing at this has be stale for sometime, feel free to re-open and update. |
Introduces the OpenAMP Remote Echo Sample to have Linux and Zephyr communicating in i.MX7/6SX SoCs.
Note that this PR depends on #11355.