Hi All, I’ve got a few s2 mini’s that I thought I’d give a try. But I cant seem to get them to flash. The web Flasher does not work, it fails claiming it needs to be in boot mode etc, but when I do this (hold reset and boot and then continue to hold boot after I let go of reset) it still does not work. I can tell it’s in the correct model as the com port changes from COM3 (normal) to COM4.
SO I then down downloaded the ESP flasher, but this also does not work it just seems to do nothing for ever… I’ve downloaded the correct image for S2, placing in slot 1, then proceeded to sync… and it seems to take for ever and does nothing.
Play with PIO and different environments or even platforms. And use it to flash your ESP. It will also flash correct bootloader and partition map.
For me platform espressif@5.3.0 works.
For posterity I’ll provide my working PIO environment for Lolin ESP32-S2 D1 mini with 2MB PSRAM and 4MB flash. You can start with that and modify board parameters and change other build flags as required. If your board does not have PSRAM you can omit those build flags but they should not hurt.
Thx, That’s exactly the board I have so I’ll try it and report back. Interestingly tasmota will flash and work with their generic s2 build. One wonders how.
I saw here that this person succeeded following your advice
Now I wonder how the S2 asset in the latest release is built and why it won’t work. Maybe better to not build it if it has issues as it makes folks think it is functional. I mentioned elsewhere I had another non lolin s2 dev board and it didn’t work after flashing that asset so doesn’t seem like this is a lolin d1 mini specific issue.
I simply clone the repo and made an override file with it.
Here are the two issues I ran across.
PIO/vscode would not recognize the build task in the override file so I had to move it to the platformio.ini
[platformio]
default_envs = lolin_s2_mini_custom
This board has issues getting into program mode and staying there. PIO wants to hard reset the board before upload (like the esphome based web installer) and that takes it out of programming mode. So for upload the trick is to hold the reset and gpio 0 buttons until it gets to waiting for new upload port then release the buttons then it will find the port and upload. I have no idea how to disable that reset or otherwise get this to work “normally”
Looking for upload port...
Auto-detected: /dev/ttyS0
Forcing reset using 1200bps open/close on port /dev/ttyS0
Waiting for the new upload port...
Uploading .pio/build/lolin_s2_mini_custom/firmware.bin
esptool.py v4.4
Serial port /dev/ttyACM0
Connecting...
Chip is ESP32-S2FNR2 (revision v0.0)
Features: WiFi, Embedded Flash 4MB, Embedded PSRAM 2MB, ADC and temperature sensor calibration in BLK2 of efuse V2
Crystal is 40MHz
MAC: 84:fc:e6:c5:ad:4a
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00004fff...
now the question is can I/we make a generic S2 build that will work for any S2 like the tasmota32s2.factory.bin file does?
This is not a pio specific flash issue. It’s the same with for example the tasmota web installer (based on esphome web installer).
I can flash this board with esptool but I MUST set NO before reset. And I must get it into programming mode by holding gpio 0 down at power up for 5 secs.
I think pio and the esphome webinstaller both do this because they assume the board can be automatically put into program mode and this is why there is the issue.
It’s hard enough just to get the thing into programming mode to start. I think that’s a design issue I can’t fix. Other lolin mini boards can be put into programming mode “automatically” but not this one.
I have a handful of them luckily not hundreds as there appears no fix.
Hello,
I now have this problem with my own circuit boards and hope you can help me.
I can flash TASmota without any problems and it works.
However, as soon as I flash WLED, whether via PlatformIO or via Bin File, I get:
Rx][18:05:37.651] E (337) esp_core_dump_flash: No core dump partition found!
[Rx][18:05:37.651] E (337) esp_core_dump_flash: No core dump partition found!
[Rx][18:05:37.651] E (340) psram: PSRAM ID read error: 0x00030000
[Rx][18:05:37.651] ./components/esp_littlefs/src/littlefs/lfs.c:1229:error: Corrupted dir pair at {0x0, 0x1}
[Rx][18:05:37.651] E (350) esp_littlefs: mount failed, (-84)
[Rx][18:05:37.651] E (353) esp_littlefs: Failed to initialize LittleFS
[Rx][18:06:06.320] ESP ROM:esp32s2-rc4-20191025
[Rx][18:06:06.320] Build:Oct 25 2019
If you are just flashing a prebuilt binary that is not what I did here. I cloned the wled github repo and had PIO build and then flash the build using the environment settings mentioned above.
Not sure what has changed but now I am having trouble getting board flashed with this custom env (I did pull latest main branch so maybe that caused the issue?). I did get it flashed once but it would not go into AP mode so probably binary was no good (don’t have enough PIO to debug this, What if anything can I do from serial terminal?)
So…I checked out the 15 b4 you said it would “fix” things but it won’t compile
Compiling .pio/build/lolin_s2_mini/lib00e/IRremoteESP8266/ir_Haier.cpp.o
wled00/wled_server.cpp:3:10: fatal error: html_ui.h: No such file or directory
*****************************************************************
* Looking for html_ui.h dependency? Check our library registry!
*
* CLI > platformio lib search "header:html_ui.h"
* Web > https://registry.platformio.org/search?q=header:html_ui.h
*
*****************************************************************
#include "html_ui.h"
^~~~~~~~~~~
compilation terminated.
*** [.pio/build/lolin_s2_mini/src/wled_server.cpp.o] Error 1
Do you have an s2 mini you can try to confirm it is working?
I can’t use the web installer because of programming mode issue but can I download the binary and use esptool. If so what are the details of the esptool command line for flashing the binary from github releases?
Well, nevermind. I got one mini flashed and working. Don’t know why the other two won’t work. They work with tasmota. It worked with the last commit of that dev branch of arduinoFFT
I found the esptool settings so I will try with 15 b4 release asset again. I see though that the release assets for 15b4 don’t include the s2 d1-mini. AFAIK that generic s2 bin won’t work.
@blazoncek ok, so I checked out 15 b4 and built it (just lolin s2 mini as it is in repo) and it works! yea
…But I can’t use the github release asset binary because
I can’t use the web installer (see above about not getting into program mode)
I tried to use esptool which works for a tasmota factory bin but I think the bootloader procedure and the addresses for flashing WLED are not ok for s2. Install WLED Binary - WLED Project. So how is platformio using esptool correctly as obviously it is?
Have you @blazoncek ever successfully used the web installer with this board? No matter when and how long i press the program button it has never worked for me and that could be said for both the tasmota and esphome web installers which are basically the same code. You never get by this warning. ESP Web Tools See post above (march 11 and link).
I scrolled through pinned messages from you in Hardware and Issues at discord and didn’t see any info about s2 flashing. So from the github issue I read this.
ESP32 and its variants S2, S3 and C3 use bootloader, partition map and firmware files to successfully flash a device. Additionally, you need boot_app0.bin at 0xe000.
so to summarize what I can divine according to the posts
bootloader at 0x1000 which boot loader? is it specific for s2, download link?
partition map at x?000, download link?
firmware at 0x8000 I assume that this is the ESP32-S2 release .bin
boot_app0.bin at 0xe000 , download link?
nothing flashed at 0x000?
I’d like to be able to flash using the precompiled binary (I can write a bash script for esptool to make it easy save for having to “fiddle” with the program button at the right time). Still if it’s not possible I’m ok with using pio at this point.
Also, what I haven’t tried is the OTA upgrade once it’s flashed. If that just replaces the firmware then it might work fine since the other pieces are already there.