platformio / platform-espressif32

Espressif 32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif32
Apache License 2.0
936 stars 635 forks source link

Flashing a UM TinyS3 with 5.3.0 fails #985

Closed colde closed 1 year ago

colde commented 1 year ago

After uprading to v5.3.0 i can no longer flash an attached TinyS3.

Here is the log of it failing:

Executing task in folder RotatingLED-TinyS3: platformio run --target upload 

Processing um_tinys3 (platform: espressif32; board: um_tinys3; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/um_tinys3.html
PLATFORM: Espressif 32 (5.3.0) > Unexpected Maker TinyS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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-arduinoespressif32 @ 3.20006.221224 (2.0.6) 
 - tool-esptoolpy @ 1.40400.0 (4.4.0) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 34 compatible libraries
Scanning dependencies...
Dependency Graph
|-- FastLED @ 3.5.0
|   |-- SPI @ 2.0.0
|-- WiFiClientSecure @ 2.0.0
|   |-- WiFi @ 2.0.0
Building in release mode
Retrieving maximum program size .pio/build/um_tinys3/firmware.elf
Checking size .pio/build/um_tinys3/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   5.9% (used 19232 bytes from 327680 bytes)
Flash: [=         ]   7.2% (used 240885 bytes from 3342336 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, 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: /dev/cu.usbmodem14301
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem14301
Waiting for the new upload port...
Uploading .pio/build/um_tinys3/firmware.bin
esptool.py v4.4
Serial port /dev/cu.usbmodem14301

It seem to get stuck there for however long i wait until i manually terminate it.

With v5.2.0 it works fine, here is the log for that:

Executing task in folder RotatingLED-TinyS3: platformio run --target upload 

Processing um_tinys3 (platform: espressif32@5.2.0; board: um_tinys3; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/um_tinys3.html
PLATFORM: Espressif 32 (5.2.0) > Unexpected Maker TinyS3
HARDWARE: ESP32S3 240MHz, 320KB RAM, 8MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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-arduinoespressif32 @ 3.20005.220925 (2.0.5) 
 - tool-esptoolpy @ 1.40201.0 (4.2.1) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch3 
 - toolchain-xtensa-esp32s3 @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 33 compatible libraries
Scanning dependencies...
Dependency Graph
|-- FastLED @ 3.5.0
|   |-- SPI @ 2.0.0
|-- WiFiClientSecure @ 2.0.0
|   |-- WiFi @ 2.0.0
Building in release mode
Converting .pio/build/um_tinys3/x509_crt_bundle.bin.txt.o
Compiling .pio/build/um_tinys3/lib917/FastLED/FastLED.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/bitswap.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/colorpalettes.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/colorutils.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/hsv2rgb.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/lib8tion.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/noise.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/platforms.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/platforms/esp/32/clockless_rmt_esp32.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/power_mgt.cpp.o
Compiling .pio/build/um_tinys3/lib917/FastLED/wiring.cpp.o
Compiling .pio/build/um_tinys3/src/main.cpp.o
Building .pio/build/um_tinys3/bootloader.bin
Generating partitions .pio/build/um_tinys3/partitions.bin
esptool.py v4.2.1
Creating esp32s3 image...
Merged 1 ELF section
Successfully created esp32s3 image.
Compiling .pio/build/um_tinys3/libef7/SPI/SPI.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFi.cpp.o
Archiving .pio/build/um_tinys3/libef7/libSPI.a
Indexing .pio/build/um_tinys3/libef7/libSPI.a
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiAP.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiClient.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiGeneric.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiMulti.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiSTA.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiScan.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiServer.cpp.o
Compiling .pio/build/um_tinys3/libb5d/WiFi/WiFiUdp.cpp.o
In file included from .pio/libdeps/um_tinys3/FastLED/src/FastLED.h:67,
                 from src/main.cpp:2:
.pio/libdeps/um_tinys3/FastLED/src/fastspi.h:145:23: note: #pragma message: No hardware SPI pins defined.  All SPI access will default to bitbanged output
 #      pragma message "No hardware SPI pins defined.  All SPI access will default to bitbanged output"
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling .pio/build/um_tinys3/libf60/WiFiClientSecure/WiFiClientSecure.cpp.o
Compiling .pio/build/um_tinys3/libf60/WiFiClientSecure/esp_crt_bundle.c.o
Compiling .pio/build/um_tinys3/libf60/WiFiClientSecure/ssl_client.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/Esp.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/HWCDC.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/IPAddress.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/IPv6Address.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/MD5Builder.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/Print.cpp.o
Archiving .pio/build/um_tinys3/libb5d/libWiFi.a
Indexing .pio/build/um_tinys3/libb5d/libWiFi.a
Compiling .pio/build/um_tinys3/FrameworkArduino/Stream.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/StreamString.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/Tone.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/USB.cpp.o
Archiving .pio/build/um_tinys3/libf60/libWiFiClientSecure.a
Indexing .pio/build/um_tinys3/libf60/libWiFiClientSecure.a
Compiling .pio/build/um_tinys3/FrameworkArduino/USBCDC.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/USBMSC.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/WMath.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/WString.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/base64.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/cbuf.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-rgb-led.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-time.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/libb64/cdecode.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/libb64/cencode.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/main.cpp.o
Compiling .pio/build/um_tinys3/FrameworkArduino/stdlib_noniso.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/wiring_pulse.c.o
Compiling .pio/build/um_tinys3/FrameworkArduino/wiring_shift.c.o
Archiving .pio/build/um_tinys3/libFrameworkArduino.a
Indexing .pio/build/um_tinys3/libFrameworkArduino.a
Linking .pio/build/um_tinys3/firmware.elf
Retrieving maximum program size .pio/build/um_tinys3/firmware.elf
Checking size .pio/build/um_tinys3/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   4.1% (used 13476 bytes from 327680 bytes)
Flash: [=         ]   6.7% (used 223877 bytes from 3342336 bytes)
Building .pio/build/um_tinys3/firmware.bin
esptool.py v4.2.1
Creating esp32s3 image...
Merged 2 ELF sections
Successfully created esp32s3 image.
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-builtin, 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: /dev/cu.usbmodem14301
Forcing reset using 1200bps open/close on port /dev/cu.usbmodem14301
Waiting for the new upload port...
Uploading .pio/build/um_tinys3/firmware.bin
esptool.py v4.2.1
Serial port /dev/cu.usbmodem14301
Connecting...
Chip is ESP32-S3
Features: WiFi, BLE
Crystal is 40MHz
MAC: f4:12:fa:4f:97:08
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00003fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Flash will be erased from 0x00010000 to 0x00046fff...
Compressed 15040 bytes to 10362...
Writing at 0x00000000... (100 %)
Wrote 15040 bytes (10362 compressed) at 0x00000000 in 0.3 seconds (effective 402.5 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 129...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (129 compressed) at 0x00008000 in 0.1 seconds (effective 473.0 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 632.1 kbit/s)...
Hash of data verified.
Compressed 224272 bytes to 123649...
Writing at 0x00010000... (12 %)
Writing at 0x0001c9e9... (25 %)
Writing at 0x00022b7b... (37 %)
Writing at 0x0002809d... (50 %)
Writing at 0x0002d526... (62 %)
Writing at 0x00034e67... (75 %)
Writing at 0x0003dee6... (87 %)
Writing at 0x0004381f... (100 %)
Wrote 224272 bytes (123649 compressed) at 0x00010000 in 2.3 seconds (effective 781.4 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
============================================================ [SUCCESS] Took 27.88 seconds ============================================================
 *  Terminal will be reused by tasks, press any key to close it. 
Jason2866 commented 1 year ago

Maybe this https://github.com/espressif/arduino-esp32/pull/7631

colde commented 1 year ago

I'm not sure why it would be that issue, as i don't get a warning like that, and they have the issue with 5.2.0 which works for me.

Jason2866 commented 1 year ago

So, the only relevant change I see is the change of the esptool.py version. You can try the version used before. In general flashing the S3 via the inbuilt USB modem does work, with the latest release.

colde commented 1 year ago

Yeah, i suspected it was likely related to the esptool.py version. Is there a way i can configure platformio, to use the new framework, but the older esptool.py, or do you suggest trying to just build a binary and manually flash it?

valeros commented 1 year ago

Hi @colde ! Does it work in the Arduino IDE? Anyway, you can find available versions of the esptool package here and set the desired version directly in your platformio.ini:

[env:your_env]
platform = espressif32
...
platform_packages = 
    platformio/tool-esptoolpy @ 1.40300.0
colde commented 1 year ago

Strange, for whatever reason it seems to work now, after having flashed it with espressif32@5.3.0 and the esptool 1.40300.0, meaning i can also flash it with 1.40400.0 now. I guess i'll close this as i can no longer reproduce it.