# Path with space in platformio.ini file

I need to include the following in my .ini file:

[env:due]
platform = atmelsam
board = due
framework = arduino
extra_scripts = extra_scripts.py

debug_init_break = tbreak loop
build_unflags = -Os
build_flags = -Og -g3 -ggdb3
debug_tool = custom
debug_server =
/Users/firstname lastname/.platformio/packages/tool-openocd/bin/openocd
-d2
-s
/Users/firstname lastname/.platformio/packages/tool-openocd/scripts
-f
interface/cmsis-dap.cfg
-c "set CHIPNAME at91sam3X8E"
-c  "source [find target/at91sam3ax_8x.cfg]"

However, I have a space in my username, so I can’t reference to the path:
"Users\firstname lastname\.platformio\packages\tool-openocd\bin\openocd"

Any tips?
What I tried:
${USERPROFILE}/.platformio/packages/tool-openocd/bin/openocd$USERPROFILE\$/.platformio/packages/tool-openocd/bin/openocd
Users/firstname^ lastname/.platformio/packages/tool-openocd/bin/openocd
Users/"firstname lastname"/.platformio/packages/tool-openocd/bin/openocd

The .ini content I used from the post: Help with PIO Debugger using Atmel ICE and Arduino Due - #38 by jacob

Enclosing it in quotes should be perfectly valid. What error message are you getting?

This is what I get:

undefinedError:
Could not launch Debug Server ‘"/Users/Jacob Delabie/.platformio/packages/tool-openocd/bin/openocd"’. Please check that it is installed and is included in a system PATH

This file definitely exists right?

What happens when you don’t use quotes but a backslash in front of a space in order to escape it, like you would in a normal shell command? (/Users/Jacob\ Delabie/.platformio/packages/tool-openocd/bin/openocd)

Yes, I can manually see/find the .exe file
The backslash doesn’t seem to help

undefinedError:
Could not launch Debug Server ‘/Users/Jacob\ Delabie/.platformio/packages/tool-openocd/bin/openocd’. Please check that it is installed and is included in a system PATH

undefinedError:
Could not launch Debug Server ‘"/Users/Jacob\ Delabie/.platformio/packages/tool-openocd/bin/openocd"’. Please check that it is installed and is included in a system PATH

.exe? It should be without any extension since you’re on Mac, right?

It’s windows, will this thread only work for mac?

No it’s multi platform, but you’re expected to put the path to your openOCD installation in there, and when you’re on Windows this path scheme can’t be right. If you go into your windows explorer and navigate to the openocd.exe you must see a path like

C:\Users\Jacob Delabie\.platformio\packages\tool-openocd\bin\openocd.exe

right? Use this path (first try without quotes, then with quotes, then without quotes but backslash before a space.

Same goes for the path to the configuration file.

1 Like

Wel that’s embarrassing
Sorry for that
Thanks!

1 Like