Commit graph

62161 commits

Author SHA1 Message Date
Felipe Moura
71dfc30922 Documentation/examples/rng90: add RNG90 application documentation
Document configuration, usage, Kconfig enable path, and hardware validation for the RNG90 example.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-03 17:23:22 +08:00
Felipe Moura
3d059ad1d5 drivers/crypto: add Microchip RNG90 driver
Add Microchip RNG90 TRNG driver with board integration for esp32c3 and rng90 defconfig support.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-08-03 17:23:22 +08:00
hanzhijian
00968f1861 drivers/contactless: fix uninitialized uid leak in mfrc522_read
Fix security issue where uninitialized kernel stack contents could be
leaked to userspace when mfrc522_picc_select() fails.

In mfrc522_read(), the local variable 'uid' was not initialized before
being passed to mfrc522_picc_select(). If the function fails (e.g., due
to bad data on the SPI bus), the uninitialized uid.sak value could pass
the PICC_TYPE_NOT_COMPLETE check, causing snprintf() to copy
uninitialized kernel stack data to the userspace buffer.

Fixes #19417

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Author: hanzhijian <hanzhijian@zepp.com>
2026-08-03 17:23:16 +08:00
hanzhijian
1aefe1c486 Documentation: describe drivertest coverage
Explain how drivertest applications are selected and run, list the current test categories, and document the watchdog reset and notifier test behavior.

Assisted-by: OpenAI Codex
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
2026-08-03 17:22:37 +08:00
hanzhijian
68bac99057 drivers/watchdog: fix capture automonitor notifier context
Provide per-instance capture automonitor lookup for watchdog lower halves
that pass callback context, and avoid selecting an unrelated watchdog when
legacy lower halves provide no context. Update STM32 WWDG lower halves to pass
their instance context so multiple watchdog devices remain distinguishable.

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Assisted-by: OpenAI Codex
2026-08-03 17:22:37 +08:00
Jacob Dahl
08961fae95 fix(net/igmp): restore General Query handling broken by pointer compare
The group address in the IGMP header is declared as uint16_t grpaddr[2],
so it decays to a pointer.  Comparing it against INADDR_ANY compares the
address of a struct member against 0, which is always false.  The General
Query branch is therefore unreachable and GCC discards it entirely.

Commit 09bb292fa2 ("net/igmp: fix build warning on GCC 12.2.0") replaced
the original

    if (igmp->grpaddr == 0)

with

    if (net_ipv4addr_cmp(igmp->grpaddr, INADDR_ANY) != 0)

but net_ipv4addr_cmp(a, b) expands to (a == b) and INADDR_ANY expands to
((in_addr_t)0), so the emitted comparison is unchanged.  The -Waddress
diagnostic disappeared only because the comparison now originates inside
a macro expanded from a header included via -isystem, and GCC suppresses
warnings from system-header macros.  The defect was hidden, not fixed.

That commit also rewrote the unicast query test from group->grpaddr != 0,
which was well-formed, into the same pointer comparison, making it
unconditionally true.

Convert the header field with net_ip4addr_conv32() once, and compare the
resulting in_addr_t.  The conversion was already being done in the
group-specific branch, so this only hoists it and reuses it.

Impact: a General Query (destination 224.0.0.1, group address 0) is the
periodic query every IGMP querier sends.  It currently falls through to
the group-specific branch, where igmp_grpallocfind() allocates a group
for 0.0.0.0 and schedules a report for it, while joined groups never have
their report timers restarted.  The querier then ages out the membership
and multicast delivery to the device stops.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-08-03 17:22:28 +08:00
raiden00pl
7daaf4f218 boards/arm/stm32{f1,f4}: drop duplicated reset.c/romfs, use common board logic
The board-common stm32_reset.c and stm32_romfs_initialize.c are already
provided by boards/arm/common/stm32. Remove the redundant local copies
from boards

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-03 17:18:53 +08:00
hanzhijian
20072dc5e6 drivers/net/w5500: fix wrong variable and d_private assignment
Fix two latent defects in the W5500 Ethernet driver:

