Global EFS lock hangs epicardium
First load_stat()
causes an efs_lock_global()
, then AppDbInit()
does so to.
It looks like epic_file_stat()
called by load_stat()
either never returns or does not unlock the EFS lock.
(gdb) mon reset halt
Only resetting the Cortex-M core, use a reset-init event handler to reset any peripherals or configure hardware srst support.
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x000001b4 msp: 0x2000a400
(gdb) c
Continuing.
Breakpoint 1, efs_lock_global (fs=fs@entry=0x2003fed4) at ../epicardium/fs/filesystem_fat.c:217
217 *fs = NULL;
(gdb) bat
Undefined command: "bat". Try "help".
(gdb) bt
#0 efs_lock_global (fs=fs@entry=0x2003fed4) at ../epicardium/fs/filesystem_fat.c:217
#1 0x10012078 in epic_file_open (filename=filename@entry=0x1004b3cf "card10.cfg", mode=mode@entry=0x1004f903 "r") at ../epicardium/modules/fileops.c:24
#2 0x10011a90 in load_config () at ../epicardium/modules/config.c:238
#3 0x1001073c in main () at ../epicardium/main.c:29
(gdb) c
Continuing.
Breakpoint 2, efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
235 mutex_unlock(&fatfs_lock);
(gdb) bt
#0 efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
#1 0x1001208e in epic_file_open (filename=filename@entry=0x1004b3cf "card10.cfg", mode=mode@entry=0x1004f903 "r") at ../epicardium/modules/fileops.c:27
#2 0x10011a90 in load_config () at ../epicardium/modules/config.c:238
#3 0x1001073c in main () at ../epicardium/main.c:29
(gdb) c
Continuing.
Breakpoint 1, efs_lock_global (fs=fs@entry=0x2003ff5c) at ../epicardium/fs/filesystem_fat.c:217
217 *fs = NULL;
(gdb) bt
#0 efs_lock_global (fs=fs@entry=0x2003ff5c) at ../epicardium/fs/filesystem_fat.c:217
#1 0x10012078 in epic_file_open (filename=filename@entry=0x1004dbab "ble.txt", mode=mode@entry=0x1004f903 "r") at ../epicardium/modules/fileops.c:24
#2 0x100152bc in ble_shall_start () at ../epicardium/ble/ble.c:266
#3 0x1001088a in main () at ../epicardium/main.c:148
(gdb) c
Continuing.
Breakpoint 2, efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
235 mutex_unlock(&fatfs_lock);
(gdb) bt
#0 efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
#1 0x1001208e in epic_file_open (filename=filename@entry=0x1004dbab "ble.txt", mode=mode@entry=0x1004f903 "r") at ../epicardium/modules/fileops.c:27
#2 0x100152bc in ble_shall_start () at ../epicardium/ble/ble.c:266
#3 0x1001088a in main () at ../epicardium/main.c:148
(gdb) c
Continuing.
Breakpoint 1, efs_lock_global (fs=fs@entry=0x2003ff54) at ../epicardium/fs/filesystem_fat.c:217
217 *fs = NULL;
(gdb) bt
#0 efs_lock_global (fs=fs@entry=0x2003ff54) at ../epicardium/fs/filesystem_fat.c:217
#1 0x100120c6 in epic_file_read (fd=16, buf=buf@entry=0x2003ff70, nbytes=nbytes@entry=100) at ../epicardium/modules/fileops.c:46
#2 0x100152dc in ble_shall_start () at ../epicardium/ble/ble.c:274
#3 0x1001088a in main () at ../epicardium/main.c:148
(gdb) c
Continuing.
Breakpoint 2, efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
235 mutex_unlock(&fatfs_lock);
(gdb) bt
#0 efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
#1 0x100120de in epic_file_read (fd=16, buf=buf@entry=0x2003ff70, nbytes=nbytes@entry=100) at ../epicardium/modules/fileops.c:49
#2 0x100152dc in ble_shall_start () at ../epicardium/ble/ble.c:274
#3 0x1001088a in main () at ../epicardium/main.c:148
(gdb) c
Continuing.
Breakpoint 1, efs_lock_global (fs=fs@entry=0x2003ff5c) at ../epicardium/fs/filesystem_fat.c:217
217 *fs = NULL;
(gdb) bt
#0 efs_lock_global (fs=fs@entry=0x2003ff5c) at ../epicardium/fs/filesystem_fat.c:217
#1 0x1001209e in epic_file_close (fd=fd@entry=16) at ../epicardium/modules/fileops.c:35
#2 0x100152e4 in ble_shall_start () at ../epicardium/ble/ble.c:275
#3 0x1001088a in main () at ../epicardium/main.c:148
(gdb) c
Continuing.
Breakpoint 2, efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
235 mutex_unlock(&fatfs_lock);
(gdb) bt
#0 efs_unlock_global (fs=0x200016b8 <s_globalFileSystem>) at ../epicardium/fs/filesystem_fat.c:235
#1 0x100120b2 in epic_file_close (fd=fd@entry=16) at ../epicardium/modules/fileops.c:38
#2 0x100152e4 in ble_shall_start () at ../epicardium/ble/ble.c:275
#3 0x1001088a in main () at ../epicardium/main.c:148
(gdb) c
Continuing.
Breakpoint 1, efs_lock_global (fs=fs@entry=0x2002bd0c) at ../epicardium/fs/filesystem_fat.c:217
217 *fs = NULL;
(gdb) bt
#0 efs_lock_global (fs=fs@entry=0x2002bd0c) at ../epicardium/fs/filesystem_fat.c:217
#1 0x10012190 in epic_file_stat (filename=filename@entry=0x1004c9cd <_menu_script_end+274> "main.py", stat=stat@entry=0x2002bd24) at ../epicardium/modules/fileops.c:101
#2 0x10012bce in load_stat (name=name@entry=0x1004c9cd <_menu_script_end+274> "main.py") at ../epicardium/modules/lifecycle.c:67
#3 0x10012cec in load_sync (name=name@entry=0x1004c9cd <_menu_script_end+274> "main.py", reset=reset@entry=false) at ../epicardium/modules/lifecycle.c:162
#4 0x10012e66 in vLifecycleTask (pvParameters=<optimized out>) at ../epicardium/modules/lifecycle.c:364
#5 0x100229c4 in ?? () at ../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c:703
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) c
Continuing.
Breakpoint 1, efs_lock_global (fs=fs@entry=0x2002aa0c) at ../epicardium/fs/filesystem_fat.c:217
217 *fs = NULL;
(gdb) bt
#0 efs_lock_global (fs=fs@entry=0x2002aa0c) at ../epicardium/fs/filesystem_fat.c:217
#1 0x10012078 in epic_file_open (filename=filename@entry=0x1004ee3f "pairings.bin", mode=mode@entry=0x1004f903 "r") at ../epicardium/modules/fileops.c:24
#2 0x10015eaa in AppDbInit () at ../epicardium/ble/app/common/app_db.c:107
#3 0x10028490 in AppHandlerInit (handlerId=<optimized out>) at ../lib/sdk/Libraries/BTLE/stack/ble-profiles/sources/apps/app/app_main.c:181
#4 0x100156ba in StackInit () at ../epicardium/ble/stack.c:188
#5 0x100153ba in vBleTask (pvParameters=<optimized out>) at ../epicardium/ble/ble.c:438
#6 0x100229c4 in ?? () at ../lib/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c:703
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) c
Continuing.
^C
Edited by schneider