-
Notifications
You must be signed in to change notification settings - Fork 8.2k
shell: avoid immediate logging to a shell that might not be setup #98021
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
base: main
Are you sure you want to change the base?
shell: avoid immediate logging to a shell that might not be setup #98021
Conversation
During a boot process bringup an MPU error was triggered because the log process was being called before the shell was initialized which should be avoided by a configuration guard. It seems that using log immediate intends to bypass the shell to just use a backend that is raw - ie. console, serial, etc. So, just add the configuration guard in addition to the minimal mode Signed-off-by: Charles Hardin <[email protected]>
|
|
@nordic-krch can you please take a look? |
|
It should not be needed. Immediate mode in shell log backend ensures correct multiplexing of logging data with shell data so using raw backend will degrade user expirience. Shell log backend processing is dropping all messages which come before backend is enabled: zephyr/subsys/shell/shell_log_backend.c Line 237 in ad7beb5
It would be good figure out why messages were not dropped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Immediate logging should be supported by shell and any logs coming before shell backend is ready shall be dropped.
|
Here is the crash info - seems a corrupt stack ... we've reproduced this on an stm32f4 and make sure this is in the config so far. and this is the gdb backtrace - but the stack looks a bit corrupted And this was in the prj.conf |
So, when we disable the shell backend and leave immediate the fault would no longer occur and we just use the uart backend of the logging to get the debug. If there is a better path to debugging the corrupt stack then that would be useful. This might be specific to the stm32 since we don't use any other MCUs at this time. |



During a boot process bringup an MPU error was triggered because the log process was being called before the shell was initialized which should be avoided by a configuration guard. It seems that using log immediate intends to bypass the shell to just use a backend that is raw - ie. console, serial, etc.
So, just add the configuration guard in addition to the minimal mode