Chat freely about anything...

User avatar
By LievenMerckx
#31196 I'm developing code based on esp_mqtt and started to include c++ parts. At random interval the watchdog kicks in.
I've mplemented an own mechanism watchdog mechanism to see where code blocks and print a stack trace, it always fails in the same location .
See below , anybody recognizes these locations or root cause ?

STACK_START 0x3FFFFD30 -------------------------
3FFFFD40:3FFFC200 DATA _heap_start +0xB260
3FFFFD60:4000050C CODE _xtos_set_exception_handler +0xB8
3FFFFD70:4010190D CODE lmacProcessTxSuccess +0x39
3FFFFD80:4010190D CODE lmacProcessTxSuccess +0x39
3FFFFDC0:3FFE9956 DATA _ZTV6Stream +0x636
3FFFFDD0:3FFFFEE0 DATA UartDev +0x20D0
3FFFFDF0:40002514 CODE ets_printf +0x48
3FFFFE30:3FFFFE50 DATA UartDev +0x2040
3FFFFE50:3FFE91D0 DATA unsupported_str +0x70
3FFFFE70:4010431C CODE wDev_ProcessFiq +0x2F0
3FFFFE90:4000050C CODE _xtos_set_exception_handler +0xB8
3FFFFEB0:40000F68 CODE ets_post +0x144
3FFFFEC0:40000F58 CODE ets_post +0x134
3FFFFED0:3FFEAEE8 DATA DefFreqCalTimer +0x7E8
3FFFFF10:3FFF22F8 DATA _heap_start +0x1358
3FFFFF20:3FFFFF30 DATA UartDev +0x2120
3FFFFF30:3FFE9901 DATA _ZTV6Stream +0x5E1
3FFFFF40:3FFF1D10 DATA _heap_start +0xD70
3FFFFF60:3FFEDE80 DATA WdevTimOffSet +0x2DB8
3FFFFF80:40102986 CODE ppProcessTxQ +0x66
3FFFFF90:402116B6 CODE ppPeocessRxPktHdr +0x14A
3FFFFFA0:3FFEA8E0 DATA DefFreqCalTimer +0x1E0
3FFFFFB0:40000E19 CODE ets_run +0x15
3FFFFFC0:40001100 CODE ets_isr_unmask +0x158
3FFFFFD0:40100276 CODE call_user_start_local +0xE
3FFFFFE0:4010000D CODE call_user_start +0x9
3FFFFFF0:4000044C CODE _ResetVector +0x3CC
STACK_END -------------------------
User avatar
By LievenMerckx
#31277 If somebody else is having same issue , found a first root cause : ets_printf was called from an interrupthandler , which should be replaced by os_printf_plus. See SDK Espressif doc.

If users need to print logs in interrupt handler, please use API os_printf_plus.

Visible in stack trace :

3FFFFDF0:40002514 CODE ets_printf +0x48
3FFFFE30:3FFFFE50 DATA UartDev +0x2040
3FFFFE50:3FFE91D0 DATA unsupported_str +0x70
3FFFFE70:4010431C CODE wDev_ProcessFiq +0x2F0

Now the next issue :-) : Fatal exception 28(LoadProhibitedCause):
epc1=0x40102557, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000024, depc=0x00000000

0x40102557 => 40102530 T lmacProcessAckTimeout

Up to the next !