Previously, redrawing the prompt after log output, hitting Ctrl-L, or
cycling through the history using Up/Down or Ctrl-P/Ctrl-N in the shell
would print the user command input regardless of the obscured input
setting.
This can expose e.g. entered login information.
Therefore, z_shell_print_cmd now only prints '*' when the obscure flag is
active.
Signed-off-by: Nils Ruf <nils.ruf@endress.com>
The shell thread sent with a blocking call while holding tx_lock, and the
socket layer holds the descriptor lock for the whole call as well, so a
client that stopped reading made the socket service thread wait behind
that send when it had to close the session. Command replies blocked the
service thread the same way.
Send without blocking and wait with tx_lock released when the send cannot
proceed, for at most as long as the blocking send would have waited: for
POLLOUT when the window is full, with a growing pause when the stack is
out of buffers. A session counter, bumped under tx_lock on every accept
and close, tells whether the send may resume afterwards; a close, an
abort-output command or a new client in between drops the pending output
quietly. The send work leaves the line buffer alone while the shell thread
writes, as a delayed reschedule issued during a cancel is still armed.
Command replies are sent without blocking too. One that cannot start is
dropped; one that has partly left is completed under tx_lock within a
short bounded wait, so the option sequence never gets interleaved with
output.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
All cancels of the send work shared one k_work_sync, so two threads ending
the same session at once queued the same canceller node twice on the
kernel's pending cancel list and corrupted it. The send work handler also
cancelled itself synchronously on a send error and so could never return.
Give every cancel its own k_work_sync and make the handler only cancel
further submissions instead of waiting for itself.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The socket error was logged uninitialized when the SO_ERROR query itself
failed, for example on a descriptor that is no longer open. Use the query
error instead.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The send work handler cancelled its own work synchronously when a send
failed, which blocks the system work queue for good: the cancel waits for
the handler to return. All cancels also shared one k_work_sync, so the next
cancel from another thread queued the canceller node a second time while
it was still on the kernel's pending cancel list. That made the list
circular, and the next work queue to finalize a cancel spun forever with
the work lock held and stopped the whole system.
Let only the socket service thread close the client socket. A failed send
on another thread stops the output and shuts the socket down for reading,
which wakes the service thread with EOF whatever the error was, so the
close always follows. Give every cancel its own k_work_sync and run sends,
cancels and the close under one mutex: the descriptor cannot be closed and
reused while a send is in progress, and no two threads ever wait for the
same cancel. The server restart path uses the same close.
Assisted-by: Claude:claude-fable-5.1
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The remote shell host formats cbprintf packages received from the
remote client without validation. Document that the host must trust
the remote client cores and describe the cases where print messages
access host memory.
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Flavio Ceolin <flavio@hubble.com>
The RPMsg shell normally uses non-blocking sends during regular operation.
When all TX buffers are in use, rpmsg_trysend() fails and the shell core
cannot retry the output because the backend has no TX completion callback.
Add an option to force the existing blocking mode so applications can wait
for an available RPMsg TX buffer when output loss is not acceptable.
Signed-off-by: Takumi Ando <takumi@spacecubics.com>
z_shell_op_word_remove() moves the remainder of the line over the word
being deleted, so the number of bytes to move is the distance from the
cursor to the end of the line, plus the string terminator. The code
used cmd_buff_len - chars_to_delete, which is the length of the line
after the removal and is unrelated to the amount of data that has to be
moved. It over-copies by cmd_buff_pos - chars_to_delete - 1 bytes, so
nearly every CTRL-W issued with the cursor away from the start of the
line reads and writes past the end of cmd_buff[].
With CONFIG_SHELL_CMD_BUFF_SIZE=256, a 200 character line whose last
word is a single character makes the memmove() touch offset 397, 142
bytes past the buffer. Sweeping all line lengths and cursor positions,
over 75% of the cases run off the end, and the worst one reaches offset
502.
In struct shell_ctx, cmd_buff[] is immediately followed by temp_buff[]
of the same size, and the overrun is bounded by 2 * size - 5, so it
always stays within temp_buff[] and cannot reach printf_buff[]. The
explicit termination after the memmove() hides the over-copied bytes,
and temp_buff[] is always rewritten before it is read, so there is no
observable misbehaviour to reproduce from the shell itself. The access
is nevertheless out of bounds and silently modifies an unrelated
member.
Derive the length from the string being moved instead. Note that
cmd_buff_len - cmd_buff_pos + 1 is deliberately not used: that form is
only correct while cmd_buff_pos <= cmd_buff_len holds, which this
function does not establish locally, and the uint16_t subtraction
underflows into a huge size_t if it ever does not.
Tested on native_sim: CTRL-W still removes a trailing word, several
words in sequence, and a word together with its trailing spaces, and
remains a no-op on an empty line. tests/subsys/shell passes. Not built
for or run on any other architecture, and not run on hardware.
Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
When remote client receives execute command message it contains
a pointer to a handler that should be executed. Previously, it was
blindly executed, assuming that pointer is correct. Add validation
of that pointer by checking if pointer belongs to one of the
registered command.
If handler is not found then command returns error. Added printing
error on shell remote host when remote command failed to run.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When a backend has shell_set_bypass() active, the transport is meant
to be fully owned by the bypass callback (e.g. a binary protocol
receiver, firmware upload, etc.). However, if the log backend for
that shell is still enabled, processing a log message unconditionally
erases the current line and reprints the shell prompt (and, if echo
is enabled, the in-progress command buffer):
- shell_log_process() (deferred log mode) took the non-readline
branch whenever readline() wasn't active, which includes bypass
mode, and called z_shell_print_prompt_and_cmd() there without
checking ctx->bypass.
- process_log_msg() (immediate log mode and panic mode) took the same
non-readline branch guarded only by z_flag_cmd_ctx_get(), which is
false for the whole duration of bypass mode (it is only true while
the command handler that called shell_set_bypass() is still
running), so the same erase/prompt sequence was emitted there too.
shell_readline() itself refuses to run while bypass is active, so the
two are mutually exclusive; only the non-readline branches needed the
extra check.
This injects "uart:~$ " (and VT100 cursor/erase sequences, when
enabled) into whatever raw stream the bypass consumer expects,
corrupting it whenever a log message is emitted while bypass is
active.
shell_vfprintf(), used for ordinary shell_print()/shell_fprintf()
calls, already special-cases this with
`!z_flag_cmd_ctx_get(sh) && !sh->ctx->bypass`. Apply the same guard
to the two log-processing paths so prompt/cmd-line redraw is
suppressed for the duration of bypass mode, while still letting the
log message itself be written out.
Tested on native_sim with a minimal shell command that enters bypass
mode plus a background thread periodically logging: no prompt is
emitted between entering and leaving bypass mode. Also verified on
real hardware (nucleo_f091rc, CONFIG_SHELL_BACKEND_RTT), observed
over RTT.
Assisted-by: Claude:claude-sonnet-5
Signed-off-by: Lezhi CHEN <lezhi.chen1998@outlook.com>
Add CONFIG_SCHED_STATS_SHELL (stats_service.c): a per-CPU busy/idle
summary and per-thread CPU usage shell built on
CONFIG_SCHED_THREAD_USAGE. Commands: sched cpus, sched threads,
sched top. Supports interval sampling (-i ms), delta mode (-d), CPU
filter (-c), and repeat count (-n). Uses k_thread_runtime_stats_*()
APIs.
Named CONFIG_SCHED_STATS_SHELL / "sched" (not "stats") to avoid a
naming conflict with the existing CONFIG_STATS_SHELL mcumgr module.
The per-CPU and per-thread table buffers are static to avoid a
multi-KB stack allocation that can overflow the shell thread's stack;
the command body is serialized with a mutex so concurrent use from two
shell backends cannot corrupt the shared tables and baselines.
Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
The thread list command reads timeout.dticks unless the min-heap timeout
backend is selected, but the skip-list backend also stores abs_ticks and
has no dticks member, so the build fails. Select abs_ticks for the
skip-list backend too and update the comment to name all the
backends.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
The SMP shell transport hardcodes UART backend lookup in TX path,
causing mcumgr responses to always go to UART regardless of which
backend received the request.
Store a pointer to the shell_uart_common context in smp_shell_data
during init and use it in smp_shell_process() to set the TX target.
This allows SMP responses to route back to the correct backend
(UART, CDC-ACM, etc.).
Co-Developed-by: qwen3.6:27b via llama.cpp <assistant@opencode.ai>
Signed-off-by: Kuldeep Dhaka <kuldeepdhaka9@gmail.com>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
It uses k_cycle_get_64() exclusively, which returns 0 when the platform has
none, so it silently reports every sample as an overflow.
Assisted-by: Claude:opus-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Use `z_shell_strlen()` where shell code accepts optional strings or
treats NULL and empty names equivalently.
This removes duplicated NULL checks while preserving explicit pointer
guards before later dereferences.
Assisted-by: Copilot:GPT-5.6 Terra
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Format the device-selection condition in shell_device_internal() with
the repository clang-format configuration so subsequent changes pass
the compliance check.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
Replace scripts/kconfig/hardened.csv with a distributed YAML database.
The CSV format could not carry any explanation for its recommendations,
had no validation (a malformed line was silently dropped), no notion of
profiles, no ownership story, and no way to extend it out of tree.
The database now lives where the code lives: the central
scripts/kconfig/hardening.yaml defines the hardening profiles (plus
rules for top-level Kconfig symbols), and per-subsystem hardening.yaml
fragments next to the relevant Kconfig files carry the rules, so each
rule is reviewed by the maintainers of the code it hardens. Every rule
has a required rationale and optional references, supports exact-value
and integer min/max recommendations (STACK_POINTER_RANDOM is now
'>=100' instead of '==100'), and belongs to a profile: 'base' (memory
protection and inherently insecure features) or 'strict' (extends base
with debug/observability feature removal). The default profile is
'strict', matching the rule set the CSV checked.
hardenconfig is restructured around a serializable HardeningReport
model so results can be consumed programmatically, and gains:
- a Rationale column in the report
- profile selection:
west build -t hardenconfig -- -DHARDENCONFIG_PROFILE=base
- HARDENCONFIG_SHOW_ALL to also list PASS/NA results
- HARDENCONFIG_STRICT to exit non-zero on failures, for CI use
- HARDENCONFIG_JSON to write machine-readable results, including which
database file each rule came from
- HARDENCONFIG_EXTRA_SOURCES to layer out-of-tree database files that
may add profiles/rules and override in-tree ones
The EXPERIMENTAL/DEPRECATED/NOT_SECURE marker symbol detection is
preserved unchanged.
Three CSV entries are intentionally not carried over because they were
redundant: BT_CONN_DISABLE_SECURITY and BT_OOB_DATA_FIXED can only be
enabled together with BT_TESTING, and TIMER_RANDOM_GENERATOR together
with TEST_RANDOM_GENERATOR, all of which the database already
recommends disabling for the same profiles.
Behavioral fix: the CSV's DEBUG_COREDUMP line used '=' instead of ','
and was silently ignored, so CONFIG_DEBUG_COREDUMP was never actually
checked; it now is.
Also add tabulate to requirements-base.txt: hardenconfig has always
imported it, but it was only pulled in via other requirements files.
Assisted-by: Claude:fable-5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Use ticks instead of milliseconds to avoid 64 bit division which
is needed by k_uptime_get.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The backend is enabled in shell_start(), so with SHELL_AUTOSTART=y
early log/printk output is buffered (deferred mode) or lost (immediate
mode) until the shell thread runs. Document this and the
SHELL_AUTOSTART=n + shell_start() alternative.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
log_backend_enable() was called before the backend state was set to
SHELL_LOG_BACKEND_ENABLED. The core may call process() as soon as the
backend is active, so a message arriving in that window hit the
DISABLED case and was dropped. Activate the backend last.
Fixes#118912
Co-Authored-By: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
The slim ring buffer API is now header-only and always available and the
tree has already migrated from the _claim/_finish API, so the RING_BUFFER
symbol no longer gates any code.
Remove the now-redundant "select RING_BUFFER" and CONFIG_RING_BUFFER=y
entries across drivers, subsystems, samples and tests.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
Optimize shell device enumeration functions where strlen() was
unnecessarily recomputed on every loop iteration even though the
string argument never changed within the loop.
The affected functions:
- shell_device_internal(): strlen(prefix) recomputed in device enumeration
- shell_device_get_binding_all(): strlen(name) recomputed in device lookup
- device_has_nodelabel(): strlen(name) recomputed in nodelabel comparison
Store the string length in a local variable before the loop and reuse it
throughout, eliminating redundant strlen() calls in hot paths.
Assisted-by: Claude:Haiku 4.5
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
So far shell was calling state_set(sh, SHELL_STATE_ACTIVE) when
prompt was supposed to be printed. It was relying on a fact that
when ACTIVE state was set then state_set function was also printing
a prompt. However, state_set() was also changing the state to ACTIVE
and it might not be expected, for example, after shell_stop() was
called in the shell command.
Remove prompt printing from state_set function and call prompt
printing function explicitly to no change shell state.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
When logging parent->syntax check if parent is not null. It is
possible if remote client do not have any commands enabled that
msg->parent is null.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Increate default timeout value. When command prints a lot of data
it can easily take much more than 100 ms.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Shell UART backend file was expecting presence of zephyr,shell-uart in DT
and the default instance was created. Add ifdefs to skip it if chosen is
not set.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Remove the `kernel log_level <module> <severity>` shell subcommand. It
has warned at runtime on every invocation since commit 8207a05304
("shell: modules: kernel_service: deprecate log_level"), first released
in Zephyr 4.1, so it is well past the two-release deprecation window.
The `log enable <severity> <module>` command from the logging command
set provides the same functionality.
The command was fully self-contained in log-level.c and registered
through KERNEL_CMD_ARG_ADD, so removing the file and its CMakeLists.txt
entry drops it entirely; no other code referenced it.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Assisted-by: Claude:opus-5
This commit updates the usage of ring_buf to utilize the new
put_ptr/commit/get_ptr/consume pattern instead of the traditional
claim/finish approach. This change is part of a larger refactor aimed at
streamlining the ring_buf API and improving its efficiency.
Signed-off-by: Måns Ansgariusson <mansgariusson@gmail.com>
Fix regression introduced by 069d3a7652. async_read() function
was allocating new buffer even when UART was not expecting it.
Buffer pool was quickly drained and shell was unresponsive.
Added additional check to attempt to allocate new a new buffer
only if UART is waiting for new buffer (UART is disabled or there
is unhandled RX buffer request).
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
The whitespace-skipping loop in formatted_text_print() advances past
every character for which isspace() returns non-zero. Because isspace()
matches both newlines and ordinary spaces, any leading spaces that
follow
a '\n' in a help string were being discarded, stripping intentional
indentation from continuation lines.
Fix this by breaking out of the loop immediately after consuming the
'\n'. The newline itself must still be skipped to prevent an empty line
from being printed, but the spaces that follow it on the next line are
part of the author's intended layout and must be preserved.
Before this fix, a help string such as:
"[-v] [-n <count>]\n"
" Options:\n"
" -v verbose output\n"
" -n <count> number of iterations (default: 1)"
was rendered as:
test - [-v] [-n <count>]
Options:
-v verbose output
-n <count> number of iterations (default: 1)
After this fix:
test - [-v] [-n <count>]
Options:
-v verbose output
-n <count> number of iterations (default: 1)
Signed-off-by: Aziz Sellami <aziz.sellami@nxp.com>
This replaces the older k_sleep(K_MSEC(time)) pattern with the modern,
more efficient k_msleep(time) API. This prevents double-macro expansion
overhead and adheres to Zephyr's preferred timeout style.
Signed-off-by: Saksham Gupta <saksham77779@gmail.com>
shell_stop() read/wrote sh->ctx->state without taking the shell lock.
If a command was still running on the shell thread, state_collect()
would finish with an unconditional state_set(ACTIVE), clobbering the
SHELL_STATE_INITIALIZED shell_stop() had just set. The log backend
was left disabled and shell_start() would then fail with -ENOTSUP.
Fix by having shell_stop() take the same lock shell_thread() already
holds during shell_process()/state_collect(), like shell_start()
already does. Returns -EBUSY if the lock is busy.
Fixes#115019
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
The telnet backend exposes the full Zephyr shell over an unauthenticated,
unencrypted TCP port, which is equivalent to granting full device control
to anyone who can reach the port. There is no in-tree authentication to
switch on, so add the security warning to the Kconfig help, mirroring the
guidance already given for MCUMGR_GRP_SHELL.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Use #include <> instead of #include "" to include a header file which path
is not relative to the directory path of the file emitting the #include
directive.
This change was made running scripts/check_quoted_includes.py script
proposed in https://github.com/zephyrproject-rtos/zephyr/pull/112135
with the Linux shell command below and manually selecting the applicable
changes:
$ find subsys/shell/ -type f -exec \
./scripts/check_quoted_includes.py -w {} \;
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
If RX buffers are not provided on time it may be possible that device
enters disabling phase. Code was attempting to re-enable the UART
immediately when that is detected but it fails if UART is not yet
disabled. If providing next buffer fails then just release that
buffer and wait for UART_RX_DISABLED event. Re-enable UART from
that event.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
atomic_set is used to access tx_busy in the irq_write function (in order to
get atomic exchange behavior) so we should also access it atomically here
(even though we don't need atomic exchange behavior here).
Signed-off-by: Phil Hindman <phindman@xes-inc.com>
node is NULL if shell history is empty.
Applying a zero offset to NULL is undefined behavior.
Signed-off-by: Sandro Scherer <sandro.scherer@siemens.com>
In most usage scenarios, the thread id parameter is useful for unwind
subcommand. For example, use the 'kernel thread list' command to
locate the <thread id> of the target thread, then check the call trace
with 'kernel thread unwind <thread id>'.
At least, users should be reminded that this command accepts the
<thread id> parameter to check the call trace of any thread.
Signed-off-by: Chingbin Li <liqb365@163.com>
The "send" command of the CAN shell allows to send also CAN FD frames,
which can contain up to 64 bytes of data.
Increase the shell argc count to be able to send a fully complete CAN FD
frame with all the payload.
The exact count of argc is determined by the following command, which
uses extended ID, enables CAN FD and bit rate switch, and specify the
maximum payload size :
can send can0 -e -f -b 12345678 00 01 02 03 04 05 06 07 08 09 10 11 12 13
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
Signed-off-by: Adrien Ricciardi <aricciardi@baylibre.com>
Without optimizations the compiler does not follow how addr may be used,
only that it passed to zsoc_accept. And warns that it may be used
unitialized. Let's initialize it to zero to silence this warning.
If optimizations are used, the compiler should anyhow drop the
initialization.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Add a binary min-heap as a selectable timeout backend alongside the
sorted delta list, plugging into the backend abstraction rather than
forking timeout.c. Pending timeouts are kept in a min-heap keyed on
absolute expiry tick; insertion and arbitrary removal are O(log n),
which scales better than the delta list's O(n) insertion when many
timeouts are pending.
The backend is a new kernel/timeout_minheap.h: the heap instance (a
min_heap_ref from the previous commit), its comparator and the
z_timeout_q_*() operations, included only by timeout.c (after curr_tick)
so the whole backend stays private to that translation unit. struct
_timeout gains the abs_ticks + heap_handle representation, selected by
Kconfig (the delta list's node + dticks is the #else), with the common
fn pointer kept as a shared trailing member; the per-node helpers in
timeout_q.h grow a matching min-heap variant. The kernel shell thread
dump prints the backend's raw scheduling field (dticks or abs_ticks)
under #ifdef.
Because the shared z_add_timeout() already applies the post-#107452
conditional tick round-up, the heap inherits it: the backend's insert
simply stores abs_ticks = curr_tick + dticks. Likewise in-flight
handler synchronization (PR #109977) lives in timeout.c, so the heap
node carries no ANNOUNCING/ABORTED sentinels -- "not queued" is just
heap_handle.idx == 0.
The backend is EXPERIMENTAL, depends on TIMEOUT_64BIT (absolute ticks
need 64-bit precision), and uses a fixed-capacity heap
(CONFIG_TIMEOUT_HEAP_MAX_ENTRIES) whose overflow is a fatal error.
The min-heap algorithm, struct fields, Kconfig and capacity model are
derived from Sayooj K Karun's min-heap timeout subsystem (#106013),
reworked here to fit the pluggable backend and the current in-tree
in-flight-handler synchronization.
Co-authored-by: Sayooj K Karun <sayooj@aerlync.com>
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
A peer replying to the ESC[6n cursor-position query with ESC[0;0R
causes terminal_size_get() to store terminal_wid = 0. Any later
shell-core helper that divides or moduloes by terminal_wid then
faults with a divide-by-zero.
Validate the parsed coordinates and treat zero as a parsing failure.
cmd_resize() already restores CONFIG_SHELL_DEFAULT_TERMINAL_WIDTH/
HEIGHT on error, so a forged reply now behaves the same as a
terminal-response timeout.
Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
Read-only strings can only be skipped if shell main core has
access to the read only memory of the remote core. By default
assume that it has not access.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Use <> operator to include a Zephyr header file instead of "" that
is intended to local header files, not header files relative to
specifically defined search paths.
This change was made running the sed shell command below:
$ sed -i -E 's/#include "zephyr\/([^"]+)\.h"/#include <zephyr\/\1.h>/g' \
`grep -rsl "#include \"zephyr/" subsys/shell/`
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
The `thread` field is not initialized, if it's being animated via
k_work_queue_run instead of k_work_queue_start.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
async_uninit() was a no-op, so when the shell UART transport was
uninitialized, UART RX stayed enabled and the device remained active.
Call uart_rx_disable() in async_uninit to match async_init's rx_enable(),
so the UART is fully disabled on uninit.
Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
Omitting the parameter name in a function definition is a C23 extension.
Fix this by naming second and third parameter in shell_thread function
definition to address compilation warning promoted to error in CI with
LLVM.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Up to now, some initialization has been deferred from the shell_init
function (which starts the shell_thread) to the shell_thread function. When
using SHELL_AUTOSTART this is fine, but when autostart is disabled this
causes a race between the shell_thread and whatever thread eventually calls
shell_start, because shell_start needs initialization to have completed
before it runs. So, move the remaining initialization code from the
beginning of the shell_thread to shell_init (before starting the
shell_thread).
Signed-off-by: Phil Hindman <phindman@xes-inc.com>
Display which CPU each thread and interrupt stack is running on when
SMP is enabled. Shows CPU ID as the last column for clarity and proper
alignment. On non-SMP systems, output remains unchanged.
Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>