Bricked? ESP-WROOM-32D stuck in boot loop after running unit tests in PIO

nhedlund
Posts: 7
Joined: Sun Sep 12, 2021 3:11 pm

Bricked? ESP-WROOM-32D stuck in boot loop after running unit tests in PIO

Postby nhedlund » Wed Mar 02, 2022 8:53 am

Hello,

After developing a custom hw baord using the ESP-WROOM-32D module in VScode (using arduino) for a couple of weeks as a part of a student exam project, i was going to run some unit tests using platformIO. After creating a simple test in the testfolder and uploading it and running it the terminal spitted out a crash-dump, i thought there was something wrong with my tests and tried to upload my program again from platformIO, the same crash-dump is spitted out over and over again on the terminal. I can upload my program ok, but all i get is a crash-dump on the terminal. The HW has been working fine for several weeks and just after trying to preform a unit test the module crashed.

Any help regarding this is greatly appreciated. Seems like it should not be possible to brick a esp32 just by running unit tests on it? The same test runs fine on a esp32devkit board, but that does not have a wroom-32D module.

My best guess is that when i uploaded the tests something got corrupted, maybe the partitions or something. im using the env:esp32dev, which probably insn't really correct. I am using the SPIFFS to save a html webserver if this could interfere with the partitions in any way.

I have tried uploading "hello world" example using the idf.py and tried uploading a partition table and erasing flash etc. But whatever i've tried has not helped, the same crash message is sent to terminal when opening the monitor. Iv'e also tried uploading progams using arduino ide (just as a test) which also works to do, but result is the same.

Please see the hw hookup image aswell, i have almost all "pins" connected to the module. Maybe this could interfere? however as said before this board and hw setup worked for weeks before running the tests from pio.



platformio.ini file:

Code: Select all

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
	Ethernet
	PubSubClient
	robtillaart/TCA9548 @ ^0.1.2
	Wire
	adafruit/Adafruit INA260 Library @ ^1.5.0
	adafruit/Adafruit MCP23017 Arduino Library @ ^2.0.2
	adafruit/Adafruit BusIO@^1.11.0
	me-no-dev/AsyncTCP@^1.1.1
	me-no-dev/ESP Async WebServer@^1.2.3
	bblanchon/ArduinoJson@^6.19.2

monitor_speed = 115200
upload_speed = 921600
uploading hello world with esp-idf:

Code: Select all

