Skip to content

Mcumgr not working with CONFIG_MCUMGR_TRANSPORT_SHELL+CONFIG_SHELL_BACKEND_SERIAL_API_POLLING #100468

@JaagupAverin

Description

@JaagupAverin

Describe the bug

Issue:

Was trying to test mcumgr/SMP with native_sim but the SMP commands would get regular shell responses in form of AAsIAAABAAAABqBzEw==: command not found
However it appears this issue applies to CONFIG_SHELL_BACKEND_SERIAL_API_POLLING=y in general, which is the default for native_sim.

Some investigation:

  • CONFIG_MCUMGR_TRANSPORT_SHELL only hooks into the interrupt/async shell backend. In zephyr/subsys/shell/backends/shell_uart.c:70-132.
  • The polling backend (zephyr/subsys/shell/backends/shell_uart.c:263-309) never calls smp_shell_rx_bytes(). When the build ends up with CONFIG_SHELL_BACKEND_SERIAL_API_POLLING=y (the default for native_sim), every SMP byte is treated as ordinary shell input.
  • Kconfig doesn’t express this incompatibility, so you can enable CONFIG_MCUMGR_TRANSPORT_SHELL together with the polling backend and get a silently non-working configuration.

Fix:

CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_SHELL_BACKEND_SERIAL_INTERRUPT_DRIVEN=y
CONFIG_SHELL_BACKEND_SERIAL_API_INTERRUPT_DRIVEN=y

Desired outcome:

At least a Kconfig conflict.

Regression

  • This is a regression.

Steps to reproduce

No response

Relevant log output

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

No response

Additional Context

No response

Metadata

Metadata

Assignees

Labels

area: ShellShell subsystembugThe issue is a bug, or the PR is fixing a bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions