Skip to content

Conversation

@zakport
Copy link
Contributor

@zakport zakport commented Nov 5, 2024

The smp shell transport is configured to work over uart shell.
The uart shell's device can be reconfigured at runtime.
The Smp shell driver currently responds on the device defined as shell in the device tree while receiving data from the uart shell whose device can be changed during runtime.

A similar fix from 2020:
#27871

The issue came back here when the shell structures were changed.
6d2e3b5

This pull request takes the device from the uart_shell structures.
Fixes: #81144

@zakport zakport force-pushed the smp_respond_on_shell_device branch from 281d7a9 to 83e5228 Compare November 5, 2024 14:30
@zakport zakport marked this pull request as draft November 5, 2024 14:34
@zakport zakport marked this pull request as ready for review November 5, 2024 14:36
Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whilst this is fixing an issue, this function is used to transmit 2 or 3 bytes per call, you are adding a huge overhead by doing this by calling an extra function, and adding a bug because you could switch shell backends part the way through a transfer. So this needs to be fixed properly by getting the shell once for transmitting a whole packet

Responses are currently set to the shell device that was configured
in the device tree.

The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.

This patch causes smp_shell_tx_raw to use the shell_uart device

Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
@zakport zakport force-pushed the smp_respond_on_shell_device branch from 83e5228 to 97a6043 Compare November 6, 2024 06:05
@zakport zakport requested a review from nordicjm November 6, 2024 10:13
@nordicjm
Copy link
Contributor

nordicjm commented Nov 6, 2024

If you want this fix in zephyr 4.0, it will need a github issue that this marks as fixing, if so could you open one?

@mmahadevan108
Copy link
Contributor

@zakport , can you add a Zephyr issue with details about the problem seen and link it to this PR.

@mmahadevan108 mmahadevan108 added the bug The issue is a bug, or the PR is fixing a bug label Nov 7, 2024
@zakport
Copy link
Contributor Author

zakport commented Nov 8, 2024

Hey,
I created an issue #81144

@thedjnK thedjnK added this to the v4.0.0 milestone Nov 8, 2024
@thedjnK thedjnK added the backport v3.7-branch Request backport to the v3.7-branch label Nov 8, 2024
@mmahadevan108 mmahadevan108 merged commit 32b1140 into zephyrproject-rtos:main Nov 8, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: mcumgr backport v3.7-branch Request backport to the v3.7-branch bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smp shell transport can respond on a different device than it receives from

7 participants