Commit graph

62563 commits

Author SHA1 Message Date
Lingao Meng
b5d3d30378 netdb: Add http and https service entries
getaddrinfo() and getservbyname() use the built-in service table when
resolving service names. The table only contained ntp, so common
service names such as http and https could not be resolved without a
numeric port.

Add http and https entries for both TCP and UDP to match the existing
service table style.

Testing:

  - Host: Ubuntu 22.04 x86_64.

  - Board/config: sim:nsh with CONFIG_LIBC_NETDB=y and
    CONFIG_EXAMPLES_HELLO=y.

  - make clean && make -j16.

  - Ran a temporary hello example that called getservbyname("http",
    "tcp") and getservbyname("https", "tcp"). The app verified ports
    80 and 443 and printed "getservbyname http/https test passed".

Assisted-by: Claude:Claude-Fable-5
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-07-23 15:34:02 +08:00
Lingao Meng
18c462ff20 fs/hostfs: Handle POSIX byte-range locks
fcntl(F_GETLK/F_SETLK/F_SETLKW) is handled by VFS and reaches file
systems as private FIOC_* ioctl commands. hostfs previously forwarded
those private ioctl command numbers to the host ioctl backend, which is
not the POSIX file-locking interface and cannot be interpreted by the
host OS.

Keep hostfs on the generic host_ioctl() path and define the FIOC_* lock
command values in the hostfs host ABI. The POSIX sim backend recognizes
those commands in host_ioctl() and translates struct flock fields to the
host ABI before calling host fcntl(). Other hostfs backends keep their
existing unsupported-host-ioctl behavior.

F_SETLKW is implemented in the POSIX sim backend by retrying
non-blocking host F_SETLK with a short sleep. This preserves the
blocking NuttX API without forwarding host F_SETLKW directly.

Testing:

  - Host: Ubuntu 22.04 x86_64.

  - Board/config: sim:nsh with CONFIG_FS_HOSTFS=y,
    CONFIG_SIM_HOSTFS=y and CONFIG_EXAMPLES_SIM_POSIX=y.

  - make -j16.

  - Ran examples/sim_posix from nuttx-apps. The test mounted a long
    /tmp hostfs path, opened a host-backed file, and verified
    fcntl(F_SETLK), fcntl(F_GETLK), fcntl(F_SETLKW), and unlocking with
    F_UNLCK. The app printed "sim_posix: hostfs locks ok" and
    "sim_posix: PASS".

Assisted-by: Claude:Claude-Fable-5
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-07-23 15:34:02 +08:00
Lingao Meng
3d20844903 arch/sim: Add AF_LOCAL support to host usrsock
The sim host usrsock backend only accepted INET/NETLINK domains and
translated socket addresses through plain struct sockaddr. That prevents
simulated applications from using POSIX AF_LOCAL sockets through the
standard socket API when CONFIG_NET_USRSOCK is used.

Add AF_LOCAL address conversion for struct sockaddr_un, allow PF_LOCAL
sockets through usrsock, handle NuttX socket type flags, and poll host
descriptors from the sim usrsock work item so nonblocking
connect/read/write readiness is reported back to NuttX. Use
sockaddr_storage for native address translation so larger address
structures are not truncated.

Testing:

  - Host: Ubuntu 22.04 x86_64.

  - Board/config: sim:nsh with CONFIG_NET_USRSOCK=y and
    CONFIG_EXAMPLES_HELLO=y.

  - make clean && make -j16.

  - Ran a temporary hello example that connected to host AF_UNIX
    SOCK_STREAM and SOCK_SEQPACKET sockets through NuttX socket(),
    connect(), write(), and read(). Both received pong and printed
    "AF_LOCAL usrsock test passed".

Assisted-by: Claude:Claude-Fable-5
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-07-23 15:34:02 +08:00
DuoYuWang
e84259cbcc drivers/mmcsd: fix eMMC bus width switch sequencing
Two sequencing problems in the MMC wide bus path break eMMC 4-bit
operation on hosts that program the bus width in the SDIO widebus /
clock callbacks (e.g. STM32H7):

1. The SWITCH command (CMD6) is issued before the host has switched
   to wide bus operation.  When the card completes the switch while
   the host is still in 1-bit mode the switch never takes effect and
   every following data transfer times out.  Switch the host to wide
   bus operation before issuing CMD6.

2. The transfer clock is selected only at the end of mmcsd_widebus(),
   so the whole switch sequence runs at ID-mode clock and, on the
   affected hosts, the final clock update does not take effect either,
   leaving the bus at ~400 kHz.  Select the MMC transfer clock before
   calling mmcsd_widebus(), and pick CLOCK_MMC_TRANSFER_4BIT when wide
   bus operation is active (mirroring the SD card path) so a later
   clock selection cannot revert the host to 1-bit.

No behavior change for SD cards, and no change on hosts whose widebus
callback only records the requested state.

Tested on a custom STM32H743 board with eMMC: sd_bench sequential
write ~4.1 MB/s, sequential read ~6.3 MB/s (previously all data
transfers timed out).

Signed-off-by: DuoYuWang <thirteenking.wang@gmail.com>
2026-07-23 15:26:05 +08:00
Lingao Meng
6bd674b4e4 fs/hostfs: Return ENOTTY for unsupported ioctl
host_ioctl() reports unsupported ioctl requests from hostfs backends. Use
-ENOTTY for that case instead of -ENOSYS so callers can distinguish an
unsupported ioctl request from a missing host operation.

Keep the other host operation stubs returning -ENOSYS; this change is limited
to ioctl semantics. Update the ARM, ARM64, RISC-V, Xtensa and Windows sim
hostfs stubs to match that behavior.

Testing:

  Host: Ubuntu 22.04 x86_64

  - git diff --check

  - make distclean

  - ./tools/configure.sh -l -a ../nuttx-apps sim:nsh

  - make -j16

  - printf 'help\npoweroff\n' | timeout 20s ./nuttx

  - make distclean

  - ./tools/configure.sh -a ../nuttx-apps sabre-6quad:knsh

  - make -j16

Assisted-by: Claude:Claude-Fable-5
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2026-07-23 08:30:29 +02:00
Alan Carvalho de Assis
375462322e drivers/serial: Modify serial/pty to allow NSH/Telnet line edit
Both the UART and PTY serial drivers previously assumed all
VT100/ANSI escape sequences were fixed 3-byte CSI sequences, causing
longer CSI and SS3 key sequences (such as Home, End, Delete, and
modified keys) to leak stray characters into the terminal when local
echo was enabled. This patch replaces the fixed-length logic with a
state machine that correctly recognizes and suppresses escape
sequences of any length, while preserving the data delivered to
applications. The change only affects local echo behavior, is fully
backward compatible, and has been validated with both interactive NSH
sessions and automated PTY tests.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
Assisted-by: Claude Code
2026-07-22 22:07:18 +08:00
Filipe Cavalcanti
7df7c6ee50 documentation: add Python defconfig to esp32p4-tab5 board
Adds description of Python defconfig for Tab5 board.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-07-22 17:58:01 +08:00
Filipe Cavalcanti
e59fad4403 boards/risc-v/esp32p4-tab5: add support for Python deconfig
Adds support for Python on M5 Stack ESP32-P4 Tab5 board.
This board runs on P4 chip revision v1.3 and needs special changes in linker
script.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-07-22 17:58:01 +08:00
dependabot[bot]
840df9ca91 build(deps): bump pillow from 12.2.0 to 12.3.0 in /tools/pynuttx
Bumps [pillow](https://github.com/python-pillow/Pillow) from 12.2.0 to 12.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/12.2.0...12.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-version: 12.3.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-22 11:35:43 +08:00
Abhishek Mishra
80a15866f6 boards/stm32f746g-disco: add explicit CRYPTO/CODECS deps for dropbear defconfig
nuttx-apps#3557 switches FSUTILS_PASSWD and NETUTILS_DROPBEAR to depend on
CRYPTO, CRYPTO_RANDOM_POOL, NETUTILS_CODECS and CODECS_BASE64 instead of
selecting them. stm32f746g-disco/dropbear must enable these explicitly so
olddefconfig/CI normalize keeps dropbear and FSUTILS_PASSWD enabled.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-21 17:17:46 -04:00
Abhishek Mishra
3a2c6be3cf boards/sim: add explicit CRYPTO deps for dropbear defconfig
nuttx-apps#3557 switches NETUTILS_DROPBEAR to depend on CRYPTO and
CRYPTO_RANDOM_POOL instead of selecting them.  sim/dropbear must enable
CONFIG_CRYPTO and CONFIG_CRYPTO_RANDOM_POOL explicitly so olddefconfig and
CI normalize keep dropbear and FSUTILS_PASSWD enabled.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-21 17:17:46 -04:00
Ansh Rai
d0651aad54 lib/math32: Avoid __uint128_t casts for LDC ImportC
Building the hello_d example with LDC ImportC fails because ImportC
does not correctly handle direct __uint128_t C-style casts such as
(__uint128_t)a and (__uint128_t)1.

Replace the direct casts with equivalent typed temporaries, preserving
the existing behavior while allowing hello_d to build successfully with
LDC ImportC.

Verified on sim:nsh with CONFIG_EXAMPLES_HELLO_D=y:

  nsh> hello_d
  Hello World, [skylake]!
  DHelloWorld.HelloWorld: Hello, World!!

Signed-off-by: Ansh Rai <anshrai331@gmail.com>
2026-07-21 17:11:03 -03:00
Abhishek Mishra
6283d667ea Documentation: PBKDF2 login docs, board Kconfig, and CI password
Document PBKDF2-HMAC-SHA256 ROMFS passwd generation and update board
Kconfig help text accordingly.  Set the documented sim/login CI credential
in GitHub Actions.

Enable CONFIG_CODECS_BASE64 and CONFIG_NETUTILS_CODECS on sim:dropbear for
link compatibility with dropbear's bundled libtomcrypt.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-21 20:19:14 +08:00
Abhishek Mishra
cb3954e70b !boards/moxart: Use ROMFS PBKDF2 passwd login
Migrate moxa:nsh from fixed telnet password to build-time ROMFS
/etc/passwd with PBKDF2-HMAC-SHA256 and cryptodev.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-21 20:19:14 +08:00
Abhishek Mishra
4761f15b3e !tools/mkpasswd: PBKDF2 host tool and ROMFS passwd build integration
Add standalone host PBKDF2-HMAC-SHA256 mkpasswd, board_romfs_mkpasswd.sh,
and promptpasswd.sh with confirm-password support. Integrate ROMFS passwd
generation in Board.mk and CMake. Drop TEA key checks from passwd_keys.mk.

Signed-off-by: Abhishek Mishra <mishra.abhishek2808@gmail.com>
2026-07-21 20:19:14 +08:00
DuoYuWang
82ab33aed6 arch/arm/src/stm32{h7,f7,l4}: add 4-bit wide bus support for MMC/eMMC cards
The STM32H7, STM32F7, STM32L4 and common STM32 SDIO/SDMMC drivers failed
to program the WIDBUS bits when switching MMC/eMMC cards to 4-bit mode,
and the MMC transfer clock presets were hardwired to 1-bit bus width.

Add CLOCK_MMC_TRANSFER_4BIT to the common SDIO clock enum, add 4-bit
MMC clock presets, and update stm32_widebus() to use modifyreg32/
sdmmc_modifyreg32 to set the host controller bus width.

Signed-off-by: DuoYuWang <thirteenking.wang@gmail.com>
2026-07-21 08:51:38 -03:00
Luchian Mihai
85ad737463 arch/arm/stm32h7: fix MDIO RDA field in c22 write
Use correct register

Signed-off-by: Luchian Mihai <luchiann.mihai@gmail.com>
2026-07-21 08:50:19 -03:00
Lwazi Dube
784035a3e9 arch/mips/jz4780: Add support for L2 cache operations
The common mips_cache.S only handles generic L1 cache operations and
does not support L2 (secondary) cache operations required for the
JZ4780 target.

This commit introduces mti_cache.S to support both L1 and L2 cache
operations.

The mti_cache.S implementation is BSD licensed from Imagination
Technologies.

Signed-off-by: Lwazi Dube <lwazeh@gmail.com>
2026-07-21 16:40:08 +08:00
Peter Barada
c0e796e55d arch/arm/src/stm32h7: Extend crypto interface to support HW HASH
Add stm32h7 support for HASH HW accelerator for MD5, SHA1, SHA2-224,
and SHA2-256 as well as their HMAC variants.

Signed-off-by: Peter Barada <peter.barada@gmail.com>
2026-07-21 08:43:33 +02:00
Jorge Guzman
13c6c7032e boards/linum-stm32h753bi: add curl config and document the curl command
Add a "curl" configuration for the linum-stm32h753bi board, based on the
netnsh configuration (ethernet + DHCP). It enables the system/curl HTTP
client command, SD card support (mounted manually, as in the sdcard
configuration) and a larger console line buffer (CONFIG_LINE_MAX=256) so
long URLs and JSON bodies are not truncated at the NSH prompt.

Also document the curl command: add a man page under
Documentation/applications/system/curl and a usage example (download,
POST JSON, multipart upload) to the board documentation.

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-21 14:36:23 +08:00
dechao_gong
e2ff8be900 arch/arm/rtl8721dx: add shared Ameba GPIO driver.
Add a board-agnostic GPIO driver for Realtek Ameba chips, exposing pins
through the NuttX GPIO (ioexpander) upper half at /dev/gpioN.

- arch/arm/src/common/ameba/ameba_gpio.{c,h}: the shared driver, sitting
  directly on the SDK fwlib register layer.  The fwlib GPIO API it calls
  resolves at link time from the on-chip ROM symbol table, except
  GPIO_INTStatusGet/ClearEdge which are not in ROM and are compiled in
  from fwlib ram_common/ameba_gpio.c (that object also carries GPIO_Init,
  harmlessly overriding the equivalent ROM copy).  Pin interrupts are
  dispatched NuttX-natively: the port's NVIC vector is owned by NuttX
  via irq_attach, and the ISR reads and clears status through the fwlib
  GPIO_INTStatus* helpers.
- The driver keeps nothing IC-specific: the port count, the per-port
  NVIC vectors and the RCC gate bits come from a per-chip
  <ameba_gpio_chip.h> resolved on the include path, so bringing up a new
  Ameba chip only adds that header, not a change to the shared driver.
- arch/arm/src/common/ameba/Kconfig: a shared "Ameba Peripheral Support"
  menu with the AMEBA_GPIO option, sourced by each Ameba chip's Kconfig so
  it is reused across ICs (RTL8721Dx, RTL8720F, ...).
- arch/arm/src/rtl8721dx: provide ameba_gpio_chip.h, wire the driver into
  both the Make/Kconfig and CMake builds, and compile the fwlib
  ameba_gpio.c register layer into libameba_fwlib for the RTL8721Dx.
- boards/arm/rtl8721dx/pke8721daf: board pin table (rtl8721dx_gpio.c),
  bring-up registration, and a standalone gpio defconfig.
- Documentation: describe the gpio configuration and pin encoding.

tools/nxstyle: whitelist the Ameba "GPIO_" SDK ROM symbol prefix (alongside
the existing FLASH_/IPC_/... Ameba prefixes) so the vendor GPIO API's mixed-case
identifiers do not trip nxstyle, matching how the other Ameba SDK prefixes are
handled.

Assisted-by: Claude Code:claude-opus-4-8
Signed-off-by: dechao_gong <dechao_gong@realsil.com.cn>
2026-07-21 08:34:05 +02:00
Felipe Moura
099aa3425f stm32f746g-disco: enable CRYPTO_CRYPTODEV for dropbear
apache/nuttx-apps#3636 depends on it; without it NETUTILS_DROPBEAR
silently disables on reconfigure.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-21 08:33:23 +02:00
Felipe Moura
7536666bcd boards/sim: enable CRYPTO_CRYPTODEV for dropbear
apache/nuttx-apps#3636 depends on it; without it NETUTILS_DROPBEAR
silently disables on reconfigure.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-21 08:33:23 +02:00
liang.huang
fd0dd8c597 sched/backtrace: fix cross-CPU buffer access under addrenv
The remote CPU's IPI handler wrote into the caller's buffer directly,
which may not be reachable from the target CPU's address environment
under CONFIG_ARCH_ADDRENV.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-07-20 21:01:28 -03:00
Matteo Golin
22ff8dbf8f docs/sim: Document new baromonitor configuration
Documents the configuration for the barometer dashboard example, and
explains how to set up a fake barometer to test it.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 21:00:46 -03:00
Matteo Golin
74c50e750c boards/sim: Add baromonitor configuration
Users can try the barometer dashboard example on the simulator. The
recommended way of simulating the barometer is using uorb_generator,
like in the following command:

uorb_generator -n 10000 -r 1 -s -t sensor_baro0 timestamp:23191100,pressure:999.12,temperature:26.34 &

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 21:00:46 -03:00
Matteo Golin
a9bbe3792b docs/raspberrypi-4b: Document baromonitor configuration
Documents the baromonitor configuration available on the RPi4B.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 21:00:46 -03:00
Matteo Golin
9e34f8fa44 boards/raspberrypi-4b: Add configuration for barometer monitor example
Adds a new configuration which allows users to try the barometer
monitoring example with a connected barometer over I2C.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 21:00:46 -03:00
Matteo Golin
a62f4b42aa docs/baromonitor: Add some documentation about the baromonitor example
Documents how to use the baromonitor example, shows its visualization
and explains its default behaviour.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
2026-07-20 21:00:46 -03:00
Junbo Zheng
981ef0f1a7 arch/arm: set PSPLIM to top of TLS region to protect it from overflow
A crash was observed when running ps: a BusFault in nxtask_argvstr
dereferencing tl_argv, because a thread's stack overflow had silently
corrupted the TLS region where tl_argv resides.

On ARMv8-M with CONFIG_ARMV8M_STACKCHECK_HARDWARE, PSPLIM was set to
stack_alloc_ptr -- the bottom of the allocation where TLS begins. The
stack grows downward and TLS occupies [stack_alloc_ptr, stack_alloc_ptr
+ tls_info_size()), so an overflow crossed into TLS and clobbered
tl_argv before SP reached the limit, going undetected until code that
read the corrupted TLS data (such as ps) hit the bad pointer.

Set the limit to stack_alloc_ptr + tls_info_size() -- the top of the
TLS region and the usable stack base -- so an overflow faults at the
TLS boundary, before any TLS byte is touched. Include <tls/tls.h>
for the tls_info_size() macro, which is the value sched reserves for the
TLS region via up_stack_frame().

Signed-off-by: Junbo Zheng <zhengjunbo1@xiaomi.com>
2026-07-20 20:59:06 -03:00
liang.huang
059176fe64 sched: avoid dumping raw memory at address 0 for tasks without kstack
dump_stacks() only checked kernelstack_sp != 0 || force, so for tasks
with no kernel stack (e.g. idle, kernelstack_base == 0) the force path
passed base 0 to dump_stackinfo() and dumped raw memory from address 0,
triggering a secondary fault that truncated the panic log.  Guard with
kernelstack_base != 0.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-07-20 20:57:45 -03:00
Filipe Cavalcanti
5d4f776cdc ci: exclude esp32p5-tab5:python from CI
Ignores Python defconfig from esp32p4-tab5 board.
Python builds are excluded due to its long build time.

Signed-off-by: Filipe Cavalcanti <filipe.cavalcanti@espressif.com>
2026-07-20 20:56:30 -03:00
Emre Cecanpunar
3f78b4bd1d docs/boards/orangepi: add Orange Pi 5 Pro bring-up guide
Document the RK3588S firmware handoff, memory and console settings, build configurations, boot procedure, and hardware validation.

Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
2026-07-20 20:55:52 -03:00
Emre Cecanpunar
ed680c0242 boards/arm64/rk3588s: add Orange Pi 5 Pro support
Add NSH and OSTest configurations, the DRAM linker script, and the minimal board initialization and reset hooks for RK3588S.

Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
2026-07-20 20:55:52 -03:00
Emre Cecanpunar
4635aef828 arm64: add RK3588 support
Add RK3588 chip selection, GICv3 and MMU boot hooks, PSCI support, and an inherited 16550 console.

Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
2026-07-20 20:55:52 -03:00
Felipe Moura
685ca8b175 boards/esp32c3-devkit: Remove Dropbear SSH server support
Drop the esp32c3-devkit:dropbear defconfig and its documentation.
The companion apps#3636 (Dropbear over /dev/crypto for this board)
is stuck on an unrelated Espressif CI dependency issue, and the
port is moving to different hardware.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-20 15:28:14 -03:00
Eren Terzioglu
e26e38fefd arch/risc-v/espressif: Fix build errors on CMake ULP build system
Fix build errors on ULP usage with CMake (e.g lp_mailbox usage, hal assertions enabled)

Signed-off-by: Eren Terzioglu <eren.terzioglu@espressif.com>
2026-07-20 08:20:26 -03:00
Felipe Moura
4e33f0e711 Documentation/stm32f746g-disco: document Dropbear SSH server setup
Document the new stm32f746g-disco:dropbear configuration, mirroring
the existing esp32c3-devkit Dropbear documentation.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-20 17:48:50 +08:00
Felipe Moura
b98bec9dc5 stm32f746g-disco: Add Dropbear SSH server defconfig
Add a stm32f746g-disco:dropbear config for NSH over SSH on the
board's Ethernet, with the password file and Dropbear host key
persisted on QSPI flash (LittleFS) instead of RAM.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-20 17:48:50 +08:00
Felipe Moura
844652a7a1 stm32f746g-disco: Add LittleFS support for N25Q QSPI flash
Add a LittleFS mount option for the on-board N25Q QSPI flash,
mirroring the existing NXFFS/LittleFS toggle already used by the
sibling stm32_w25q.c driver. Needed because NXFFS does not support
rename(), which the companion Dropbear config depends on.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-20 17:48:50 +08:00
yi chen
864c97f1d9 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-07-20 17:05:01 +08:00
liang.huang
a04d67e7dc arch/risc-v: fix fault handler misattributing kernel faults to user tasks
riscv_fault_handler() only checked the task type and SYSCALL flag, so a
fault taken inside an interrupt handler (running in kernel mode) was
blamed on the user task that happened to be interrupted and killed with
SIGSEGV, hiding the real kernel bug.  Use the STATUS_PPP bit of the trap
frame to tell whether the fault originated from user mode: only then is
it safe to kill the task.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-07-20 10:25:52 +02:00
Catalin Visinescu
17fad61ec4 drivers/eeprom: I2C EEPROM Read/Write Kernel Operations Cause a Device Crash
If user passes NULL as buffer, the driver may crash. This is problematic
for NuttX protected and kernel builds.

Details in the issue: https://github.com/apache/nuttx/issues/19473

While this fixes the issue with a typical NULL pointer, fundamentally this
will be addressed with the implementation of access_ok().

https://man7.org/linux/man-pages/man2/access.2.html

Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
2026-07-20 10:02:21 +02:00
Ansh Rai
522ae4cb3f tools/Zig.defs: Fix Zig builds on sim:x86_64
Building Zig applications on sim:x86_64 with Zig 0.13.0 fails because
the generated target "x86_64-freestanding-sysv" is not recognized by
Zig. Introduce a Zig-specific ABI mapping that translates "sysv" to
"gnu" without affecting other toolchains.

After correcting the target ABI, linking still fails due to unresolved
references to __zig_probe_stack. Add -fcompiler-rt so Zig includes the
required compiler runtime during linking.

Verified on sim:nsh with CONFIG_EXAMPLES_HELLO_ZIG=y:

  nsh> hello_zig
  [sim]: Hello, Zig!

Fixes #19475

Signed-off-by: Ansh Rai <anshrai331@gmail.com>
2026-07-20 09:36:56 +08:00
Felipe Moura
f2186e2c3d boards/dropbear: retain child exit status for NSH PTY session
Dropbear's NSH PTY session reaps the child task with waitpid() and needs
CONFIG_SCHED_CHILD_STATUS (which depends on SCHED_HAVE_PARENT).  Without it
the session fails with ECHILD right after authentication
("NSH session wait failed: Unknown error 10").

netutils/dropbear now "depends on SCHED_CHILD_STATUS" per the project's
depends-on-over-select policy (apache/nuttx-apps#3648), so enable it in the
sim and esp32c3-devkit Dropbear defconfigs (SCHED_HAVE_PARENT is already
enabled there).

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-19 19:44:13 -04:00
liang.huang
42d684b02f arch/risc-v: qemu: don't rewind interrupt stack sp on nested trap
qemu-rv's S-mode/non-SMP setintstack unconditionally reloaded sp to
the top of the per-cpu interrupt stack.  A trap taken while already
running on that stack rewound sp back to the same address, so the
nested trap's frame overwrote the still-live outer trap's frame.

Port the bounds check already used by the canonical setintstack in
riscv_macros.S: only move sp when it is outside the interrupt stack
range.

Other vendor chip.h files have the same unconditional-reload pattern
and are left for a follow-up.

Signed-off-by: liang.huang <liang.huang@houmo.ai>
2026-07-19 15:37:05 -03:00
Felipe Moura
94ffa9c923 boards/esp32c3-devkit/dropbear: enable SCHED_HAVE_PARENT
Dropbear's NSH PTY session reaps the child task with waitpid() and needs
CONFIG_SCHED_CHILD_STATUS, which depends on SCHED_HAVE_PARENT.  The
netutils/dropbear Kconfig now depends on SCHED_HAVE_PARENT and selects
SCHED_CHILD_STATUS (apache/nuttx-apps#3648); set SCHED_HAVE_PARENT here so
the dropbear defconfig stays consistent and the session no longer fails
with ECHILD after authentication.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
2026-07-19 13:31:26 +08:00
Michael Rogov Papernov
5b0dd20f3a ci/testing: Free disk space before pulling the CI Docker image
The MemBrowse analyze job intermittently failed unpacking the CI image
with "no space left on device". Free /usr/local/lib/android before the
docker pull, mirroring .github/workflows/build.yml.

Signed-off-by: Michael Rogov Papernov <michael@membrowse.com>
2026-07-18 14:37:31 +02:00
Lwazi Dube
2f73fe2267 boards/mips: Add networking support to CI20 board
Introduce networking capabilities to the Creator CI20 board by leveraging
the pre-existing dm9000 ethernet driver.

To achieve this, the following changes were made:
- Integrated the jz4780 GPIO module to properly configure and enable the
  interrupt pin required by the ethernet controller.
- Added `dm90x0.h` to export the dm9000 initialization function, allowing
  the board-specific setup code to initialize the network interface.

Signed-off-by: Lwazi Dube <lwazeh@gmail.com>
2026-07-17 16:14:14 -03:00
Emre Cecanpunar
4dfca78d41 video: fix EDID standard timing decode
Fix standard timing decoding and the red chromaticity Y field.

Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
2026-07-17 15:00:50 -03:00