Page 1 of 1

ESP32-MINI-1 Custom PCB Boot Loop after addressing SOLO?

Posted: Mon Jul 18, 2022 11:06 pm
by Bodhi1
Hello all, I have been working on this issue for weeks and I could really use some help. I have a custom PCB prototype that I need to prove and okay for assembly ASAP and I am pulling my hair out over this. I am using a ESP32-MINI-1U-N4 due to space limitations.

My custom board uses UART for uploading, it does not have a USB port/CP2102N. I have GPI00 lead out for external strapping/grounding when in download boot, GPI02 relies on the internal default pulldown for download boot strapping and is not lead out/or otherwise accessible. I was using a CP2102 for UART and have switched to FTDI FT232 based TTL adaptor from DSD - both TTL adaptors yielded the same result but the DSD is consistently recognized during download - the CP2102 was not.

I am running Win10 pro, VSC 1.69.1 with Platfromio 6.1.1/3.4.2 AND Arduino IDE 1.8.13 (which I know is out of date and I am hoping to not update yet unless I have no other option). I have installed both the Tasmota https://github.com/tasmota/arduino-esp32/releases (for Platformio) and the lberstone https://github.com/lbernstone/arduino-esp32-solo (for Arduino IDE) Solo libraries in hopes that it was/is a single core issue - which I think is the most likely. But neither library has made a difference so far as I can tell. I get the same result trying to upload via Aduino IDE or Platformio with Arduino framework or Platformio with Espressif framework. I am using the blink example in all cases for testing with the only modifications being adding a serial output for arduino IDE and changing the blink pin to IO27 for all.

Whats interesting to note is that when I upload to the matching Espressif Dev board: ESP32-DevKitM-1 via USB, the same blink test script uploads and runs without any issues but when I tried to upload the script to the dev board via UART, it uploads fine then enters the boot loop upon restart.


The blink example uploads as expected from all platforms without any issue. But when restarted after the upload, it will always enter a boot loop:

Platformio Serial Monitor Boot Loop Error:

Code: Select all

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x12 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, 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:1324
ho 0 tail 12 room 4
load:0x40078000,len:13508
load:0x40080400,len:3604
entry 0x400805f0
E (106) cpu_start: Running on single core variant of a chip, but app is built with multi-core support.
E (106) cpu_start: Check that CONFIG_FREERTOS_UNICORE is enabled in menuconfig

abort() was called at PC 0x40082585 on core 0


Backtrace:0x40082e19:0x3ffe3b800x40087a21:0x3ffe3ba0 0x4008c465:0x3ffe3bc0 0x40082585:0x3ffe3c40 0x40079202:0x3ffe3c90  |<-CORRUPTED




ELF file SHA256: 0000000000000000
Platformio ESP Framework build:

Code: Select all

Executing task in folder 220715-185007-espidf-blink: C:\Users\User\.platformio\penv\Scripts\platformio.exe run 

Processing esp32dev (platform: espressif32; framework: espidf; board: esp32dev)
---------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (5.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, 
olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-espidf @ 3.40401.0 (4.4.1)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0)
 - tool-ninja @ 1.9.0
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Reading CMake configuration...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp32dev\src\blink.o
Linking .pio\build\esp32dev\firmware.elf
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   3.5% (used 11356 bytes from 327680 bytes)  
Flash: [==        ]  16.4% (used 171853 bytes from 1048576 bytes)
Building .pio\build\esp32dev\firmware.bin
esptool.py v3.3
Creating esp32 image...
Merged 2 ELF sections
Successfully created esp32 image.
============================================== [SUCCESS] Took 84.68 seconds ==============================================
Upload via Platformio:

Code: Select all

Executing task in folder 220715-185007-espidf-blink: C:\Users\User\.platformio\penv\Scripts\platformio.exe run --target upload 

