Upload windows backslash problem

Hi all,

upload target seems not interpreting correctly Windows style backslash.

I have highlighted in bold windows backslash not correctly interpreted

_Configuring upload protocol..._

_AVAILABLE: esp-prog, esptool, ftdi, 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 = ftdi_

_Uploading .pioenvs\esp-wrover-kit\firmware.bin_

_Open On-Chip Debugger 0.10.0-dev (2018-11-05-04:10)_

_Licensed under GNU GPL v2_

_For bug reports, read_

_http://openocd.org/doc/doxygen/bugs.html_

_none separate_

_adapter speed: 20000 kHz_

_esp32 interrupt mask on_

_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: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)_

_Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)_

_Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400_

_Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)_

_Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)_

_Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000_

_Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F)._

_Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400_

_** Programming Started **_

_auto erase enabled_

_Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400_

_Info : Flash mapping 0: 0x10020 -> 0x3f400020, 23 KB_

_Info : Flash mapping 1: 0x20018 -> 0x400d0018, 67 KB_

_Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400_

_Info : Auto-detected flash size 4096 KB_

_Info : Using flash size 4096 KB_

_Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400_

_Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400_

_wrote 139264 bytes from file .pioenvs\esp-wrover-kit\firmware.bin in 2.993481s (45.432 KiB/s)_

_** Programming Finished **_

_** Verify Started **_

_Info : Target halted. PRO_CPU: PC=0x4009171A (active) APP_CPU: PC=0x40000400_

_read 136224 bytes from file .pioenvs\esp-wrover-kit\firmware.bin and flash bank 0 at offset 0x00010000 in 0.681558s (195.187 KiB/s)_

_contents match_

_** Verified OK **_

_Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)_

_Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)_

_Info : esp32: Debug controller 0 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : esp32: Core 0 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : Target halted. PRO_CPU: PC=0x5000004B (active) APP_CPU: PC=0x00000000_

_Info : esp32: Core 0 was reset (pwrstat=0x1F, after clear 0x0F)._

_Info : esp32: Debug controller 1 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : esp32: Core 1 was reset (pwrstat=0x5F, after clear 0x0F)._

_Info : Target halted. PRO_CPU: PC=0x40000400 (active) APP_CPU: PC=0x40000400_

_** Programming Started **_

_auto erase enabled_

**_Error: couldn't open c:UsersjlmartinDocumentsPlatformIOProjects╔81122-115851-espidf-blink.pioenvsesp-wrover-kiootloader.bin_**

_embedded:startup.tcl:454: Error: ** Programming Failed **_

_in procedure 'program_esp32'_

in procedure 'program_error' called at file "C:\Users\jlmartin\.platformio\packages\tool-openocd-esp32/share/openocd/scripts/target/esp32.cfg", line 153

_at file "embedded:startup.tcl", line 454_

_*** [upload] Error 1_

If i write the command with {{… }} on a MSDOS prompt there is no problem.

Where shall i put these {{…}} ?

Could you try the latest upstream version? Espressif 32 — PlatformIO latest documentation

Hello Ivan !

I have the latest Espressif ESP-IDF platform version 1.5.0
My platformio.ini file below:

[env:esp-wrover-kit]
platform = espressif32
framework = espidf
board = esp-wrover-kit
monitor_port = COM7
monitor_speed = 115200
upload_protocol = ftdi
debug_tool = ftdi
build_flags =
_ -DCONFIG_WIFI_SSID=“ESP_AP” -DCONFIG_WIFI_PASSWORD=“MYPASS”_

What is upstream ?
My failing target is “upload”
In verbose mode i clearly see that the problem comes from the windows backslash.
I want to know where is the script calling “embedded:startup.tcl” is located.
I’m new in platformio, but find it very useful !

See link above. Please try umstream version from Git repository

Ivan,
thank for your help !

It’s better !

Now the path is ok for the last token "…/bootloader.bin"

The error is still here :** Programming Started **
c:UsersjlmartinDocumentsPlatformIOProjects╔81122-115851-espidf-blink.pioenvsesp-wrover-kit/bootloader.bin
auto erase enabled
Error: couldn’t open c:UsersjlmartinDocumentsPlatformIOProjects╔81122-115851-espidf-blink.pioenvsesp-wrover-kit/bootloader.bin
embedded:startup.tcl:454: Error: ** Programming Failed **

Please open PlatformIO IDE Terminal (see icon on the bottom toolbar) and type

pio run -t upload -v

Share an output here. Thanks.

Hello Ivan,

As you can see the command is ok:

openocd -s C:/Users/jlmartin/.platformio/packages/tool-openocd-esp32 -s C:/Users/jlmartin/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f share/openocd/scripts/interface/ftdi/esp32_devkitj_v1.cfg -f share/openocd/scripts/board/esp32-wrover.cfg -c "program_esp32 "{{.pioenvs\esp-wrover-kit\firmware.bin}}" 0x10000 verify" -c "program_esp32 "C:\Users\jlmartin\Documents\PlatformIO\Projects\181123-125725-espidf-http-request.pioenvs\esp-wrover-kit/bootloader.bin" 0x1000 verify" -c "program_esp32 "C:\Users\jlmartin\Documents\PlatformIO\Projects\181123-125725-espidf-http-request.pioenvs\esp-wrover-kit/partitions.bin" 0x8000 verify" -c "reset run; shutdown"

But the result isn’t ok

*** Programming Started ***

C:UsersjlmartinDocumentsPlatformIOProjects 81123-125725-espidf-http-request.pioenvsesp-wrover-kit/bootloader.bin

auto erase enabled

Error: couldn’t open C:UsersjlmartinDocumentsPlatformIOProjects 81123-125725-espidf-http-request.pioenvsesp-wrover-kit/bootloader.bin

It should be better if in the command the “{{…}}” are between the flash files.

So I think the right command should be :

openocd -s C:/Users/jlmartin/.platformio/packages/tool-openocd-esp32 -s C:/Users/jlmartin/.platformio/packages/tool-openocd-esp32/share/openocd/scripts -f share/openocd/scripts/interface/ftdi/esp32_devkitj_v1.cfg -f share/openocd/scripts/board/esp32-wrover.cfg -c "program_esp32 "{{.pioenvs\esp-wrover-kit\firmware.bin}}" 0x10000 verify" -c "program_esp32 " {{ C:\Users\jlmartin\Documents\PlatformIO\Projects\181123-125725-espidf-http-request.pioenvs\esp-wrover-kit/bootloader.bin }} " 0x1000 verify" -c "program_esp32 " {{ C:\Users\jlmartin\Documents\PlatformIO\Projects\181123-125725-espidf-http-request.pioenvs\esp-wrover-kit/partitions.bin }} " 0x8000 verify" -c "reset run; shutdown"

But I don’t know which script to modify for this correction.

Also i don’t know how to send a text file in this forum.

This issue was fixed in the latest upstream version. Did you use platform = https://github.com/platformio/platform-espressif32.git?

Hi Ivan,
Sorry for the delay …
Yes i’m using the last version and i have put platform = https://github.com/platformio/platform-espressif32.git? in my platformio.ini file.

Ivan,
I have patched the main.py script in .platformio\platforms\espressif32\builder directory.

Line 313 : added bold characters below.
["-c", ‘program_esp32 "{{%s }} " %s verify’ % (image[1], image[0])])

Now the backslash are correctly interpreted.
But i’m clearly new in python. Don’t know if it could lead to other problem… but it works now !

I’ve just fixed in the latest upstream version. Please re-test Espressif 32 — PlatformIO latest documentation