Error programming with ESP-PROG on 5.1.0
Hello,
Uploading with the same settings was working fine with previous version. (10 mins before it was working, no cable changed/touched, nor settings) After the upgrade I get the following error: (Same with 5000khz speed) (Serial upload works fine)
Building in release mode
Retrieving maximum program size .pio\build\env1\firmware.elf
Checking size .pio\build\env1\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [== ] 15.4% (used 50364 bytes from 327680 bytes)
Flash: [======== ] 79.4% (used 1040622 bytes from 1310720 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 = esp-prog
Uploading .pio\build\env1\firmware_merged.bin
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
adapter speed: 20000 kHz
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 20000 kHz
** Programming Started **
Error: Invalid offset!
Error: failed erasing sectors 0 to 270
embedded:startup.tcl:1184: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "C:/Users/Admin/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 171
at file "embedded:startup.tcl", line 1184
*** [upload] Error 1
Platform IO settings:
[platformio]
default_envs = env1
[env:env1]
platform = [email protected]
framework = arduino
board = esp32-s2-saola-1
debug_tool = esp-prog
debug_speed = 20000
upload_protocol = esp-prog
; upload_port = COM6
; debug_tool = jlink
build_flags =
-I include
lib_deps =
rlogiacco/[email protected]
milesburton/DallasTemperature@^3.11.0
paulstoffregen/OneWire@^2.3.7
bblanchon/ArduinoJson@^6.19.4
ottowinter/ESPAsyncWebServer-esphome@^2.1.0
ayushsharma82/AsyncElegantOTA@^2.2.7
https://github.com/tzapu/WiFiManager/archive/refs/tags/v2.0.11-beta.zip
arduino-libraries/NTPClient@^3.2.1
Hi @FireDeveloper ! Thanks for reporting. Could you please upload your firmware in verbose mode? Just run pio run -e env1 -t upload -v in the IDE terminal.
Here it is. (I Accidently pressed the close button, sorry...)
"C:\Users\Admin\.platformio\penv\Scripts\python.exe" C:\Users\Admin\.platformio\packages\tool-esptoolpy\esptool.py --chip esp32s2 merge_bin -o .pio\build\env1\firmware_merged.bin --flash_mode qio --flash_size 4MB 0x10000 .pio\build\env1\firmware.bin "0x1000" "C:\Users\Admin\.platformio\packages\framework-arduinoespressif32\tools\sdk\esp32s2\bin\bootloader_qio_80m.bin" "0x8000" "E:\RnD\T-DAQ\B.30_Firmware\t-daq\.pio\build\env1\partitions.bin" "0xe000" "C:\Users\Admin\.platformio\packages\framework-arduinoespressif32\tools\partitions\boot_app0.bin"
esptool.py v3.3
Flash params set to 0x0020
Wrote 0x10c980 bytes to file .pio\build\env1\firmware_merged.bin, ready to flash to offset 0x0
<lambda>(["upload"], [".pio\build\env1\firmware_merged.bin"])
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 = esp-prog
openocd -d2 -s C:/Users/Admin/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f interface/ftdi/esp32_devkitj_v1.cfg -f target/esp32s2.cfg -c "adapter_khz 20000" -c "program_esp {{.pio\build\env1\firmware_merged.bin}} 0x0 verify" -c "reset run; shutdown"
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
adapter speed: 20000 kHz
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 20000 kHz
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi tdo_sample_edge falling"
Info : clock speed 20000 kHz
Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s2] Debug controller was reset.
Info : [esp32s2] Core was reset.
Info : starting gdb server for esp32s2 on 3333
Info : Listening on port 3333 for gdb connections
Info : JTAG tap: esp32s2.cpu tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s2] requesting target halt and executing a soft reset
Info : [esp32s2] Target halted, PC=0x4001B872, debug_reason=00000000
Info : [esp32s2] Debug controller was reset.
Info : [esp32s2] Core was reset.
Info : [esp32s2] Target halted, PC=0x40007299, debug_reason=00000000
Info : [esp32s2] Core was reset.
Info : [esp32s2] Target halted, PC=0x40000400, debug_reason=00000000
Info : [esp32s2] Target halted, PC=0x40031E92, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f000020, 228 KB
Info : Flash mapping 1: 0x50020 -> 0x40080020, 705 KB
Info : [esp32s2] Target halted, PC=0x40031E92, debug_reason=00000001
Info : Auto-detected flash bank 'esp32s2.flash' size 4096 KB
Info : Using flash bank 'esp32s2.flash' size 4096 KB
** Programming Started **
Info : [esp32s2] Target halted, PC=0x40031E92, debug_reason=00000001
Error: Invalid offset!
Error: failed erasing sectors 0 to 268
embedded:startup.tcl:1184: Error: ** Programming Failed **
in procedure 'program_esp'
in procedure 'program_error' called at file "C:/Users/Admin/.platformio/packages/tool-openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 171
at file "embedded:startup.tcl", line 1184
*** [upload] Error 1
================================================================================================== [FAILED] Took 8.40 seconds ==================================================================================================
PS E:\RnD\T-DAQ\B.30_Firmware\t-daq>
Seems like a bug to me, please temporarily roll back to the previous version of the platform until it's fixed:
[env:env1]
platform = espressif32@~5.0.0
framework = arduino
board = esp32-s2-saola-1
...
Hi @FireDeveloper ! Could you please retest your project using the upstream version of the platform?
[env:env1]
platform = https://github.com/platformio/platform-espressif32.git
framework = arduino
board = esp32-s2-saola-1
Hello @valeros, I didn't tested it until now because I moved to bare IDF and eclipse. It flashed it but application doesn't boot. (With serial flashing it works as expected) This message keeps printing on serial 115200
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x7 (TG0WDT_SYS_RST),boot:0xb (SPI_FAST_FLASH_BOOT)
Saved PC:0x40010d75
SPIWP:0xee
mode:QIO, clock div:2
load:0x3ffe6100,len:0x524
ets_loader.c 65
This is the output if flashed with serial
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0xb (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x524
load:0x4004c000,len:0xa70
load:0x40050000,len:0x292c
SHA-256 comparison failed:
Calculated: 8dce998efc3eb6dc43f3799a489dbcfbd5ada9828beadf71017c05c4a8d32bc3
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x4004c18c
@valeros Tried ESP-PROG with actual version. Does not work fully. Upload and debug fails. When flashing the sketch before and doing Debug without upload it does work.
The same behaviour when using the inbuilt usb/jtag with S3/C3.
Please reopen.
@Jason2866 If it doesn't work with built-in usb/jtag please open a separate issue with comprehensive description of the observed behavior.
@valeros I found the reason for. Since our main app does not run at address 0x10000 the actual implementation does not work. I found a solution for this for us.