Commit graph

62026 commits

Author SHA1 Message Date
yushuailong
1a3185beeb arch/risc-v/esp32c3-legacy: Fix non-atomic clock read in up_rtc_rdalarm.
up_rtc_rdalarm() computed tv_sec and tv_nsec from two separate
evaluations of rt_timer_time_us() + offset + deadline. The RT timer
advances between the two calls, so a read that straddles a second
boundary yields an inconsistent timespec.

Compute the microsecond value once into a local variable and derive
both fields from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
yushuailong
1d08a9d019 arch/risc-v/espressif: Fix non-atomic clock read in esp_rtc_rdalarm.
esp_rtc_rdalarm() computed tv_sec and tv_nsec from two separate
evaluations of esp_hr_timer_time_us() + offset + deadline. The
high-resolution timer advances between the two calls, so a read that
straddles a second boundary yields an inconsistent timespec.

Compute the microsecond value once into a local variable and derive
both fields from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
yushuailong
c11029848e arch/xtensa/espressif: Fix non-atomic clock read in esp_rtc_rdalarm.
esp_rtc_rdalarm() computed tv_sec and tv_nsec from two separate
evaluations of esp_hr_timer_time_us() + offset + deadline. The
high-resolution timer advances between the two calls, so a read that
straddles a second boundary yields an inconsistent timespec.

Compute the microsecond value once into a local variable and derive
both fields from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
yushuailong
5de32920f7 drivers/timers: Fix non-atomic clock read in up_timer_gettime.
up_timer_gettime() computed tv_sec and tv_nsec from two separate calls
to current_usec(), which returns a free-running microsecond counter.
The counter advances between the two calls, so a read that straddles a
second boundary yields an inconsistent (possibly backwards) timespec.

Read current_usec() once into a local variable and derive both fields
from that single snapshot.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-11 02:59:10 +08:00
hanzhijian
cdf500960f fix: remove cross-reference to ip6tables doc not yet in tree 2026-06-10 08:57:15 -03:00
hanzhijian
77060179dd fix: replace :kconfig:option: with plain backticks for Sphinx compatibility 2026-06-10 08:57:15 -03:00
hanzhijian
ffd09067e4 Documentation/applications/system/iptables: add iptables man page
Add comprehensive documentation for the iptables command including
all supported commands, options, and usage examples.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-10 08:57:15 -03:00
hanzhijian
21157586bc fix: remove extra backtick in See Also doc reference 2026-06-10 08:55:23 -03:00
hanzhijian
a0c9463f01 fix: replace :kconfig:option: with plain backticks for Sphinx compatibility 2026-06-10 08:55:23 -03:00
hanzhijian
d0665a8cff Documentation/applications/system/ip6tables: add ip6tables man page
Add comprehensive documentation for the ip6tables command including
all supported commands, options, and IPv6-specific usage examples.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-06-10 08:55:23 -03:00
raiden00pl
46967df94f !arm/stm32: split legacy STM32 family selectors
BREAKING CHANGE: Convert the legacy STM32 F1/F2/F3/F4/G4/L1 port to the concrete
family selectors while keeping the shared STM32 selector hidden.

Legacy STM32 family selector Kconfig symbols were split by
concrete STM32 sub-family. Out-of-tree defconfigs and code must update
CONFIG_ARCH_CHIP_* selections to the new family-specific selectors.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:51:47 -03:00
raiden00pl
46d2306bf8 !arch/stm32: rename STM32F7/H7 QUADSPI Kconfig symbol to QSPI
BREAKING CHANGE: CONFIG_STM32F7_QUADSPI and CONFIG_STM32H7_QUADSPI are
renamed to CONFIG_STM32F7_QSPI and CONFIG_STM32H7_QSPI. Out-of-tree F7/H7
board configurations must update the symbol name.

Standardize the F7/H7 QSPI enable symbol on the QSPI name (the QUADSPI and
QSPI peripherals are the same IP block). Only the Kconfig enable symbol and
its CONFIG_ references are renamed; the QUADSPI hardware register/pin/DMA
macros are unchanged.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:49:59 -03:00
raiden00pl
84f891b848 drivers/sensors/adxl372_uorb.c: fix compilation error
drivers/sensors/adxl372_uorb.c: fix compilation error

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:49:14 -03:00
raiden00pl
46cc145645 thingy91: initial sensors support
initial sensors support for thingy91

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 08:49:14 -03:00
raiden00pl
8021b5371e sensors/bme680_uorb.c: always allow temperature topic registration
Previously bme680 dont register temperature topic when pressure measurement
was enabled. Temperature data is present in barometer data, but sometimes
we need clear separation between these topics.
The old behavior is still achievable by setting CONFIG_BME680_DISABLE_TEMP_MEAS=y

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-10 09:52:00 +08:00
Jukka Laitinen
64b6bbb0c0 sched/Kconfig: Fix ETC_ROMFS dependency
When using FS_CROMFS for etc, user typically don't need FS_ROMFS,
they are completely separate filesystems. But both ETC_ROMFS and
ETC_CROMFS are needed, the first one selects that the ETC needs
to be mounted from ROM based filesystem, and ETC_CROMFS just specifies
that the backing filesystem is actually the CROMFS.

Iow; make ETC_ROMFS depend on FS_ROMFS || FS_CROMFS, so that the
user can drop FS_ROMFS when only FS_CROMFS is needed.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-10 01:23:08 +08:00
nicolasWDC
794f0c2ce9 include/cxx/ctime: Add localtime to std namespace.
NuttX time.h declares localtime in the global namespace, but the C++
ctime shim does not import it into namespace std.

As a result, valid C++ code using std::localtime fails to compile with
the NuttX C++ headers, even though ::localtime is available.

Add using ::localtime to include/cxx/ctime.

Signed-off-by: nicolasWDC <nicolasWDC@users.noreply.github.com>
2026-06-09 11:33:40 -03:00
raiden00pl
0a9cb6538c boards/arm/stm32f4/stm32f401rc-rs485: fix compilation
fix compilation error

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-09 11:33:02 -03:00
raiden00pl
165e7cb1ab arch/arm/stm32f3/stm32f33xxx_pinmap.h: fix compilation
fix compilation error

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-09 11:33:02 -03:00
raiden00pl
2c606a7b41 !sensors/bme680: allow sensor configuration during registration
BREAKING CHANGE: bme680_register() takes an additional "*config" argument.
When config is NULL - driver behavior is the same as before.

With this change bme680 can be configured during registration in board logic.
This way we don't have to callibrate sensor from user-space but sensor is ready
to use after registration.

This change makes the registration the same as for bme688, which is a similar
sensor.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-09 11:00:25 -03:00
Jukka Laitinen
f3e62b837b Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK
Add documentation for controlling the crash dump verbosity.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-09 08:04:54 -04:00
Jukka Laitinen
40bbf67bd3 sched/misc/assert: Add CONFIG_SCHED_DUMP_TASKS and CONFIG_SCHED_DUMP_STACK
Add more refined options for sched/misc/assert to control how verbose
crash dumps are printed out:

- SCHED_DUMP_TASKS
- SCHED_DUMP_STACK

These default to y unless DEFAULT_SMALL is defined. The options can
be undefined to save flash space on a small system.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-09 08:04:54 -04:00
Jukka Laitinen
5844ff5abb sched/misc/assert: Small flash-saving fixes
- Use shared string for "stack pointer out of range" to avoid duplicate in flash
- Re-use already calculated stack_used instead of calling up_check_tcbstack again

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-09 08:04:54 -04:00
nicolasWDC
065da307f5 include/cxx/cmath: Define FLT_EVAL_METHOD from compiler builtin
Some GCC-based external toolchains define **FLT_EVAL_METHOD** but do not
leave the standard FLT_EVAL_METHOD macro visible when the NuttX cmath shim
evaluates its guards.

As a result, C math symbols such as log and pow are declared by NuttX
math.h, but are not imported into namespace std by include/cxx/cmath.

Define FLT_EVAL_METHOD locally from **FLT_EVAL_METHOD** when needed in the
non-CONFIG_LIBM_TOOLCHAIN path.

This fixes compilation of valid C++ code using std::log and std::pow with
arm-none-eabi-g++.

Signed-off-by: nicolasWDC <nicolasWDC@users.noreply.github.com>
2026-06-08 15:31:31 -03:00
Abhishek Mishra
fa7f85632c fs/vfs: enforce pseudoFS permissions on mutation operations
Add pseudoFS permission enforcement for unlink(), mkdir(), and rename() VFS mutation operations.

