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

shell: kernel: fix reset command echo abrupt termination #35326

Merged
merged 1 commit into from
May 18, 2021

Conversation

nwsetec
Copy link
Contributor

@nwsetec nwsetec commented May 17, 2021

Allow time for the shell to successfully echo the reboot command input
before the reboot abruptly terminates it. This can help external
systems that interact with the shell and require the reboot command's
echo to successfully complete to synchronise with the device.

Fixes: #35325

Signed-off-by: Nick Ward nick.ward@setec.com.au

@github-actions github-actions bot added the area: Shell Shell subsystem label May 17, 2021
Allow time for the shell to successfully echo the reboot command input
before the reboot abruptly terminates it. n This can help external
systems that interact with the shell and require the reboot command's
echo to successfully complete to synchronise with the device.

Fixes: zephyrproject-rtos#35325

Signed-off-by: Nick Ward <nick.ward@setec.com.au>
@@ -220,6 +220,9 @@ static int cmd_kernel_reboot_warm(const struct shell *shell,
{
ARG_UNUSED(argc);
ARG_UNUSED(argv);
#if (CONFIG_KERNEL_SHELL_REBOOT_DELAY > 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

To be considered if IS_ENABLED is better. @nordic-krch any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

IS_ENABLED cannot be used because it is not binary value you might do

if (CONFIG_KERNEL_SHELL_REBOOT_DELAY > 0) {
   k_sleep();
}

but compilation will fail when CONFIG_REBOOT is not defined. So i guess it should stay as is.

@MaureenHelm MaureenHelm added this to the v2.6.0 milestone May 18, 2021
@MaureenHelm MaureenHelm added the bug The issue is a bug, or the PR is fixing a bug label May 18, 2021
@galak galak merged commit 3cad7f3 into zephyrproject-rtos:main May 18, 2021
@nwsetec nwsetec deleted the fix_reset_shell_cmd branch May 18, 2021 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Shell Shell subsystem 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.

Shell: Kernel: Reboot: echo is abruptly terminated
5 participants