esptool.py esp32 -p COM4 -b 460800 --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader/bootloader.bin 0x10000 hello_world.bin 0x8000 partition_table/partition-table.bin
esptool.py v3.2-dev
Serial port COM4
Connecting....
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 30:c6:f7:c9:96:80
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00007fff...
Flash will be erased from 0x00010000 to 0x00039fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Compressed 25264 bytes to 15785...
Writing at 0x00001000... (100 %)
Wrote 25264 bytes (15785 compressed) at 0x00001000 in 0.8 seconds (effective 265.0 kbit/s)...
Hash of data verified.
Compressed 169776 bytes to 89620...
Writing at 0x00010000... (16 %)
Writing at 0x0001afe9... (33 %)
Writing at 0x00020761... (50 %)
Writing at 0x00025faa... (66 %)
Writing at 0x0002e5ba... (83 %)
Writing at 0x0003694d... (100 %)
Wrote 169776 bytes (89620 compressed) at 0x00010000 in 2.4 seconds (effective 570.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 103...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (103 compressed) at 0x00008000 in 0.1 seconds (effective 413.9 kbit/s)...
Hash of data verified.

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


Crash dump from terminal:

Code: Select all

[code]rst:0x10 (RTCWDT_RTC_RESET),boot:0x17 (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:2
load:0x3fff0030,len:6604
ho 0 tail 12 room 4
load:0x07800000,len:3783744
ets Jun  8 2016 00:22:57
[/code]

Any help or tips of what i can try to "reset to factory defaults" is greatly appreciated.
Attachments
esp32_hookup.PNG
esp32_hookup.PNG (26.8 KiB) Viewed 8088 times

nhedlund
Posts: 7
Joined: Sun Sep 12, 2021 3:11 pm

Re: Bricked? ESP-WROOM-32D stuck in boot loop after running unit tests in PIO

Postby nhedlund » Wed Mar 02, 2022 9:31 am

Output when running espefuse.py --port COM4 summary :

Code: Select all

Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
espefuse.py v3.2-dev
EFUSE_NAME (Block) Description  = [Meaningful Value] [Readable/Writeable] (Hex Value)
----------------------------------------------------------------------------------------
Calibration fuses:
BLK3_PART_RESERVE (BLOCK0):                        BLOCK3 partially served for ADC calibration data   = False R/W (0b0)
ADC_VREF (BLOCK0):                                 Voltage reference calibration                      = 1086 R/W (0b10010)

Config fuses:
XPD_SDIO_FORCE (BLOCK0):                           Ignore MTDI pin (GPIO12) for VDD_SDIO on reset     = False R/W (0b0)
XPD_SDIO_REG (BLOCK0):                             If XPD_SDIO_FORCE, enable VDD_SDIO reg on reset    = False R/W (0b0)
XPD_SDIO_TIEH (BLOCK0):                            If XPD_SDIO_FORCE & XPD_SDIO_REG                   = 1.8V R/W (0b0)
CLK8M_FREQ (BLOCK0):                               8MHz clock freq override                           = 58 R/W (0x3a)
SPI_PAD_CONFIG_CLK (BLOCK0):                       Override SD_CLK pad (GPIO6/SPICLK)                 = 0 R/W (0b00000)
SPI_PAD_CONFIG_Q (BLOCK0):                         Override SD_DATA_0 pad (GPIO7/SPIQ)                = 0 R/W (0b00000)
SPI_PAD_CONFIG_D (BLOCK0):                         Override SD_DATA_1 pad (GPIO8/SPID)                = 0 R/W (0b00000)
SPI_PAD_CONFIG_HD (BLOCK0):                        Override SD_DATA_2 pad (GPIO9/SPIHD)               = 0 R/W (0b00000)
SPI_PAD_CONFIG_CS0 (BLOCK0):                       Override SD_CMD pad (GPIO11/SPICS0)                = 0 R/W (0b00000)
DISABLE_SDIO_HOST (BLOCK0):                        Disable SDIO host                                  = False R/W (0b0)

Efuse fuses:
WR_DIS (BLOCK0):                                   Efuse write disable mask                           = 0 R/W (0x0000)
RD_DIS (BLOCK0):                                   Efuse read disable mask                            = 0 R/W (0x0)
CODING_SCHEME (BLOCK0):                            Efuse variable block length scheme
   = NONE (BLK1-3 len=256 bits) R/W (0b00)
KEY_STATUS (BLOCK0):                               Usage of efuse block 3 (reserved)                  = False R/W (0b0)

Identity fuses:
MAC (BLOCK0):                                      Factory MAC Address
   = 30:c6:f7:c9:96:80 (CRC 0x9c OK) R/W
MAC_CRC (BLOCK0):                                  CRC8 for factory MAC address                       = 156 R/W (0x9c)
CHIP_VER_REV1 (BLOCK0):                            Silicon Revision 1                                 = True R/W (0b1)
CHIP_VER_REV2 (BLOCK0):                            Silicon Revision 2                                 = False R/W (0b0)
CHIP_VERSION (BLOCK0):                             Reserved for future chip versions                  = 2 R/W (0b10)
CHIP_PACKAGE (BLOCK0):                             Chip package identifier                            = 1 R/W (0b001)
MAC_VERSION (BLOCK3):                              Version of the MAC field                           = 0 R/W (0x00)

Security fuses:
FLASH_CRYPT_CNT (BLOCK0):                          Flash encryption mode counter                      = 0 R/W (0b0000000)
UART_DOWNLOAD_DIS (BLOCK0):                        Disable UART download mode (ESP32 rev3 only)       = False R/W (0b0)
FLASH_CRYPT_CONFIG (BLOCK0):                       Flash encryption config (key tweak bits)           = 0 R/W (0x0)
CONSOLE_DEBUG_DISABLE (BLOCK0):                    Disable ROM BASIC interpreter fallback             = True R/W (0b1)
ABS_DONE_0 (BLOCK0):                               Secure boot V1 is enabled for bootloader image     = False R/W (0b0)
ABS_DONE_1 (BLOCK0):                               Secure boot V2 is enabled for bootloader image     = False R/W (0b0)
JTAG_DISABLE (BLOCK0):                             Disable JTAG                                       = False R/W (0b0)
DISABLE_DL_ENCRYPT (BLOCK0):                       Disable flash encryption in UART bootloader        = False R/W (0b0)
DISABLE_DL_DECRYPT (BLOCK0):                       Disable flash decryption in UART bootloader        = False R/W (0b0)
DISABLE_DL_CACHE (BLOCK0):                         Disable flash cache in UART bootloader             = False R/W (0b0)
BLOCK1 (BLOCK1):                                   Flash encryption key
   = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK2 (BLOCK2):                                   Secure boot key
   = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W
BLOCK3 (BLOCK3):                                   Variable Block 3
   = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 R/W

Flash voltage (VDD_SDIO) determined by GPIO12 on reset (High for 1.8V, Low/NC for 3.3V).

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Bricked? ESP-WROOM-32D stuck in boot loop after running unit tests in PIO

Postby ESP_Sprite » Thu Mar 03, 2022 2:05 am

Nothing jumps out wrt what could be wrong... you could try erasing the entire flash, maybe there's something left that confuses the chip?

Code: Select all

esptool.py --chip esp32 -p COM4 -b 460800 erase_flash

nhedlund
Posts: 7
Joined: Sun Sep 12, 2021 3:11 pm

Re: Bricked? ESP-WROOM-32D stuck in boot loop after running unit tests in PIO

Postby nhedlund » Mon Mar 21, 2022 10:06 am

Hello ESP_Sprite, thank you very much for your reply! :)

I tried the command you suggested (i guess it's the same that ive tried from within platform io).
Unfortunately the result is (almost) the same. I actually de-soldered the esp32 module from my pcb and replaced it, and my board is now working fine with a new module.

When soldering the faulty chip to a old (previously broken adafruit huzzah board) i can program it as before and tried erasing the chip with the suggested command, but it shows error message on this pcb as well. Is there any "holy mary super duper-type factory reset command" i can send, or how can i make sure bootloader and partition table is actually uploaded?

What could cause this behavior just by sending new software (running tests) using platformIO?

The error code that is shown from the faulty module, now soldered to huzzah pcb:

Code: Select all

rst:0x10 (RTCWDT_RTC_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:2
load:0x3fff0030,len:6616
load:0x07800000,len:3784768

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: Bricked? ESP-WROOM-32D stuck in boot loop after running unit tests in PIO

Postby ESP_Sprite » Tue Mar 22, 2022 2:16 am

No, that's about the 'reset-est' thing you can do. Could be that your module is simply broken somehow.

Who is online

Users browsing this forum: No registered users and 29 guests