This change validates parent-directory permissions before modifying pseudoFS inode topology and returns -EACCES for unauthorized operations.

The implementation preserves mountpoint filesystem behavior and fixes multiple inode lifetime/search-state issues in the rename path.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-06-09 01:40:17 +08:00
Shoji Tokunaga
59a66fa17d tools: Enable Rust sim builds on Intel Macs
Add support for building Rust apps on the NuttX simulator running on
Intel (x86_64) macOS.

- Add tools/x86_64-unknown-nuttx-macho.json, a Mach-O Rust target for
  the macOS sim.
- Rust.defs: select the new x86_64 macho target for sim on macOS.
- boards/sim/.../Make.defs: keep the default PIC/PIE-compatible code
  generation on macOS by not adding -fno-pic/-mcmodel=medium.
- sethost.sh: enable CONFIG_HOST_X86_64 for non-arm64 hosts.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-08 21:22:45 +08:00
hanzj
3c8621cb89 Documentation: document sensortest command
Add documentation for the sensortest system tool which reads data
from sensor drivers via the uORB topic interface.

Signed-off-by: hanzj <hanzj@xiaomi.com>
2026-06-08 10:04:48 +02:00
leisiji
8121b88666 cmake/elf: Fix ELF entry point from __start to _start
__start is the kernel boot entry for each chip, while _start (defined
in crt0.c) is the correct C runtime entry point for ELF executables.

Signed-off-by: leisiji <2265215145@qq.com>
2026-06-08 16:03:21 +08:00
leisiji
ace40bfbfc build/fix: remove nonexistent target in cmake
nuttx_apps_mksymtab is nonexistent in nuttx,
which produce error when build with CONFIG_MODULES

Signed-off-by: leisiji <2265215145@qq.com>
2026-06-08 16:03:21 +08:00
leisiji
14e434c3f0 mm/kasan: Fix compile options applied to wrong target in SPLIT build
In SPLIT build mode, nuttx_add_kernel_library(mm SPLIT) creates two
targets: mm (system library) and kmm (kernel library). The compile
options were being applied to the mm target via
target_compile_options(mm ...), but the kasan instrumentation is
compiled as part of the kmm target.

Change target_compile_options(mm ...) to target_compile_options(kmm
...) so that FLAGS (including -fno-builtin and NO_LTO) are correctly
applied to the kernel target where kasan code is compiled.

Signed-off-by: leisiji <2265215145@qq.com>
2026-06-08 16:03:21 +08:00
Jukka Laitinen
9c10bbd04a drivers/mtd: Remove bad block management in FTL for devices not needing it
Bad block management and the logical->physical mapping is only needed
with raw NAND type memories, so we can compile that in conditionally,
saving ~600 bytes of flash on a 32-bit arm when NAND is not used.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-08 10:00:07 +02:00
Matteo Golin
9e9926317d drivers/contactless/pn532: Fix potential overflow
Fixes a potential overflow where more than 16 bytes are written to the
cmd_buffer.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-06-08 14:05:29 +08:00
hanzj
7922011b72 Documentation: document tcpdump command.
Add documentation for the tcpdump system command, covering
command-line options (-i, -w, -s), Kconfig configuration,
usage examples, and notes on pcap output format compatibility.

Signed-off-by: hanzj <hanzjian@zepp.com>
2026-06-07 22:55:03 +08:00
Martin Vajnar
41381edb31 video/fb: Handle case of multiple displays where some do not require update
It can happen that multiple display configuration is used in which some
displays require explicit update while others do not.

If the updatearea() is NULL, simply skip the update instead of erroring out.

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
2026-06-07 10:01:05 -03:00
hanzj
80f133504a boards/sim/sim/sim/nsh: enable CONFIG_RTC so date command shows host time
The default sim:nsh config has no RTC, causing NSH_DISABLE_DATE to be
auto-enabled (default: DEFAULT_SMALL || !RTC). This means the date
command is not compiled in, and the system time defaults to a hardcoded
value instead of syncing with the host.

Enable CONFIG_RTC, CONFIG_RTC_DRIVER, and CONFIG_RTC_ARCH in the
sim:nsh defconfig so the date command is available and shows the
correct host time out of the box.

