Skip to content
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_rsc_table fails on NXP i.MX8QM and i.MX8QXP ADSP #79970

Open
iuliana-prodan opened this issue Oct 17, 2024 · 7 comments
Open
Assignees
Labels
area: IPC Inter-Process Communication area: Open AMP bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug

Comments

@iuliana-prodan
Copy link
Collaborator

Describe the bug
The sample samples/subsys/ipc/openamp_rsc_table fails on NXP i.MX8QM and i.MX8QXP ADSP.

More exactly the board names are:

  • imx8qm_mek/mimx8qm6/adsp
  • imx8qxp_mek/mimx8qx6/adsp

To Reproduce

  1. Compile the sample like:
    west build -p -b imx8qm_mek/mimx8qm6/adsp -S nxp-openamp-imx8-adsp -s samples/subsys/ipc/openamp_rsc_table/
  2. Copy the firmware on target, in /lib/firmware.
  3. Load the firmware with remoteproc from Linux:

Expected behavior
No error should appear when loading and starting the firmware on the DSP core.

Impact
Sample doesn't work

Logs and console output

root@imx8qmmek:~# echo -n zephyr_openamp_rsc_table.elf > /sys/class/remoteproc/remoteproc2/firmware
root@imx8qmmek:~# echo start > /sys/class/remoteproc/remoteproc2/state
root@imx8qmmek:~# dmesg | tail
[  151.002661] remoteproc remoteproc2: powering up imx-dsp-rproc
[  151.005249] remoteproc remoteproc2: Booting fw image zephyr_openamp_rsc_table.elf, size 1866036
[  151.018705] rproc-virtio rproc-virtio.1.auto: assigned reserved memory node vdev0buffer@94300000
[  151.122407] imx-dsp-rproc 556e8000.dsp: imx_dsp_rproc_kick: failed (0, err:-62)
[  151.122427] virtio_rpmsg_bus virtio0: rpmsg host is online
[  151.122593] rproc-virtio rproc-virtio.1.auto: registered virtio0 (type 7)
[  151.122607] remoteproc remoteproc2: remote processor imx-dsp-rproc is now up

Environment (please complete the following information):

  • OS: Linux 6.6
  • Toolchain - zephyr-sdk-0.16.9-rc2
  • Commit SHA: Zephyr main - commit 829c03bcdca378fa2fa55484d16a190d379f754c

Additional context
If the CONFIG_SHELL is disabled the sample works.

@iuliana-prodan iuliana-prodan added the bug The issue is a bug, or the PR is fixing a bug label Oct 17, 2024
@iuliana-prodan iuliana-prodan self-assigned this Oct 17, 2024
@iuliana-prodan
Copy link
Collaborator Author

A workaround was sent for review: #79428

@pdgendt
Copy link
Collaborator

pdgendt commented Oct 17, 2024

What is the difference between /dev/ttyRPMSG0 and /dev/ttyRPMSG1 technically? The shell implementation is based on this sample using a tty.

@iuliana-prodan
Copy link
Collaborator Author

What is the difference between /dev/ttyRPMSG0 and /dev/ttyRPMSG1 technically? The shell implementation is based on this sample using a tty.

@pdgendt they are ~identical. But this issue has nothing to do with Linux.
The problem is in Zephyr.
Even if I don't enable the rpmsg_tty from openamp_rsc_table the fw still doesn't load if CONFIG_SHELL is y.

IMO this should be enabled per board, not in prj.conf. I'm not sure if this was tested on all supported platforms when introduced.

I didn't had time to find the exact root cause for this, yet.
But what doesn't this rpmsg shell do? It has any specific requirements?

@pdgendt
Copy link
Collaborator

pdgendt commented Oct 17, 2024

The rpmsg shell creates a second tty endpoint which can be used to open like a serial console. I only have i.MX8MP to test with unfortunately. But it should be as generic as the other tty endpoint used in the sample.

@iuliana-prodan
Copy link
Collaborator Author

The rpmsg shell creates a second tty endpoint which can be used to open like a serial console. I only have i.MX8MP to test with unfortunately. But it should be as generic as the other tty endpoint used in the sample.

Yes, on 8MP is working with CONFIG_SHELL=y
The difference between the 8MP and 8QM is the UART which for 8QM is interrupt driven. Any idea why would this impact the rpmsg backend?

@pdgendt
Copy link
Collaborator

pdgendt commented Oct 17, 2024

It doesn't use UART, but a mailbox? The serial part is fully emulated on linux side?

CC @arnopo

@arnopo
Copy link
Collaborator

arnopo commented Oct 17, 2024

It doesn't use UART, but a mailbox? The serial part is fully emulated on linux side?

CC @arnopo

Perhaps there is a conflict between the UART shell and the RPMSG Shell?
does board support the Zephyr shell on UART? An in such case, can we have both enabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: IPC Inter-Process Communication area: Open AMP bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants