mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 20:57:55 +00:00
In a protected build a module loaded by exec() runs as a user task, and the loader puts it in the text and data heaps, which on this chip are SRAM2. Nothing gave user code access to SRAM2: the region that would have done so, in arm_addregion(), exists only with CONFIG_MM_REGIONS > 1, and it is built with mpu_user_intsram(), which on ARMv8-M is execute-never. So the module faulted on its first instruction. The protected build now maps SRAM2 for user code to read, write and execute when either heap is in use. Privileged execution stays allowed, since a kernel module loaded with insmod lands in the same heaps. On mps3-an547:knsh under QEMU, with CONFIG_ELF, both heaps and the ROMFS variant of examples/elf, errno faulted on its first instruction with an instruction access violation at 0x21000001. Now every module of the example runs to the end. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com> |
||
|---|---|---|
| .. | ||
| include | ||
| src | ||
| CMakeLists.txt | ||
| Kconfig | ||