Skip to content

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

Closed

Description

@kv2019i

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

Activity

  1. added
    enhancementNew feature or request
    ZephyrIssues only observed with Zephyr integrated
    on Apr 25, 2024
  2. self-assigned this
    on Apr 25, 2024
  3. kv2019i commented on Apr 25, 2024

    @kv2019i
    CollaboratorAuthor

    Working on this now,

  4. lgirdwood commented on Apr 25, 2024

    @lgirdwood
    Member
  5. added this to the v2.10 milestone on Apr 25, 2024
  6. cujomalainey commented on Apr 26, 2024

    @cujomalainey
    Contributor

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

  7. lgirdwood commented on Apr 26, 2024

    @lgirdwood
    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.

  8. andyross commented on May 1, 2024

    @andyross
    Contributor

    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.

  9. lgirdwood commented on May 2, 2024

    @lgirdwood
    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.

  10. kv2019i commented on May 14, 2024

    @kv2019i
    CollaboratorAuthor

    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.

  11. cujomalainey commented on May 14, 2024

    @cujomalainey
    Contributor

    @johnylin76 with relation to #5521

  12. kv2019i commented on May 24, 2024

    @kv2019i
    CollaboratorAuthor

    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.

  13. kv2019i commented on May 28, 2024

    @kv2019i
    CollaboratorAuthor

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

    #9174

  14. kv2019i commented on May 31, 2024

    @kv2019i
    CollaboratorAuthor

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

  15. kv2019i commented on Jun 4, 2024

    @kv2019i
    CollaboratorAuthor

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

  16. kv2019i commented on Jun 5, 2024

    @kv2019i
    CollaboratorAuthor

    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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ZephyrIssues only observed with Zephyr integratedenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions