Setting GPIO21 direction to OUTPUT after deep sleep crashes esp32 on Wireless Shell
Setting GPIO21 mode to Output after deep seep leads to a crash. Setting other GPIO (I testet 22, 23, 4) works. Setting GPIO21 after cold boot or after SW_RESET following the crash also works.
Attaches is a log of the serial port produced by the attached minimal example. The OTAA-example-min.ino is basically the OTAA example with just pinMode(21,OUTPUT); in setup(). I added the license and set isTxConfirmed and overTheAirActivation to false to get to fast to deep sleep. This does not affect the crash.
Following a deep sleep reset using pinMode(Vext,OUTPUT) leads to an IllegalInstruction exception in ISR shortly after setting the pin mode. Address 0x400f03c4 seems to be related to rtc_isr
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x400f03c0: f2fd23fe f93df3bf fcfd9fff
Core 0 register dump:
PC : 0x400f03c4 PS : 0x00050031 A0 : 0x400f259a A1 : 0x3ffbe1d0
A2 : 0x00060120 A3 : 0x3ffbe808 A4 : 0x40084b80 A5 : 0x00000001
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800dc1aa A9 : 0x4008ab48
A10 : 0x00000000 A11 : 0x40085308 A12 : 0x00000000 A13 : 0x3ffbb970
A14 : 0x00000000 A15 : 0x3ffbbce0 SAR : 0x0000001d EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Core 0 was running in ISR context:
EPC1 : 0x400f03c4 EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x00000000
Backtrace: 0x400f03c4:0x3ffbe1d0 0x400f2597:0x3ffbbff0 0x400dcb77:0x3ffbc010 0x40089ce6:0x3ffbc030 0x400887a5:0x3ffbc050
Rebooting...
The problems seems to be in the boot/init code in Mcu.S rtc-board.S timer.S So it is difficult to debug further.