Commit 04f0ac6
Add pre-RTOS Dmod_Mutex_New guard via --wrap to fix VFS mounts
The dmosi bridge provides a strong Dmod_Mutex_New that creates a FreeRTOS
mutex using pvPortMalloc+xSemaphoreCreateRecursiveMutex even before the
scheduler starts. Mutex creation succeeds but locking returns -ENOTSUP
pre-RTOS, causing all three dmvfs_mount_fs calls to fail with
"Failed to lock DMVFS mutex". This prevents board modules (dmgpio,
dmclk, dmdevfs) from loading, blocking crash reproduction.
Fix: src/arch/armv7/dmod_mutex.c wraps Dmod_Mutex_New via
-Wl,--wrap=Dmod_Mutex_New. The wrapper returns NULL when
!dmosi_is_started() so dmvfs falls back to Dmod_EnterCritical/
ExitCritical (interrupt-disable critical sections). After
vTaskStartScheduler the wrapper forwards to the real implementation.
src/arch/armv7/CMakeLists.txt: add dmod_mutex.c to dmboot_arch and
propagate -Wl,--wrap=Dmod_Mutex_New to the firmware link via INTERFACE.
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>1 parent eda6751 commit 04f0ac6
2 files changed
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
0 commit comments