I am able to reproduce the problem with unmodified dev branch in a few minutes.
When I do a simple change I can't reproduce it yet.
1. add the following file:
nodemcu-firmware$ head app/platform/dummywrapper.c
extern void* __real__xtos_set_exception_handler(int exno, void (*exhandler)());
void* __wrap__xtos_set_exception_handler(int exno, void (*exhandler)()) {
return __real__xtos_set_exception_handler(exno, exhandler);
}
2. add the following to the global Makefile
diff --git a/Makefile b/Makefile
index 85bc27a..c43aa3e 100644
--- a/Makefile
+++ b/Makefile
@@ -119,6 +119,7 @@ CCFLAGS += \
CFLAGS = $(CCFLAGS) $(DEFINES) $(EXTRA_CCFLAGS) $(INCLUDES)
DFLAGS = $(CCFLAGS) $(DDEFINES) $(EXTRA_CCFLAGS) $(INCLUDES)
+LDFLAGS += -Wl,--undefined=_xtos_set_exception_handler -Wl,--wrap=_xtos_set_exception_handler
#############################################################
If the LDFLAGS line is commented out I see fast crashes. If LDFLAGS is active I don't see them.
The original code of SDK (0x40120454) and the wrapper code (0x4023fb78) are in different sections.
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40210000, len = 0x60000
Do these sections have different configurations that influence setup timing or flushing of code/data?
Carsten