Signed-off-by: hanzj <hanzjian@zepp.com>
2026-06-06 15:08:15 -03:00
Martin Vajnar
155805c2e6 video/fb: Trigger updatearea() if CONFIG_FB_UPDATE is defined
When CONFIG_FB_UPDATE is defined the missing updatearea() trigger caused
the splashscreen to not be displayed.

Signed-off-by: Martin Vajnar <martin.vajnar@gmail.com>
2026-06-06 15:54:51 +08:00
raiden00pl
af371bbaa5 arch/nrf91: add more ioctl calls for modem socket
add support for these ioctl:

- LTE_CMDID_RADIOON
- LTE_CMDID_RADIOOFF
- LTE_CMDID_ACTPDN

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-06 15:54:16 +08:00
raiden00pl
2cb1511602 arch/nrf91: fix broken modem initialization
fix broken modem initialization for nrf91

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-06-06 15:53:50 +08:00
shichunma
207fa5b0e2 include/nuttx/semaphore.h: parenthesize NXSEM helper args
Wrap the NXSEM_COUNT() and NXSEM_MHOLDER() macro arguments in an extra pair of parentheses before member access.

This makes the helpers safer for complex expressions passed as the macro argument and aligns them with common macro style.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
2026-06-05 10:35:46 -04:00
Shoji Tokunaga
e4fe1134bf arch/sim: Add dependencies for Rust cargo in make builds
Add `EXTRA_LIB_DEPS` to the simulator nuttx target prerequisites.

This lets Make notice when an extra application library, such as a Rust
static library rebuilt by Cargo, has changed and ensures the final
simulator binary is relinked.

Signed-off-by: Shoji Tokunaga <toku@mac.com>
2026-06-05 09:44:09 +08:00
dependabot[bot]
f8aa477b7a build(deps): bump starlette from 0.52.1 to 1.0.1 in /Documentation
Bumps [starlette](https://github.com/Kludex/starlette) from 0.52.1 to 1.0.1.
- [Release notes](https://github.com/Kludex/starlette/releases)
- [Changelog](https://github.com/Kludex/starlette/blob/main/docs/release-notes.md)
- [Commits](https://github.com/Kludex/starlette/compare/0.52.1...1.0.1)

---
updated-dependencies:
- dependency-name: starlette
  dependency-version: 1.0.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-04 17:01:57 -04:00
lccosy
b07c61e0cd arch/arm/gd32f4: fix NULL pointer dereference in arm_earlyserialinit.
Add NULL check for g_uart_devs[i] before accessing ->priv in
arm_earlyserialinit() loop. When a USART is not enabled in defconfig,
g_uart_devs[i] is NULL, causing a HardFault crash during early boot.

The bug occurs because the original code only checked g_uart_devs[i]->priv
without first verifying g_uart_devs[i] is not NULL. On Cortex-M4, NULL
pointer dereference reads from Flash vector table (0x00000000 maps to
0x08000000), returning a function pointer that causes BusFault when
written to.

This fix matches the existing NULL check pattern used in arm_serialinit()
at line 2835 of the same file.

Tested on mplant-gd32f450 board with only USART5 enabled in defconfig.
Before fix: HardFault at boot (IPSR=3, PC=0x080003e0)
After fix: System boots normally to NSH Shell

Signed-off-by: lccosy <1191294205@qq.com>
2026-06-04 17:00:27 -04:00
rongyichang
47e3f5013f drivers/video: add HWCURSOR related config
There is no HWCURSOR config in Kconfig, but a lot of code
use it, we need to add it back.

Signed-off-by: rongyichang <rongyichang@xiaomi.com>
2026-06-05 00:01:09 +08:00
shichunma
811eb22d58 drivers/mmcsd/mmcsd_sdio.c: guard SDIO_REGISTERCALLBACK use
SDIO_REGISTERCALLBACK is only defined when both CONFIG_SCHED_WORKQUEUE and CONFIG_SCHED_HPWORK are enabled.
Guard the callback registration call in mmcsd_sdio.c so the source matches the SDIO callback API availability and avoids
build issues when HPWORK support is not configured.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
2026-06-04 09:31:56 -03:00
shichunma
0afb8c7ad5 cmake/nuttx_toolchain.cmake: track preprocessed include deps
Make preprocess-generated outputs depend on included files by
emitting depfiles for GNU/Clang Ninja/Makefile builds.

This fixes stale generated rc.sysinit and ROMFS images when a
board-specific included fragment such as rc.sysinit.ap changes,
because the previous custom command only depended on the top-level
source file.

Signed-off-by: Jerry Ma <shichunma@bestechnic.com>
2026-06-04 17:22:43 +08:00
Jukka Laitinen
116a325763 libs/libc/time: Add configuration options for the strftime
This adds 3 configuration options for the lib_strftime, which can be
used to save flash memory when all the formatters are not needed by an
embedded application.

There is always a minimal set of formatters supported:
"%a, %b/%h, %d, %H, %m, %M, %S, %Y, %%". To add on top of that one can
specify:

- LIBC_STRFTIME_C_STANDARD_FORMATS  : All ISO-C conversion specifiers
- LIBC_STRFTIME_POSIX_FORMATS       : Additional posix formats
- LIBC_STRFTIME_NONSTANDARD_FORMATS : Additional GNU nonstandard formats

All of these are enabled by default unless building for CONFIG_DEFAULT_SMALL.
Disabling these options can save over 3KB of flash on an 32-bit
ARM system, when all the format specifiers are not needed.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-04 14:29:33 +08:00
taikoyaP
75a12b1258 Documentation/components/boards.rst: fix typo
fix a small typo in boards file
2026-06-04 09:58:42 +08:00
Lingao Meng
2a6059a206 arch/sim: walk frame-pointer chain for non-running tasks in up_backtrace
The previous up_backtrace() relied entirely on host_backtrace() (a thin
wrapper around glibc's backtrace()), which can only unwind the host
thread that calls it.  As a result, when assert / dump_tasks() walked the
task list and called sched_dumpstack() for every task, every task other
than the currently-running one returned a zero-length backtrace, and the
output was silently dropped.  In practice this meant that on sim only
the crashing task ever produced a usable trace.

Fix this by walking the frame-pointer chain ourselves whenever the
target tcb is not the running task.  Because sim's setjmp/longjmp is
provided by NuttX itself (libs/libc/machine/sim/arch_setjmp_*.S) and not
by host libc, the rbp/rsp/rip (or arm fp/sp/pc) saved in tcb->xcp.regs
are plain unmangled pointers, identical across Linux, macOS and Windows
hosts.  The frame layout ([fp]=prev fp, [fp+1]=return address) is also
shared by every host ABI sim supports (x86, x86_64, ARM, ARM64).

The walker validates that fp lies inside the task's stack and is
properly aligned, and stops when fp[0] is NULL, so a corrupted stack
cannot make us read out of bounds.  The running-task path is unchanged
and still uses host_backtrace() so DWARF unwinding through host
libraries continues to work.

Requires CONFIG_FRAME_POINTER=y so the compiler emits a usable fp link.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-06-04 09:54:08 +08:00
Serg Podtynnyi
b8cd0435b2 ci/docker: bump risc-v toolchain gcc14
Revert to latest gcc144 due libcxx incompability

Signed-off-by: Serg Podtynnyi <serg@podtynnyi.com>
2026-06-04 08:25:40 +08:00
Lup Yuen Lee
eec015a66e drivers/segger: Download systemview from NuttX Mirror Repo
CI Builds for `stm32f429i-disco:systemview` and `nucleo-f446re:systemview` are failing, because www.segger.com is blocking our downloads for systemview. This PR updates the Segger Makefiles to download systemview from our Cached Dependency at NuttX Mirror Repo: https://github.com/NuttX/nuttx/releases/download/systemview/SystemView_Src_V356.zip

```
Configuration/Tool: nucleo-f446re/systemview,CONFIG_ARM_TOOLCHAIN_CLANG
CMake Error at /github/workspace/sources/nuttx/build/_deps/systemview-subbuild/systemview-populate-prefix/src/systemview-populate-stamp/download-systemview-populate.cmake:170 (message):
    error: downloading 'https://www.segger.com/downloads/systemview/SystemView_Src_V356.zip' failed
          status_code: 22
          status_string: "HTTP response code said error"
```

https://github.com/apache/nuttx-apps/actions/runs/26855455932/job/79197351538#step:10:1547

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-06-03 19:19:24 +08:00