1. NETDEV_RXERRORS() references non-existent variables (line 1351):
   In w5500_receive(), the error path uses &priv->dev but the function
   parameter is named self and the device field is w_dev. This compiles
   only because NETDEV_RXERRORS() expands to nothing without
   CONFIG_NETDEV_STATISTICS; enabling statistics breaks the build.

2. d_private set to the device array instead of the instance (line 2069):
   In w5500_initialize(), d_private was set to g_w5500 (the global array)
   instead of self (the current instance). This is harmless for device 0
   (g_w5500 == &g_w5500[0]) but wrong for any devno > 0 — every callback
   that recovers the driver state via dev->d_private would operate on
   device 0's state.

Fixes #19306

Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Author: hanzhijian <hanzhijian@zepp.com>
2026-08-03 17:17:11 +08:00
yi chen
b7c3b392a9 drivers/spi/ice40: fix operator precedence in final clock cycle count
ice40_endwrite() computes how many dummy SPI bytes to clock out after
the bitstream to finish FPGA configuration with:

    for (size_t i = 0; i < ICE40_SPI_FINAL_CLK_CYCLES + 7 / 8; i++)

`/` binds tighter than `+` in C, so this parses as
ICE40_SPI_FINAL_CLK_CYCLES + (7 / 8) = 160 + 0 = 160, i.e. the "+ 7 / 8"
is a silent no-op. The macro name and the classic `(n + 7) / 8`
ceiling-division idiom (used elsewhere in embedded code to convert a
bit/cycle count into a byte count) make clear the intent was to send
ceil(ICE40_SPI_FINAL_CLK_CYCLES / 8) = 20 bytes (160 SPI clock cycles,
matching the macro name). Instead the unmodified code sends 160 bytes,
i.e. 1280 clock cycles - 8x more than intended.

Fix by parenthesizing the ceiling-division: (ICE40_SPI_FINAL_CLK_CYCLES
+ 7) / 8, which evaluates to 20, restoring the intended 160-clock-cycle
finalization sequence.

Fixes #19367

Assisted-by: Claude Code:claude-sonnet-5
Signed-off-by: yi chen <94xhn1@gmail.com>
2026-08-03 17:17:01 +08:00
liang.huang
d8740d128d fs/procfs: fix incorrect environ read for another task under CONFIG_ARCH_ADDRENV
Reading /proc/<pid>/group/env for another task dereferenced tg_envp
under the caller's own address environment instead of the target
task's, since tg_envp lives in the target's user heap. Switch to the
target's address environment around the traversal, and to the
caller's own environment only around the copy into the caller's
buffer.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-08-03 17:16:54 +08:00
yi chen
db90bd8c4b drivers/serial: hold xmit.lock around echo in uart_readv()
uart_putxmitchar() manipulates dev->xmit.head/buffer directly with
no internal locking - every other caller (uart_write()) takes
dev->xmit.lock first. uart_readv()'s ECHO handling (both the
backspace/delete erase sequence and the normal character echo)
calls uart_putxmitchar() without taking that lock, so a concurrent
uart_write() and a local echo can race on the same circular buffer
state, corrupting it.

Take dev->xmit.lock around each echo's uart_putxmitchar() calls,
matching what uart_write() already does. uart_readv() holds
dev->recv.lock for its own duration, but no other code path ever
acquires recv.lock while holding xmit.lock, so nesting xmit.lock
inside the existing recv.lock scope here doesn't introduce a new
lock-ordering cycle.

Fixes #14845

Signed-off-by: yi chen <94xhn1@gmail.com>
2026-08-03 17:16:48 +08:00
raiden00pl
47683c99be arch/arm/src/stm32: fix H5 I2C kernel-clock register names
stm32h5/stm32_i2c.c selected the I2C2/3/4 kernel clock with
RCC_CCIPR4_I2CnSEL_PCLKx, but the H5 RCC header names those values
RCC_CCIPR4_I2CnSEL_RCCPCLKx.

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-03 17:16:42 +08:00
Alan Carvalho de Assis
35cd94b1f6 boards/nucleo-f302r8: disable some interfaces to reduce size
This board config is reaching the 64KB Flash limit, so disable some
not used interface to reduce size.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-08-03 17:16:12 +08:00
Alan Carvalho de Assis
9beaee3d48 boards/mps3-an547: Fix error caused by updating nsh Kconfig
After the NSH modification to avoid disabling NSH errors this config
needs to be normalized.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-08-03 17:16:12 +08:00
raiden00pl
d566ce17f5 drivers/i2c: I2C_SLAVE_DRIVER depends on I2C_SLAVE
I2C_SLAVE_DRIVER depends on I2C_SLAVE

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-08-03 17:16:04 +08:00
Alan Carvalho de Assis
96daab367a net/sixlowpan: Fix protosize to 16-bit
There was another small issue on sixlowpan_input.c code, it was
processing protosize and 8-bit instead of 16-bit.

It was working because the max tcp->tcpoffset was 0xf0, so
protosize = ((uint16_t)tcp->tcpoffset >> 4) << 2;
Will be protosize = 15 * 4 = 60 and will fit inside 8-bit.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-08-03 17:15:39 +08:00
Alan Carvalho de Assis
0a6002b714 net/sixlowpan: Check if g_frame_hdrlen + IPv6_HDRLEN <= iob->io_len
This commit checks if the incoming 6LoWPAN frame header len + the
IPv6_HDRLEN will fit inside the b->io_len.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-08-03 17:15:39 +08:00
hanzhijian
273c77128b fix: remove cross-reference to ip6tables doc not yet in tree 2026-07-16 09:06:26 +02:00
hanzhijian
c3ef6c6fef fix: replace :kconfig:option: with plain backticks for Sphinx compatibility 2026-07-16 09:06:26 +02:00
hanzhijian
940b3d457c 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-07-16 09:06:26 +02:00
hanzhijian
2874b429f3 fix: remove extra backtick in See Also doc reference 2026-07-13 16:43:42 +08:00
hanzhijian
47be50d5fc fix: replace :kconfig:option: with plain backticks for Sphinx compatibility 2026-07-13 16:43:42 +08:00
hanzhijian
8f7a612ab4 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-07-13 16:43:42 +08:00
Abhishek Mishra
f5291a8df1 !boards: enforce secure ROMFS passwd and TEA key setup
Remove implicit default credentials and add build-time validation.
Add check_passwd_keys.sh and gen_passwd_keys.sh; run key setup via
passwd_keys.mk before config.h is generated. Mirror the same logic in
cmake/nuttx_add_romfs.cmake for CMake builds.

BREAKING CHANGE: Builds with CONFIG_BOARD_ETC_ROMFS_PASSWD_ENABLE=y now
require an explicit admin password and non-default TEA keys. The
Kconfig default password "Administrator" and default TEA keys are no
longer accepted. Fix: run make menuconfig, set Admin password under
Board Selection -> Auto-generate /etc/passwd, enable random TEA keys or
set CONFIG_FSUTILS_PASSWD_KEY1..4 manually, and use NSH login with
Encrypted password file verification.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-06 12:04:07 -03:00
Old-Ding
8c8fc40c61 drivers: wireless: bound GS2200M sscanf fields
GS2200M response parsing copies device-provided text fields into fixed-size local buffers.

Add field widths to the sscanf string conversions so the parsed address, port, and command fields stay within their destination arrays.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 19:57:58 +08:00
Old-Ding
1354a57ad9 fs/partition: bound TXTABLE partition names
Limit the parsed TXTABLE name field to NAME_MAX and reject entries that do not provide all three required fields. This avoids writing past struct partition_s.name when a text partition table contains an overlong name.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 19:57:26 +08:00
aineoae86-sys
08240daf61 drivers: leds: Fix LP503X bank mode LED bounds
PWMIOC_ENABLE_LED_BANK_MODE uses the provided LED number to index the LP503X led_mode array. Reject values outside the RGB LED range before writing that array.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-06 19:57:17 +08:00
Matteo Golin
7ea7d29bfa drivers/audio/i2s: Fix unsigned integers in function signatures
All I2S driver operation functions say in their signature description
that negative errno values are returned on failure. However, some of
these same functions had `uint32_t` return types. This would result in
incorrect comparison of the return value against signed error code
values.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-06 19:57:13 +08:00
Old-Ding
3c05de7273 drivers: pci: Fix EPF debug assertions
pci_epf_device_register() and pci_epf_unregister_driver() used || in DEBUGASSERT expressions that validate a pointer and a required field or callback. If the pointer is NULL, the right-hand side dereferences it; if the pointer is valid but the required member is NULL, the assertion passes.

Require both conditions in each assertion so the debug checks match the preconditions used later in the functions.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 19:56:58 +08:00
Old-Ding
6989e89ede drivers/usbdev: rndis: Reject truncated responses
When several RNDIS responses are queued, the control request handler sends one complete response if the host wLength is smaller than the whole queue. If the first queued response is also larger than wLength, copying hdr->msglen bytes would overrun the requested transfer and the completion path would consume a partial message.

Return EMSGSIZE before copying in that case so the queued response remains intact for a retry with a large enough wLength.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 19:56:11 +08:00
Old-Ding
1d7d5d3f13 drivers: pci: Fix EPC MSI IRQ map validation
pci_epc_map_msi_irq() used && when checking the EPC pointer and map_msi_irq callback. If epc is NULL, the right-hand side dereferences it; if the callback is NULL on a valid EPC, the guard does not reject it before the call.

Match the surrounding EPC wrappers by rejecting a NULL EPC, an out-of-range function number, or a missing map_msi_irq callback before taking the lock and invoking the operation.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 19:56:02 +08:00
Old-Ding
9508e96f7a libc/stream: Check lowout bounds before access
Check the provided length before reading the current lowoutstream byte. This avoids reading past zero-length or fully consumed buffers before the loop condition stops.

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 19:55:11 +08:00
aineoae86-sys
bc764dc9bd drivers: 1wire: Fix DS2XXX device type bounds
EEPROM_DS_COUNT is the number of supported DS2XXX device types and is used as the size of the EEPROM geometry tables. Reject it before storing the device type for later table indexing.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-06 19:55:05 +08:00
Old-Ding
a2b8d15041 arch/arm: nrf91: bound modem version parsing
Limit modem version tokens parsed from AT command responses to the LTE version field sizes. Also require both HWVERSION fields before copying them so a partial parse does not read an uninitialized temporary buffer.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-07-06 16:35:28 +08:00
aineoae86-sys
9888b7cd3b arch/arm: xmc4: fix VADC index bounds checks
The XMC_VADC_* constants describe counts, so the valid register, group, and channel indexes are below those values. The current checks allow the count itself through and then use it to index VADC group, channel, and result registers.

Reject those boundary values before the register array access.

Generated-by: OpenAI Codex
Signed-off-by: aineoae86-sys <ai.neo.ae86@gmail.com>
2026-07-06 16:35:18 +08:00
Alan Carvalho de Assis
1aeb7a12f7 boards/imx93-evk: Fix bootloader board config
After enabling the nsh error Kconfig we need to fix configs that were
enabling it manually.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
2026-07-06 16:35:02 +08:00
Alin Jerpelea
74f820679d boards/risc-v/bl602: remove timers example
the timers example causes the following error:
iscv-none-elf-ld: /github/workspace/sources/nuttx/staging/libapps.a(timer_main.c.github.workspace.sources.apps.examples.timer_1.o): in function timer_main:
/github/workspace/sources/apps/examples/timer/timer_main.c:209:(.text.timer_main+0x1c2): undefined reference to sigaction
riscv-none-elf-ld: /github/workspace/sources/apps/examples/timer/timer_main.c:278:(.text.timer_main+0x30e): undefined reference to sigaction

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-07-04 17:21:39 -03:00
Alin Jerpelea
6cb2cc7ddb boards/risv-v/bl602: disable CONFIG_ENABLE_ALL_SIGNALS=y
If this configuration is enabled it will cause the build error

riscv-none-elf-ld: /github/workspace/sources/nuttx/nuttx section .text will not fit in region ilm
riscv-none-elf-ld: region ilm overflowed by 976 bytes

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2026-07-04 17:21:39 -03:00
Jukka Laitinen
3498bf1a5a 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-07-04 13:29:32 -04:00
Jukka Laitinen
ac0138c40f 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-07-04 13:29:32 -04:00
Jukka Laitinen
3e49b065ef 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-07-04 13:29:32 -04:00
raiden00pl
0685d8b5d1 !arch/stm32: unify and commonize stm32_uid for all STM32 families.
Replace the per-family stm32_get_uniqueid() implementations and the two
IP-versioned common variants with a single generic byte-array reader,
arch/arm/src/common/stm32/stm32_uid.c.

BREAKING CHANGE for STM32 M0 families: stm32_get_uniqueid() now always
takes a uint8_t[12] buffer.
Out-of-tree Cortex-M0 code that used the previous prototype
"void stm32_get_uniqueid(uint32_t *uid)" must change its buffer to
"uint8_t uniqueid[12]".

Signed-off-by: raiden00pl <raiden00@railab.me>
2026-07-05 01:13:16 +08:00
Tiago Medicci Serrano
fd3889ceaa arch/[risc-v|xtensa]: update Espressif's common source code
This commit updates Espressif's common source code to ensure that
critical sections are properly handled by the common source code.

Signed-off-by: Tiago Medicci Serrano <tiago.medicci@espressif.com>
2026-07-04 02:00:32 +08:00
Eren Terzioglu
958169e1ec Docs/platforms/esp32[-c6|-h2]: Add BLE docs for esp32[-c6|-h2]
Add BLE docs for esp32c6 and esp32h2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-07-04 02:00:32 +08:00
Eren Terzioglu
3b064eac94 boards/risc-v/espressif: Add BLE board support for esp32[-c6|-h2]
Add BLE board support for esp32c6 and esp32h2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-07-04 02:00:32 +08:00
Eren Terzioglu
0526f1b0e9 arch/risc-v/espressif: Add BLE support for esp32[-c6|-h2]
Add BLE support for esp32c6 and esp32h2

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-07-04 02:00:32 +08:00
Ilikara
071a358f77 drivers: Fix comment typos — 'Pubic' → 'Public' across drivers and headers.
Fix spelling error in section header comments:
  'Pubic Function Prototypes' → 'Public Function Prototypes'
  'Pubic Functions' → 'Public Functions'

Affected files (12 files, 12 occurrences):
  arch/arm/src/at32/at32_tim.c
  arch/arm/src/common/stm32/stm32_tim_m3m4_v1v2v3.c
  arch/arm/src/stm32l4/stm32l4_tim.c
  arch/arm/src/stm32l5/stm32l5_tim.c
  arch/arm/src/stm32u5/stm32_tim.c
  arch/arm/src/stm32wb/stm32wb_tim.c
  arch/arm/src/stm32wl5/stm32wl5_tim.c
  arch/mips/src/pic32mz/pic32mz_timer.c
  arch/sparc/src/bm3803/bm3803_tim.c
  arch/sparc/src/s698pm/s698pm_tim.c
  drivers/video/vnc/vnc_server.c
  include/nuttx/wdog.h

These are all comment-only changes with no functional impact.

Signed-off-by: Ilikara <3435193369@qq.com>
2026-07-04 02:00:24 +08:00
Chengdong Wang
fa534b75b7 arch/riscv: Add CONFIG_ARCH_RV_ISA_ZICSR_ZIFENCEI for fence.i
The fence.i instruction is only available when the Zifencei extension
(CONFIG_ARCH_RV_ISA_ZICSR_ZIFENCEI) is supported by the hardware.

This commit adds a macro wrapper around fence.i usages to prevent
compilation errors on toolchains or targets where the Zifencei
extension is absent.

Signed-off-by: Chengdong Wang <wangcd91@gmail.com>
2026-07-04 02:00:04 +08:00
Matteo Golin
f725c1932c docs/sim: Include documentation about NXDoom configuration
Include docs about new NXDoom configurations for playing NXDoom.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-04 01:59:40 +08:00
Matteo Golin
f180a40157 boards/sim: Configuration for NXDoom on simulator
Includes a defconfig to play NXDoom on the simulator. Keyboard input is
available through X11, as well as graphics rendering. The `/data` folder
is used as the default home for game files.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-04 01:59:40 +08:00