From 097d86e201ba98a05bb38bfc05d54a8d4b81d216 Mon Sep 17 00:00:00 2001 From: gguidone Date: Fri, 31 Jul 2026 14:03:07 +0200 Subject: [PATCH] feat(boards/px4/fmu-v4): bound the procfs task table to 64 CONFIG_FS_PROCFS_MAX_TASKS sizes system_load.tasks[], the per-task reporting table behind top, /proc and the cpuload accounting. NuttX defaults it to 128 and this board never overrode it, so 128 slots at 24 B each are reserved for the life of the board. It runs 25 tasks, counted with ls /proc. Effect: system_load 3096 -> 1560 B, so 1536 B of static RAM returned to the heap arena. The second effect matters more on this board. Every NSH builtin needs a 4096 B task spawn, and before this the largest free block with a ground station attached was 3760 B, so no console command would run at all: param and top both failed with "command not found", which is ENOMEM in disguise. With this the largest block reaches 4416 B and the console works. 64 leaves 2.56x headroom over the live count, enough for the transient tasks a calibration or parameter save adds. If the limit were ever exceeded, top and procfs would list fewer tasks and a task's CPU time would go unaccounted; nothing else is affected. --- boards/px4/fmu-v4/nuttx-config/nsh/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig index 219c5d2e84a..2109d8c280a 100644 --- a/boards/px4/fmu-v4/nuttx-config/nsh/defconfig +++ b/boards/px4/fmu-v4/nuttx-config/nsh/defconfig @@ -98,6 +98,7 @@ CONFIG_FS_FATTIME=y CONFIG_FS_LARGEFILE=y CONFIG_FS_PROCFS=y CONFIG_FS_PROCFS_INCLUDE_PROGMEM=y +CONFIG_FS_PROCFS_MAX_TASKS=64 CONFIG_FS_PROCFS_REGISTER=y CONFIG_FS_ROMFS=y CONFIG_GRAN=y