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

[FEATURE] Ability to use Zephyr shell with SOF #9081

Closed
kv2019i opened this issue Apr 25, 2024 · 14 comments
Closed

[FEATURE] Ability to use Zephyr shell with SOF #9081

kv2019i opened this issue Apr 25, 2024 · 14 comments
Assignees
Labels
enhancement New feature or request Zephyr Issues only observed with Zephyr integrated
Milestone

Comments

@kv2019i
Copy link
Collaborator

kv2019i commented Apr 25, 2024

Is your feature request related to a problem? Please describe.
Add overlay (or build option) to implement Zephyr shell (https://docs.zephyrproject.org/latest/services/shell/index.html) support to SOF, and a backend that allows to attach to the shell from host CPU (over e.g. a memory window backend). This offers a new debugging and development option for SOF development, opening up possibility to observe system state and execute test sequences on the DSP.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@kv2019i kv2019i added enhancement New feature or request Zephyr Issues only observed with Zephyr integrated labels Apr 25, 2024
@kv2019i kv2019i self-assigned this Apr 25, 2024
@kv2019i
Copy link
Collaborator Author

kv2019i commented Apr 25, 2024

Working on this now,

@lgirdwood
Copy link
Member

@andyross @cujomalainey fyi

@lgirdwood lgirdwood added this to the v2.10 milestone Apr 25, 2024
@cujomalainey
Copy link
Contributor

Interesting, would it just appear as a tty to the kernel?

@lgirdwood
Copy link
Member

Interesting, would it just appear as a tty to the kernel?

That's the intention. The kernel tty would just be a passthrough from the DSP. Similar to how GDB would work.

@andyross
Copy link
Contributor

andyross commented May 1, 2024

Ended up here after commenting on this Zephyr PR: (zephyrproject-rtos/zephyr#72158)

This sounds cool. Ironically I've never been a shell person on the Zephyr side (almost always if you're chasing a bug it's easier to just rebuild/reflash the whole app rather than trying to "use it interactively").

But one big feature it would add here is the ability to do whitebox testing on live audio firmware, something that the kernel driver normally tries its hardest to prevent. Having a backchannel from userspace would be really nice, even if you have to use the slightly crufty shell API to do it.

@lgirdwood
Copy link
Member

But one big feature it would add here is the ability to do whitebox testing on live audio firmware, something that the kernel driver normally tries its hardest to prevent. Having a backchannel from userspace would be really nice, even if you have to use the slightly crufty shell API to do it.

Ack, we were thinking things like injecting errors in pipelines, dumping state during tuning- really a method to help increase technical velocity in many ways.

@kv2019i
Copy link
Collaborator Author

kv2019i commented May 14, 2024

First Zephyr PR submitted for review zephyrproject-rtos/zephyr#72738 . SOF PR to add a config overlay and (possible) Linux SOF client to create the pty, will come later.

@cujomalainey
Copy link
Contributor

@johnylin76 with relation to #5521

@kv2019i
Copy link
Collaborator Author

kv2019i commented May 17, 2024

@kv2019i
Copy link
Collaborator Author

kv2019i commented May 24, 2024

Dependencies merged, now waiting for the zephyrproject-rtos/zephyr#72738 to be merged in Zephyr.

Uploaded a sof-docs PR to thesofproject/sof-docs#496 to document shell usage with some examples.

@kv2019i
Copy link
Collaborator Author

kv2019i commented May 28, 2024

While waiting for Zephyr side PR to be merged, here's one more draft on SOF side that adds first custom command:

#9174

@kv2019i
Copy link
Collaborator Author

kv2019i commented May 31, 2024

Shell backend now merged to Zephyr. Next step is to bring in the changes to SOF main via #9179

@kv2019i
Copy link
Collaborator Author

kv2019i commented Jun 4, 2024

SOF main now has shell support, overlay support marked ready for review: #9133

@kv2019i
Copy link
Collaborator Author

kv2019i commented Jun 5, 2024

Main feature completed and merged to v2.10. The SOF side config overlay (convenience to build with shell) and additional SOF custom commands, are still in progress, but these goes go out of the scope for this original feature request.

Follow-up PRs:

@kv2019i kv2019i closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Zephyr Issues only observed with Zephyr integrated
Projects
None yet
Development

No branches or pull requests

4 participants