Processing esp32dev (platform: espressif32; framework: espidf; board: esp32dev)
---------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (5.0.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, 
olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-espidf @ 3.40401.0 (4.4.1)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.30300.0 (3.3.0)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0)
 - tool-mkfatfs @ 2.0.1
 - tool-mklittlefs @ 1.203.210628 (2.3)
 - tool-mkspiffs @ 2.230.0 (2.30)
 - tool-ninja @ 1.9.0
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3
Reading CMake configuration...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   3.5% (used 11356 bytes from 327680 bytes)
Flash: [==        ]  16.4% (used 171853 bytes from 1048576 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Auto-detected: COM9
Uploading .pio\build\esp32dev\firmware.bin
esptool.py v3.3
Serial port COM9
Connecting........
Chip is ESP32-U4WDH (revision 3)
Features: WiFi, BT, Single Core, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 1c:9d:c2:04:61:c0
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 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x0003afff...
Compressed 25280 bytes to 15803...
Writing at 0x00001000... (100 %)
Wrote 25280 bytes (15803 compressed) at 0x00001000 in 0.7 seconds (effective 274.7 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 384.2 kbit/s)...
Hash of data verified.
Compressed 172240 bytes to 90431...
Writing at 0x00010000... (16 %)
Writing at 0x0001b3ae... (33 %)
Writing at 0x00020ba2... (50 %)
Writing at 0x000264a7... (66 %)
Writing at 0x0002ecd8... (83 %)
Writing at 0x00036e03... (100 %)
Wrote 172240 bytes (90431 compressed) at 0x00010000 in 2.6 seconds (effective 538.6 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
============================================== [SUCCESS] Took 30.28 seconds ==============================================
Any ideas? I am happy to try anything and everything.

Re: ESP32-MINI-1 Custom PCB Boot Loop after addressing SOLO?

Posted: Tue Jul 19, 2022 1:22 am
by ESP_Sprite
I don't know enough about the Arduino side of things, but I can confirm this is a single-core issue. You probably aren't seeing the issue on the devboard because it has a newer MINI-1 module on it: at some point in production we changed the chip inside it to a dual-core one.

Re: ESP32-MINI-1 Custom PCB Boot Loop after addressing SOLO?

Posted: Tue Jul 19, 2022 5:48 am
by lbernstone
It sounds like platformio is not using the correct platform.
Go into ~/.platformio/platforms and (re)move any esp32 platforms from there.
Make sure you are using the platformio.ini as shown at https://github.com/Jason2866/esp32-ardu ... /README.md
This should make it so the macro variable CONFIG_FREERTOS_UNICORE is set.

Re: ESP32-MINI-1 Custom PCB Boot Loop after addressing SOLO?

Posted: Wed Jul 20, 2022 2:42 am
by Bodhi1
ESP_Sprite wrote:
Tue Jul 19, 2022 1:22 am
I don't know enough about the Arduino side of things, but I can confirm this is a single-core issue. You probably aren't seeing the issue on the devboard because it has a newer MINI-1 module on it: at some point in production we changed the chip inside it to a dual-core one.
Thanks for your reply ESP_Sprite, it was a single core issue and TTL wiring issue, you and lbernstone nailed it.

Also, your insight on the dual core update is very helpful, I speced the ESP32-MINI-1 (and purchased 275pcs) after reading the datasheet - which says dual-core. I need dual core for my application but my prototype is reading and acting (as per this post and platformio) as a single core - I will open another post about this since it is a different topic. Thanks for your help.

Re: ESP32-MINI-1 Custom PCB Boot Loop after addressing SOLO?

Posted: Wed Jul 20, 2022 2:51 am
by Bodhi1
lbernstone wrote:
Tue Jul 19, 2022 5:48 am
It sounds like platformio is not using the correct platform.
Go into ~/.platformio/platforms and (re)move any esp32 platforms from there.
Make sure you are using the platformio.ini as shown at https://github.com/Jason2866/esp32-ardu ... /README.md
This should make it so the macro variable CONFIG_FREERTOS_UNICORE is set.
Thanks lbernstone for your input and your work on the solo library, both were very helpful. You were right, I updated as per the suggested readme and it did correct the solo issue. I continued to get the same error, after going over my UART connection again I found the second problem - I did not connect CTS. I have never done UART on an ESP before - only on Arduinos where CTS is unnecessary. So, after hooking CTS up it worked perfectly - which made a lot of sense given the situation. My knowledge of ESP32's is growing - seemingly slower then ideal. Thanks for all your help.