ESP 32 continuos reboot

zenonmb
Posts: 2
Joined: Fri Nov 04, 2022 12:49 am

ESP 32 continuos reboot

Postby zenonmb » Mon Nov 28, 2022 1:04 am

Colleagues,

I had an opensprinkler app running on ESP32 until I changed form dynamic to fixed IP address.
After this change (done through the App gui)it never came up, so decided to flash it again. Compiled with errors but flashed it . After that got continuous booting.

Below is the compiling and need some help to understand candidate 1 and 2.


In file included from C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/Arduino.h:170,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\utils.h:28,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.h:29,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.cpp:24:
C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/IPAddress.h: In static member function 'static void OpenSprinkler::config_ip()':
C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/IPAddress.h:67:10: note: candidate 1: 'bool IPAddress::operator==(const uint8_t*) const'
bool operator==(const uint8_t* addr) const;
^~~~~~~~
C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.cpp:2634:22: note: candidate 2: 'operator==(uint32_t {aka unsigned int}, uint32_t {aka unsigned int})' <built-in>
if(dvip==(uint32_t)0x00000000) return;
^~~~~~~~~~
In file included from C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/Arduino.h:170,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\utils.h:28,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.h:29,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.cpp:24:
C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/IPAddress.h:67:10: note: candidate 1: 'bool IPAddress::operator==(const uint8_t*) const'
bool operator==(const uint8_t* addr) const;
^~~~~~~~
C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.cpp:2638:22: note: candidate 2: 'operator==(uint32_t {aka unsigned int}, uint32_t {aka unsigned int})' <built-in>
if(gwip==(uint32_t)0x00000000) return;
^~~~~~~~~~
In file included from C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/Arduino.h:170,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\utils.h:28,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.h:29,
from C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.cpp:24:
C:\Users\Rosario\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\cores\esp32/IPAddress.h:67:10: note: candidate 1: 'bool IPAddress::operator==(const uint8_t*) const'
bool operator==(const uint8_t* addr) const;
^~~~~~~~
C:\Users\Rosario\Documents\Arduino\Proyectos\Opensprinkler\OpenSprinkler-Firmware-ESP32port-master\mainArduino\OpenSprinkler.cpp:2642:22: note: candidate 2: 'operator==(uint32_t {aka unsigned int}, uint32_t {aka unsigned int})' <built-in>
if(subn==(uint32_t)0x00000000) return;
^~~~~~~~~~
Sketch uses 952621 bytes (72%) of program storage space. Maximum is 1310720 bytes.
Global variables use 53232 bytes (16%) of dynamic memory, leaving 274448 bytes for local variables. Maximum is 327680 bytes.
esptool.py v4.2.1
Serial port COM3
Connecting.....
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: ec:62:60:93:ac:a4
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x000f9fff...
Compressed 18912 bytes to 13025...
Writing at 0x00001000... (100 %)
Wrote 18912 bytes (13025 compressed) at 0x00001000 in 0.4 seconds (effective 387.0 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 128...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (128 compressed) at 0x00008000 in 0.0 seconds (effective 786.5 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 698.9 kbit/s)...
Hash of data verified.
Compressed 958400 bytes to 617291...
Writing at 0x00010000... (2 %)
Writing at 0x0001b972... (5 %)
Writing at 0x000273c5... (7 %)
Writing at 0x00031177... (10 %)
Writing at 0x0003dab9... (13 %)
Writing at 0x000436f2... (15 %)
Writing at 0x00048709... (18 %)
Writing at 0x0004dfe4... (21 %)
Writing at 0x0005340f... (23 %)
Writing at 0x0005912b... (26 %)
Writing at 0x0005ec32... (28 %)
Writing at 0x00064531... (31 %)
Writing at 0x00069f71... (34 %)
Writing at 0x0006f7c4... (36 %)
Writing at 0x00074be0... (39 %)
Writing at 0x00079d34... (42 %)
Writing at 0x0007f1da... (44 %)
Writing at 0x00084569... (47 %)
Writing at 0x000896a3... (50 %)
Writing at 0x0008e7b0... (52 %)
Writing at 0x00093b10... (55 %)
Writing at 0x00098bc0... (57 %)
Writing at 0x0009dec0... (60 %)
Writing at 0x000a3b47... (63 %)
Writing at 0x000a918c... (65 %)
Writing at 0x000ae46a... (68 %)
Writing at 0x000b3857... (71 %)
Writing at 0x000b8c6f... (73 %)
Writing at 0x000be28f... (76 %)
Writing at 0x000c3adf... (78 %)
Writing at 0x000c98bf... (81 %)
Writing at 0x000cf311... (84 %)
Writing at 0x000d7b92... (86 %)
Writing at 0x000dfe40... (89 %)
Writing at 0x000e5b98... (92 %)
Writing at 0x000eb260... (94 %)
Writing at 0x000f0acb... (97 %)
Writing at 0x000f6094... (100 %)
Wrote 958400 bytes (617291 compressed) at 0x00010000 in 10.3 seconds (effective 740.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

Reviewing the code of OpenSprinkler.cpp at line 2642. Actually few lines up, seeing this function definition

Code: Select all

void OpenSprinkler::config_ip() {
	if(iopts[IOPT_USE_DHCP] == 0) {
		byte *_ip = iopts+IOPT_STATIC_IP1;
		IPAddress dvip(_ip[0], _ip[1], _ip[2], _ip[3]);
Line 2642--> if(dvip==(uint32_t)0x00000000) return;
		
		_ip = iopts+IOPT_GATEWAY_IP1;
		IPAddress gwip(_ip[0], _ip[1], _ip[2], _ip[3]);
		if(gwip==(uint32_t)0x00000000) return;
		
		_ip = iopts+IOPT_SUBNET_MASK1;
		IPAddress subn(_ip[0], _ip[1], _ip[2], _ip[3]);
		if(subn==(uint32_t)0x00000000) return;
		
		_ip = iopts+IOPT_DNS_IP1;
		IPAddress dnsip(_ip[0], _ip[1], _ip[2], _ip[3]);
		
		WiFi.config(dvip, gwip, subn, dnsip);
	}
}


On the other end,the continuos boot .


Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13864
load:0x40080400,len:3608
entry 0x400805f0
Scanning i2c for devices...
No I2C devices found
Starting to detect expanders
New IOEXP detected at address: 36
New IOEXP detected at address: 37
New IOEXP detected at address: 38
New IOEXP detected at address: 39
hw_type = 172 hw_rev = 0
Clearing all starion
Starting sensors - INPUT_PULLUP
Sensor1 PIN: 36
Sensor2 PIN: 2
Starting RFTX pins
RFTX PIN: 255
Starting LCD
Init file system
SPIFFS dir:
FILE: 19284.txt
FILE: 19288.txt
FILE: 19285.txt
FILE: 19289.txt
FILE: 19292.txt
FILE: 19301.txt
FILE: 1.txt
FILE: stns.dat
FILE: 19306.txt
FILE: 19307.txt
FILE: 19309.txt
FILE: prog.dat
FILE: 19319.txt
FILE: iopts.dat
FILE: 19290.txt
FILE: 19291.txt
FILE: 19293.txt
FILE: 19295.txt
FILE: done.dat
FILE: sopts.dat
FILE: 19296.txt
FILE: 19297.txt
FILE: 19298.txt
FILE: 19299.txt
FILE: 19266.txt
FILE: 19300.txt
FILE: 19305.txt
FILE: 19283.txt
FILE: nvcon.dat
Starting network
[ 5311][E][ESPmDNS.cpp:148] addService(): Failed adding service http.udp.

Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.

Core 1 register dump:
PC : 0x400898a2 PS : 0x00060f30 A0 : 0x800ec808 A1 : 0x3ffb2640
A2 : 0x00000000 A3 : 0x3ffb268c A4 : 0x00000004 A5 : 0x3ffb25df
A6 : 0x00ff0000 A7 : 0x00000000 A8 : 0x00000001 A9 : 0x3ffb2510
A10 : 0x00000006 A11 : 0x00000000 A12 : 0x00000006 A13 : 0x3ffd2514
A14 : 0x00000000 A15 : 0x00000001 SAR : 0x00000017 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x40089930 LEND : 0x40089946 LCOUNT : 0xffffffff


Backtrace:0x4008989f:0x3ffb26400x400ec805:0x3ffb2660 0x400d53c9:0x3ffb2680 0x400d7e05:0x3ffb26f0 0x400d858b:0x3ffb2800 0x400ed9ad:0x3ffb2820


ELF file SHA256: 0000000000000000

Rebooting...
ets Jun 8 2016 00:22:57

Reviewing some other posts about rebooting , this address(EXCVADDR: 0x00000000 ) = 0 means a nul pointer and reviewing line 2642 of OpenSprinkler.cpp seems to confirm an issue with the fixed IP add.
Question : is it possible that even flashed the ESP still have the previous config for fixed IP add?
I am using an ESP-WROOM-32 module and Arduino 1.8.19
Any idea what is wrong here ?

lbernstone
Posts: 826
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP 32 continuos reboot

Postby lbernstone » Mon Nov 28, 2022 1:21 pm

Flashing firmware does not erase the non-volatile storage (NVS). Erase the whole flash with esptool.
https://github.com/espressif/arduino-es ... 1193822306
https://docs.espressif.com/projects/esp ... ase-region

Who is online

Users browsing this forum: No registered users and 60 guests