Commit Graph

12 Commits

Author SHA1 Message Date
DuoYuWang
05be273a35 fix(boards): enable CONFIG_FS_LARGEFILE for NuttX boards with MMC/SD (#28043)
* boards: enable CONFIG_FS_LARGEFILE for NuttX boards with MMC/SD

Without large file support, fsblkcnt_t/off_t are 32-bit and statfs
consumers (procfs /fs/usage, df) compute the volume size as
f_bsize * f_blocks in 32 bits, which wraps at 4GB. Boards with an
SD card or eMMC larger than 4GB report the wrong capacity, e.g. a
32GB SD card on FMU-V6X:

    nsh> ls -l /dev/mmcsd0
     brw-rw-rw-1850212352 /dev/mmcsd0   (= 31914983424 mod 2^32)
    nsh> df -h
      vfat       1749M      240K      1749M /fs/microsd

With CONFIG_FS_LARGEFILE=y the same card reports the full 29G.

This enables the option on the 77 boards that build the MMC/SD block
driver (CONFIG_MMCSD=y, SDIO or SPI). Boards without removable storage
and constrained-flash targets (CONFIG_BOARD_CONSTRAINED_FLASH=y) are
left unchanged.

Note: on the px4_firmware_nuttx-10.3.0+ branch the 64-bit file types
are additionally gated on CONFIG_HAVE_LONG_LONG, which is only defined
via nuttx/compiler.h include order, making the option unreliable. That
gating is fixed by the companion NuttX backport PR
(PX4/NuttX, branch backport-fs-largefile, upstream commit 92b2f1bd3d3).

Tested on a custom STM32H743 board with 8GB eMMC and on FMU-V6X with a
32GB SD card.

* fix(boards): enable CONFIG_FS_LARGEFILE for MMC/SD variant configs

The test/console/stackcheck/socketcan/sysview/cyphal/debug/cryptotest
variant configs of boards covered by the previous commit were missed,
leaving them with 32-bit off_t. fmu-v5 protected is intentionally
excluded: protected-mode syscall proxies keep 32-bit widths.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

* chore(nuttx): bump submodule for FS_LARGEFILE backport

Picks up the backport of upstream NuttX 92b2f1bd3d3, which gates the
64-bit file types on CONFIG_FS_LARGEFILE alone instead of the
include-order-dependent CONFIG_HAVE_LONG_LONG.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>

---------

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
2026-07-22 19:22:37 -06:00
Julian Oes
225c1b70ef fix(mavlink): require CONFIG_PTHREAD_MUTEX_TYPES for recursive send mutex
The per-channel send mutex is genuinely recursive: callers hold lock_send()
while the MAVLink C library re-enters send_start()/send_finish() on the same
mutex via MAVLINK_START_UART_SEND. On NuttX a recursive mutex only works with
CONFIG_PTHREAD_MUTEX_TYPES; without it pthread_mutexattr_settype() is a no-op
and the nested lock deadlocks. Only a handful of boards happened to enable the
option (for Zenoh), so mavlink could deadlock at startup on most boards, e.g.
when bringing up a USB link.

Enable CONFIG_PTHREAD_MUTEX_TYPES on the NuttX boards that build mavlink, add
a compile-time guard so a board missing the option fails the build loudly
instead of deadlocking silently, and check the settype() return. Enabling the
option is free in flash and RAM on these boards since they already enable
CONFIG_PRIORITY_INHERITANCE / CONFIG_PTHREAD_MUTEX_ROBUST.

Signed-off-by: Julian Oes <julian@oes.ch>
2026-07-06 08:46:35 -07:00
Silvan Fuhrer
563fd8427a boards: increase init stack size by 100B
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-10-02 09:37:06 +02:00
Igor Mišić
c1dbe177b8 boards: move FRAM emulated sector size to the 32-byte granularity (#21204) 2023-09-20 16:50:36 -04:00
Beat Küng
c95539e8ce boards: increase init stack size by 150B
External airframes need a bit more stack due to nested configs.
2023-06-09 21:11:11 -04:00
Daniel Agar
635daeed8a NuttX push jlink-nuttx into cmake and enable CONFIG_DEBUG_TCBINFO by default 2023-01-12 09:05:26 -05:00
Daniel Agar
dc5ce9b0ce boards: NuttX increase default CONFIG_ARCH_INTERRUPTSTACK 512->768 bytes
- during casual testing on default configs the stack was penetration was reaching ~90% which is a bit too close for comfort
 - increasing by 50% to be conservative
2023-01-07 12:07:35 -05:00
Daniel Agar
40e3503c39 boards: fix all NuttX configs (CONFIG_SMALL NuttX upgrade migration) 2022-12-29 12:50:37 -05:00
Daniel Agar
0fbb6db6d4 boards: update all NuttX defconfig (make all_olddefconfig) 2022-12-29 12:50:37 -05:00
Daniel Agar
2cb4ef0629 NuttX 10.3+ upgrade (#20190)
Co-authored-by: Peter van der Perk <peter.vanderperk@nxp.com>
Co-authored-by: David Sidrane <David.Sidrane@NscDg.com>
Co-authored-by: alexklimaj <alex@arkelectron.com>
2022-11-20 20:28:07 -05:00
Daniel Agar
5b6e5a0968 boards: NuttX update all boards to preallocated sem holder list
- CONFIG_SEM_PREALLOCHOLDERS=32
 - CONFIG_SEM_NNESTPRIO=16 (default)
2022-05-31 01:41:07 -07:00
David Sidrane
9d0e57230a boards: new px4_fmu-v6c board support (#19544) 2022-05-20 15:49:06 -04:00