There seems to be a bug in IDE versions > 1.6.3 in handling legal Windows pathnames containing special characters. I have a Windows XP machine with the user directory "ABC&DEF" and a Windows 7 machine with a user directory "ABC DEF" (with a space in the name). In both of these installations, the IDE, when asked to upload to a board (calling loader.bat), is unable to pass the proper parameters to loader.bat either not finding the project files or the executables (RFDloader.exe, etc.). If new user/user directories are created, i.e. "ABCDEF" on either machine, everything compiles and uploads as normal. I have seen this behavior in 1.6.5 and 1.6.8. This was diagnosed by commenting out (rem @echo off) the first line of the loader.bat file and watching the output window of the IDE while uploading.
(deleted)
Can you post the commands that fail? I suspect that it could be fixed in a future version by enclosing the paths on windows in quotes; that's how you normally work around this kind of thing.
I am just hitting the upload button when building the Simblee/SimbleeForMobile/Temperature example. The compile/upload function is accomplished by the loader.bat script (a component of the IDE). Loader.bat parameters %1 through %6 are set by the IDE. If you comment out the first line (rem @echo off) all the set commands are echo'd to the output screen and you can see that they are improperly set. (with the original user directories on both the ancient Windows XP machine and the new Windows 7 machine). The problem can be fixed by creating new user directories.
Here is loader.bat.
i.e. c:\arduino-1.6.5-r5\portable\packages\Simblee\hardware\1.0.3\loader.bat
@echo off
set loader=%1
set port=%2
set build_path=%3
set build_project_name=%4
set base=%5
set toolchain=%6
if 0 == 1 (
%toolchain%/arm-none-eabi-objdump -h -S %build_path%/%build_project_name%.elf >%build_path%/%build_project_name%.s
taskkill /fi "imagename eq explorer.exe" /fi "windowtitle eq build*" >null
%windir%\explorer.exe "%build_path%"
)
%toolchain%/arm-none-eabi-nm %build_path%/%build_project_name%.elf >%build_path%/%build_project_name%.syms
set files=%build_path%/%build_project_name%.hex
findstr "ota_bootloader_single_bank" %build_path%%build_project_name%.syms >nul
if %errorlevel% == 0 set files=%files% %base%/variants/Simblee/ota_bootloader_single_bank.hex
findstr "ota_bootloader_dual_bank" %build_path%%build_project_name%.syms >nul
if %errorlevel% == 0 set files=%files% %base%/variants/Simblee/ota_bootloader_dual_bank.hex
%base%/%loader% -q %port% %files%
thjames:
loader.bat script (a component of the IDE).
loader.bat is not a component of the Arduino IDE, it's a component of the Simblee package.
Is the problem that the IDE is not passing the correct path to loader.bat or that loader.bat is not properly handling the path?
Are you using the latest version of the Simblee boards?
Have you tested using the Simblee Boards Manager URL: https://www.simblee.com/package_simblee166_index.json with Arduino IDE 1.6.6 or later? It's possible the Arduino IDE 1.6.5 compatible Simblee package(https://www.simblee.com/package_simblee_index.json) may not be updated anymore
The problem is that the IDE is not passing the correct path to loader.bat. It is not handling the paths to the user directory with the special ('&' and ' ') but allowed characters embedded in the user directory.
I am using a month old Sparkfun "Simblee Breakout Board".
I tested IDE 1.6.5 with package_simblee_index.json and IDE 1.6.8 with package_simblee_index.json on both an old Windows XP machine and a new Windows 7 machine.
Not that it matters here, the RFDigital installation guide instructs you to install 1.6.5.
Please post the contents of the Arduino IDE output window with the line @echo off commented out in loader.bat. Use code tags(</> button on the toolbar).
I think I have found the problem with the spaces in the path. Arduino IDE does appear to correctly put the arguments in double quotes when the path contains a space. The problem is loader.bat(from both packages) has things like this:
%base%/%loader% -q %port% %files%
Which translates into something like:
"C:\Users\ABC DEF\AppData\Local\Arduino15\packages\Simblee\hardware\Simblee\1.0.3/"/RFDLoader.exe -q COM54 "C:\Users\ABC DEF\AppData\Local\Temp\build2221463906451099052.tmp"/sketch_may09a.cpp.hex
So the problem is that although Windows usually can accept / as a path separator, the "/ makes it think everything after is a switch. So the solution is simple enough, just change all the / in the batch file to . This file is for Windows only so that won't cause problems on other OS.
Here is the fixed loader.bat from the https://www.simblee.com/package_simblee_index.json package:
REM @echo off
set loader=%1
set port=%2
set build_path=%3
set build_project_name=%4
set base=%5
set toolchain=%6
if 0 == 1 (
%toolchain%\arm-none-eabi-objdump -h -S %build_path%\%build_project_name%.elf >%build_path%\%build_project_name%.s
taskkill /fi "imagename eq explorer.exe" /fi "windowtitle eq build*" >null
%windir%\explorer.exe "%build_path%"
)
%toolchain%\arm-none-eabi-nm %build_path%\%build_project_name%.elf >%build_path%\%build_project_name%.syms
set files=%build_path%\%build_project_name%.hex
findstr "ota_bootloader_single_bank" %build_path%\%build_project_name%.syms >nul
if %errorlevel% == 0 set files=%files% %base%\variants\Simblee\ota_bootloader_single_bank.hex
findstr "ota_bootloader_dual_bank" %build_path%\%build_project_name%.syms >nul
if %errorlevel% == 0 set files=%files% %base%\variants\Simblee\ota_bootloader_dual_bank.hex
%base%\%loader% -q %port% %files%
I've had to kind of fake loader.bat out to test this since my user name doesn't have a space so let me know how that works for you.
Strangely I found this issue: recipe execute fail if there is a space character in windows user name · Issue #4397 · arduino/Arduino · GitHub which claims that Arduino IDE does not add double quotes to paths with a space but the issue was reported after the release of Arduino IDE 1.6.5 which seems to do this correctly so I'm not sure what's going on there. I think we would have heard lots of reports of that issue if that were the case.
Now the ABC&DEF problem is more tricky. Arduino IDE does not add double quotes to this path as is required by windows so I think this is an IDE bug and I haven't found a report for it. I haven't found a way to force it to add the quotes. If you add an extra layer of quotes in platform.txt it ends up trying to run the command:
\"C:\Users\ABC&DEF\AppData\Local\Arduino15\packages\Simblee\hardware\Simblee\1.0.3/loader.bat\"
I don't know why the IDE tries to escape the quotes, seems like another bug.
Pert,
That is what I found. I could fake out the machine with the space in the pathname as you described. On the machine with the '&', nothing is passed in for the project name, toolchain, etc. i.e. empty, blank, no quotes, so there is nothing to work with. The ugliest of hacks is to hard code the appropriate pathnames into loader.bat which makes switching projects a nuisance. The easier hack is to make up a new user account for doing your IDE work. This method doesn't expose the bug, but switching users back and forth is not exactly convenient either.
Did you test out my modified loader.bat with your ABD DEF account? Did it fix the problem?
The edit works changing all non-switch '/' to '' on the machine with the "ABC DEF" user directory. I think you missed one on %toolchain%/arm-non-eabi-nm ... line.
I wonder if anyone working on the IDE is reading this??
As you said, the RFDigital folks could fix up their loader.bat to fix the problem with the "ABC DEF" user, but the IDE needs to be fixed for the more generic case, i.e. to handle "ABC&DEF" and others.
thjames:
The edit works changing all non-switch '/' to '' on the machine with the "ABC DEF" user directory.
Glad to hear.
thjames:
I think you missed one on %toolchain%/arm-non-eabi-nm ... line.
You're right. I edited my previous post in case someone else finds this thread and tries to use my fixed loader.bat.
thjames:
I wonder if anyone working on the IDE is reading this??
...
the IDE needs to be fixed for the more generic case, i.e. to handle "ABC&DEF" and others.
No, the developers are rarely on the forum. I agree the ABC&DEF thing is an IDE bug and an issue report should be made. I have it on my to do list but haven't done it yet so feel free to report it if you want. I usually try to give a list of the minimal steps to reproduce the issue so that it's easy for the developers to verify the bug and test any fixes they attempt.
thjames:
the RFDigital folks could fix up their loader.bat to fix the problem with the "ABC DEF" user
I agree they need to fix it, I think the ABC DEF issue is one that many more Simblee users will experience. I sent Simblee an email with a link to this thread, not sure if that will do anything. I usually don't bother to report things like this unless there is an issue tracker and preferably a GitHub repository so that I can actually submit a pull request with the necessary changes. It's annoying to spend the time when you don't know if you're just duplicating the effort of 20 other people.
Pert,
Thanks for your effort on this. I know how much time it takes to get to the "essence" of a problem. I gave a dump of this to Sparkfun tech support so they should be able to other people (probably none!) who run in to this.