Commit graph

9024 commits

Author SHA1 Message Date
Felipe Moura
fee2ddbf54 netutils/dropbear: add Dropbear SSH server port for NuttX
Integrated SSH daemon authenticating against FSUTILS_PASSWD, with an
ECDSA P-256 host key and an NSH session over a PTY per connection. Built
from the upstream Dropbear tarball (pinned commit) and patched for
NuttX, using Dropbear's bundled libtomcrypt for all crypto. setsid()
(apache/nuttx#19184) and link() now come from NuttX, not local stubs.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-06-27 08:42:00 -03:00
Michal Lenc
e44c4f370f testing/libc: add stdbit test
Adds the testing application used for CI stdc*_ functions tests.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-06-27 19:28:34 +08:00
Nightt
cea2f89f74 industry/scpi: add unit parser config options
Expose scpi-parser unit support through explicit Kconfig options instead of raw CFLAGS.

Map each option to the corresponding upstream USE_UNITS_* compile-time define, preserving the existing default unit set while allowing users to enable groups such as USE_UNITS_TIME.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-25 23:48:43 +08:00
dependabot[bot]
085ca0606e build(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-23 13:26:39 -04:00
aviralgarg05
da143595e1 apps: add missing module metadata for executable tools
Add the missing module metadata for the executable ELF helpers used by the package fixture flow so the generated artifacts describe their target and type consistently.

Also fix the existing embedlog spelling issue that is picked up by the current apps check, keeping this branch clean under CI.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-06-22 22:27:07 +08:00
Andrew Au
d9874394dd testing/sig_sp_test: add test for SP context restore on signal return
Add a test that verifies modifying SP (REG_R13) in the saved register
context is honored on signal return. The test pushes values onto the
stack, triggers SIGALRM, and in the handler advances SP to skip a
value, then verifies the correct value is popped after signal return.

This exercises the SP relocation fix in arm_sigdeliver.c for ARMv7-M
and ARMv8-M architectures.

Signed-off-by: Andrew Au <cshung@gmail.com>
2026-06-22 10:21:40 -03:00
Xiang Xiao
326b68aa36 examples/userfs: use designated initializers for struct dirent
The g_rootdir[] table initialized each entry's struct dirent member
positionally as { DTYPE_FILE, "FileN" }, which assumes d_type is the
first field.  This breaks when struct dirent gains the POSIX d_ino field
as its first member (see apache/nuttx: "fs/dirent: add d_ino member to
struct dirent"): the file-name string would be assigned to d_type,
producing -Wint-conversion warnings and an "initializer element is not
computable at load time" error.

Use designated initializers (.d_type / .d_name) so the table is robust
against the field order of struct dirent.

Also fix a 'Initiallly' typo in a nearby comment flagged by codespell.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-22 10:20:43 -03:00
Abhishek Mishra
75ee4d9090 nshlib: Add su, id, and whoami identity commands
Add NSH commands for switching effective credentials and inspecting
session identity. Update login and prompt to reflect effective user.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-20 15:38:45 -03:00
aviralgarg05
65854ea805 system/nxpkg: add local package lifecycle helper
Add the initial nxpkg command, metadata and store handling, the local install/list path, and the repository export helper.

Keep the current flow scoped to local artifacts and target-qualified repository entries so it remains usable as an incremental MVP while follow-up features land separately.

Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
2026-06-20 15:05:28 -03:00
Nightt
477d04b975 examples/gps: print units after measurements
Move GPS example units after the printed values to match the requested output style.

Wrap long printf format strings for checkpatch.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-20 11:51:35 -03:00
Nightt
1a6d06c3be examples/gps: show units in output
The GPS example prints parsed measurements without explicit units. The RMC
floating-point speed path also used minmea_tocoord(), even though speed is
not a coordinate.

Add units to the output labels, print speed with minmea_tofloat(), and print
GGA altitude as a scaled value with the sentence-provided unit.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-20 11:51:35 -03:00
Shoji Tokunaga
8d6c495365 examples/rust: Show command arguments in hello_rust_cargo
Print each argument passed from nsh with its index, and report when
the example is running on the simulator target. This makes the Rust
example demonstrate both C argv handling and target-specific output.

Signed-off-by: Shoji Tokunaga <toku@mac.​com>
2026-06-20 10:33:46 -03:00
Shoji Tokunaga
d1202bd501 examples/rust: Avoid the infinite loop on sim for hello_rust_cargo
On the sim target (Windows/macOS/Linux), hello_rust_cargo_main() ended
with an infinite `loop {}` that never returned control to NSH, so the
example could not exit and the shell prompt hung.

Introduce a Cargo `sim` feature that is enabled only when CONFIG_ARCH_SIM
is set, and use it to compile out the trailing infinite loop and return 0
instead. Other embedded targets keep the original looping behavior.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-20 10:33:46 -03:00
Abhishek Mishra
ee4727fdba testing/ostest: Add multi-user permission regression tests
Add CONFIG_TESTING_OSTEST_MULTIUSER tests for seteuid, file permissions,
and pseudoFS/tmpfs permission enforcement.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-19 12:19:18 -03:00
Tiago Medicci
1e19ceb347 examples/webpanel: Add a web panel application to configure NuttX
Initial development of the NuttX's Web Panel application. This is
a self-hosted web page application that enables retrieving system
info, provides a simple NSH terminal and enables uploading files.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-18 09:14:36 -03:00
Tiago Medicci
b523f0e513 interpreters/python: Optmize Python for size
This aims to reduce Python's library size.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:54:51 -03:00
Tiago Medicci
ec764fbbab examples/lws_echo: Add a simple websocket server example
This commit adds a simple websocket server example that echoes data
back to the client using libwebsockets.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
d6cf3015d8 netutils/libwebsockets: Fix error regarding building with CMake
Prior to this change, if an empty folder existed instead of the
actual libwebsockets source, the build would fail. This commit
checks for an actual file instead, avoid such kind of errors.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
4263e27d92 netutils/libwebsockets: Enable libwebsockets server
This commit enables building libwebsockets server based on a new
Kconfig entry.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
d106011a7f netutils/libwebsockets: Remove hard dependency on mbedTLS
libwebsockets can be built without TLS support. To allow this, it
was necessary to create a specific Kconfig option that enables TLS
support if OPENSSL_MBEDTLS_WRAPPER is enabled. Otherwise, TLS is
not supported (but libwebsockets can still be used with plain ws://
connections).

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:27:29 -03:00
Tiago Medicci
c51180d780 examples/mdnsd: Create an event-based starter for mDNS daemon
Start the mDNS daemon based on the event of getting a new IP
address for any of the system's network interfaces. This allows
DHCP client to trigger the mDNS daemon after getting a new IP
address, for instance.

Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
2026-06-16 14:24:42 -03:00
Jukka Laitinen
4740945157 ostest: Make POSIX timers test work with CONFIG_ENABLE_PARTIAL_SIGNALS
POSIX timers test doesn't really need signal actions, so we can change it
to synchronously wait for the signal in sigwaitinfo, instead of registering
a signal handler.

Also exclude the test from compilation with CONFIG_DISABLE_ALL_SIGNALS;
the test does require at least partial signal support.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-16 08:49:22 +02:00
Nightt
afc652243e examples/thttpd: use procfs for tasks CGI
The tasks CGI used nxsched_foreach() to walk scheduler internals and read
fields directly from struct tcb_s. That exposes an application example to
non-standard OS internals.

Read task information from /proc/<pid>/status instead, matching the public
procfs interface used by other task listing tools.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-14 08:56:44 -03:00
Filipe Cavalcanti
c00dc40525 interpreters/python: support nuttx-periphery package
Adds support for installing nuttx-periphery Python package by default
on Python support. This package provides API for accessing Nuttx
character drivers.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-06-12 11:56:37 -04:00
Filipe Cavalcanti
e18a206082 interpreters/python: update repack_wheel script
Updates the repack_wheel_add_pyc.py script to support other packages,
not only pip.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-06-12 11:56:37 -04:00
Lars Kruse
397047fa37 benchmarks/mtd: use uniform output style for numbers
One of the four values emitted by this interactive tools uses the
hexadecimal presentation. The other values are decimal numbers.
Now the confusion is avoided: all numbers use the decimal
representation.

In addition the suffix "size" is added to the "Erase block" label
in order to clarify its meaning.

Signed-off-by: Lars Kruse <devel@sumpfralle.de>
2026-06-10 16:43:17 +08:00
Peter Barada
499352fb0c testing/drivers/hash: Add unaligned buffer size test
Add hash testing of unaligned buffer sizes via multiple call to
ioctl(CIOCCRYPT) in a single session with buffer sizes incrementally
increasing from zero size to 255 (with monotoncially increasing
byte value data) to force all sizes to be handled by cryptodev
implementations.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-06-10 16:42:13 +08:00
Nightt
fa2dd70386 system/popen: Avoid copying FILE
Use fopencookie() to attach the popen fd and shell pid to the returned FILE stream instead of copying FILE into the popen container.

Keep the upstream dpopen()/dpclose() implementation as the process and descriptor backend, and make pclose() close the cookie-backed stream directly.

Fixes #2937.

Signed-off-by: Nightt <87569709+nightt5879@users.noreply.github.com>
2026-06-09 19:35:15 +08:00
hanzhijian
03171162f1 system/uorb: introduce CONFIG_UORB_FORMAT for format string control
Introduce a new CONFIG_UORB_FORMAT Kconfig option to control whether
uORB format strings are compiled in. UORB_LISTENER, UORB_GENERATOR,
and DEBUG_UORB all select UORB_FORMAT automatically, so format strings
are included when any of these features are enabled.

This replaces the previous approach of guarding format strings with
CONFIG_DEBUG_UORB, which prevented uorb_listener from displaying
sensor data when debug output was disabled.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-09 17:02:03 +08:00
Felipe Moura
8b43c71595 examples/rng90: add RNG90 example
Add a new RNG90 example application that opens the RNG90 character device, reads random bytes, and prints them in hexadecimal format.

The example supports optional command-line arguments for device path and byte count and integrates with Kconfig, Make, and CMake build flows.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-06-09 12:36:04 +08:00
Shoji Tokunaga
33d96e92e5 apps/tools: Enable Rust sim builds on Intel Macs
Select the Mach-O Rust target (x86_64-unknown-nuttx-macho.json) when
building Rust apps for the simulator on x86_64 macOS.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-09 07:08:41 +08:00
hanzj
8b4d20e411 system/uorb: fix listener_top not showing topic data
listener_update() only prints topic data when delta_generation is
non-zero (i.e., new data arrived since last check). In listener_top,
the first call adds objects to the list, and subsequent calls only
print if new data was published between iterations. This results in
listener_top -T showing only the header with no topic rows.

Fix by always printing the current topic state in listener_update,
setting frequency to 0 when no new data arrives. This ensures
listener_top displays all topics every iteration.

Fixes apache/nuttx-apps#3202

Signed-off-by: hanzj <hanzhijian@zepp.com>
2026-06-06 18:27:56 +08:00
raiden00pl
80907e514c lte: make lte_initialize() build without the ALT1250 daemon
Guard the daemon path (and is_daemon_running()) with CONFIG_MODEM_ALT1250 and
return OK from lte_initialize() when it is not set, so lapi builds and works
for kernel-resident LTE modems.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-06 15:53:14 +08:00
simbit18
0758631811 workflows/build.yml: Fix Skipping sim\windows in the MSVC job
Fix

====================================================================================
Cmake in present: sim\windows
Configuration/Tool: sim\windows
2026-06-05 16:01:37
------------------------------------------------------------------------------------
  Cleaning...
  Skipping: sim\windows
------------------------------------------------------------------------------------
End: 2026-06-05 16:01:37
====================================================================================

The "windows-latest" and “windows-2025” labels in GitHub Actions will be migrated to use Visual Studio 2026 by default. Customers needing Visual Studio 2022 must migrate to the windows-2022 image.

https://github.com/actions/runner-images/issues/14017

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-06-06 08:44:50 +08:00
fangpeina
1d7d4fe67e system/nxinit: fix init parser to handle multiple quoted arguments
Fix argument parsing in init_parse_arguments() to properly handle
multiple quoted arguments like 'echo "arg1" "arg2"' by skipping
quote characters after processing them.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
d79d8107b3 system/nxinit: Fix signal mask inheritance
The init process has blocked all signals, spawned services would
inherit that mask. This could cause services to miss important
signals like SIGTERM during graceful shutdown.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
b73a5acf92 system/nxinit: Fix missing check for import argument
Add missing return value check for init_parse_arguments function.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
v-maomingju
63c691eae2 system/nxinit: fix unused variable warning
fix the unused variable warnings for name and status in init.c.

Signed-off-by: v-maomingju <v-maomingju@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
84d6b1276f system/nxinit: Avoid SIGCHLD race with ppoll()
Pending all signals(SIGCHLD) when ppoll() is not invoked to
avoid race conditions.

Case reproduction

  Set examples/hello as a service that exits immediately after startup.

  ```init.rc
  on boot
     start hello

  service hello hello
     restart_period 0
  ```

  Log - without this patch:

    # Service hello only restarts about 100 times, ppoll is not woken up
    # after the hello process with PID 119 exits.

    [    4.391274] [ 2] [ 0] init_main: service 'hello' pid 118 exited status 0
    [    4.401423] [ 2] [ 0] init_main: started service 'hello' pid 119

  Log - with this patch:

    # ppoll() can still be woken up normally after tens of thousands of
    # restarts of service hello in stress test.

    [  268.447747] [ 2] [ 0] init_main: service 'hello' pid 34503 exited status 0

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
fangpeina
78bf19c83c system/nxinit: prevent parser from reading past string boundry
Any string ending with whitespace passed to init_parse_arguments()
could cause the parser to advance past the string boundary and read
unintended memory content.
 - " echo "A" \0& echo "B" should be parsed
   as a command with two argvs instand of five.
 - "command arg  " may lead to uncertain results.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
b0fdffb7f6 system/nxinit: Fix timespec incomplete error in action.h
/.../apps/system/nxinit/action.h:72:19: error: field 'time_run' has incomplete type
    72 |   struct timespec time_run;
       |                   ^~~~~~~~

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
fangpeina
62b74502fe system/nxinit: fix uninitialized 'wstatus' warning
reap_process() referenced an undeclared identifier 'wtatus' on
the WIFSIGNALED branch (typo of 'wstatus'). Some toolchains then
flagged a -Wmaybe-uninitialized on the surrounding wstatus use.

Correct the typo so WIFSIGNALED/WTERMSIG operate on the actual
wstatus value returned by waitpid().

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
fangpeina
3d26835e0c system/nxinit: fix compilation errors in action.c
action.c uses clock_gettime(CLOCK_MONOTONIC, ...) but did not
pull in <nuttx/clock.h> directly, which fails to build on
configurations where the header is not transitively included.

Add the missing #include.

Signed-off-by: fangpeina <fangpeina@xiaomi.com>
2026-06-05 09:43:45 +08:00
wangjianyu3
df01c3cbfc system/nxinit: Handle trailing file '\0'
When ETC_ROMFS is disabled to reduce the bin size, we can provide the init.rc
file via a pseudo-file in the boards/vendor directory. For example:
  - CONFIG_ETC_ROMFS=n
  - CONFIG_PSEUDOFS_FILE=y
  - CONFIG_DISABLE_PSEUDOFS_OPERATIONS=n
  ```C
  FAR const char *init_rc =
    "on init\n"
    "    start console\n";
    "service console sh\n"
    "    restart_period 100\n";

  int fd = open("/etc/init.d/init.rc", O_WRONLY | O_CREAT);
  /* ... */
  ssize_t n = write(fd, init_rc, strlen(init_rc) + 1);
  /* ... */
  close(fd);
  ```

The last character '\0' in the file content will be treated as a new line,
and the number of parsed parameters will be zero (abnormal, there should be
at least one keyword).

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2026-06-05 09:43:45 +08:00
hanzj
e86c0b997d system/nxinit: skip empty lines in init.rc parser
Empty lines in init.rc caused parsing to fail with -EINVAL because init_parse_arguments() returns 0 for empty strings, triggering the 'argc < 1' error path in init_action_parse() and accessing uninitialized argv[0] in init_service_parse().

Fix by skipping empty lines and lines containing only whitespace before attempting to match section keywords or calling parser callbacks.

Fixes apache/nuttx-apps#3513

Signed-off-by: hanzj <hanzhijian@zepp.com>
2026-06-04 13:11:09 -03:00
Shoji Tokunaga
840c2f30db apps/rust: Add dependencies for Rust cargo in make builds
Add a Rust make helper that collects crate input files, and use it for
the Rust hello and slint examples.

This makes the generated Rust static libraries depend on the crate
sources, manifests, build scripts. Hook the libraries into both context
and all, so re-running make after editing Rust inputs rebuilds the crate.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-04 08:58:07 -03:00
Arjav Patel
c106a02b58 examples/microros_sub: Add minimal Int32 subscriber example.
Mirror of microros_pub for the receive direction.  Creates a node,
subscribes to /nuttx_sub with std_msgs/Int32, drives an rclc_executor
spin loop, and prints each received value.  Exercises the new
rclc_executor + subscription callback path on top of the
microros_transport library shipped in apps/system/microros.

Validates the NuttX-native transport in the agent->client direction
end-to-end against a micro-ROS agent + ros2 topic pub on the host.

Signed-off-by: Arjav Patel <arjav1528@gmail.com>
2026-06-04 14:30:34 +08:00
cuiziwei
97802bd9e0 testing/libc/popen: add popen/dpopen test for shell and no-shell modes
Add tests for popen()/pclose() and dpopen()/dpclose() that work in
both shell (NSH) and no-shell (direct posix_spawnp) modes.  The test
binary doubles as its own target via the --echo sub-command.

Tests:
 1-4: popen  - basic read, multi-arg, pclose, invalid mode
 5-7: dpopen - basic read, multi-arg, dpclose

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-06-02 23:35:28 +08:00
cuiziwei
740fda9630 system/popen: support no-shell mode via posix_spawnp
When NSH_LIBRARY is not available, dpopen()/popen() can still execute
commands by splitting the command string by whitespace and calling
posix_spawnp() directly.  Shell syntax (pipes, redirects, globbing)
is not supported in this mode.

Add CONFIG_SYSTEM_POPEN_MAXARGUMENTS (default 7) to control the
argv array size for the no-shell path.

Remove the hard dependency on NSH_LIBRARY from SYSTEM_POPEN so the
feature can be used in minimal configurations without a shell.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-06-02 23:35:28 +08:00
cuiziwei
0d35e2e0bb system/popen: add dpopen/dpclose fd-based interface
Add dpopen()/dpclose() as the descriptor-based counterpart of
popen()/pclose(), analogous to how dprintf() relates to fprintf().
dpopen() returns a raw file descriptor instead of a FILE stream,
avoiding the stdio.h dependency for callers that only need an fd.

Refactor popen() as a thin wrapper: dpopen() + fdopen() + FILE
container.  All pipe creation and process spawning logic now lives
in dpopen.c.

Also remove the hard dependency on NSH_LIBRARY from SYSTEM_POPEN.
When NSH is available, commands are executed through sh -c with full
shell syntax support.  When NSH is not available, commands are split
by whitespace and executed directly via posix_spawnp().

Add CONFIG_SYSTEM_POPEN_MAXARGUMENTS (default 7) to control the
argv array size for the no-shell path.

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
2026-06-02 23:35:28 +08:00