I already had various reset causes :p but someone maybe has a "official" list ? This would make debugging a bit easier.
Same for boot mode.
Explore... Chat... Share...
reset causes:
0:
1: normal boot
2: reset pin
3: software reset
4: watchdog reset
boot device:
0:
1: ram
3: flash
struct bootflags
{
unsigned char raw_rst_cause : 4;
unsigned char raw_bootdevice : 4;
unsigned char raw_bootmode : 4;
unsigned char rst_normal_boot : 1;
unsigned char rst_reset_pin : 1;
unsigned char rst_watchdog : 1;
unsigned char bootdevice_ram : 1;
unsigned char bootdevice_flash : 1;
};
struct bootflags bootmode_detect(void) {
int reset_reason, bootmode;
asm (
"movi %0, 0x60000600\n\t"
"movi %1, 0x60000200\n\t"
"l32i %0, %0, 0x114\n\t"
"l32i %1, %1, 0x118\n\t"
: "+r" (reset_reason), "+r" (bootmode) /* Outputs */
: /* Inputs (none) */
: "memory" /* Clobbered */
);
struct bootflags flags;
flags.raw_rst_cause = (reset_reason&0xF);
flags.raw_bootdevice = ((bootmode>>0x10)&0x7);
flags.raw_bootmode = ((bootmode>>0x1D)&0x7);
flags.rst_normal_boot = flags.raw_rst_cause == 0x1;
flags.rst_reset_pin = flags.raw_rst_cause == 0x2;
flags.rst_watchdog = flags.raw_rst_cause == 0x4;
flags.bootdevice_ram = flags.raw_bootdevice == 0x1;
flags.bootdevice_flash = flags.raw_bootdevice == 0x3;
return flags;
}
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]