Unnecessary double quotes with upload_flags

for some reason platformio adds quotes, what produces errors.


upload_flags = 
    -c hla_serial 003600183438511034313939

this is how pio resolves this
openocd "-c hla_serial 003600183438511034313939" -d2 -s /Users/xx/.platformio/packages/tool-openocd/scripts -f board/st_nucleo_h743zi.cfg -c "program {.pio/build/brain_node/firmware.elf} verify reset; shutdown;"

and this is the error:
invalid command name "hla_serial"

to put quotes also dont help:
-c "hla_serial 003600183438511034313939"

xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-12:31)

tool-openocd 2.1000.200630
toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)

PlatformIO Core, version 5.2.0

With Regards

Kinda solved myself. It should be written following way.

Instead of:

upload_flags = 
    -c hla_serial 274E0C0011145157544D4E00

Should be:

upload_flags = 
    hla_serial 274E0C0011145157544D4E00

now the command is properly shaped:
openocd -c "hla_serial 274E0C0011145157544D4E00" -d2 ...

very fragile syntax…

1 Like