STM32F4 upload problem

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
piastri2
Posts: 6
Joined: Thu Oct 06, 2016 5:42 pm

STM32F4 upload problem

Postby piastri2 » Thu Oct 06, 2016 5:57 pm

No error at compiling, when i try to upload through arduino IDE it says
java.io.IOException: Cannot run program "{path}/stlink_upload.bat": CreateProcess error=2, Cannot find specified file

i checked in Arduino_STM32-master\tools\win folder and stlink_upload.bat exists, so.. what is going on?

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Postby RogerClark » Thu Oct 06, 2016 8:55 pm

cut and paste the verbose output about the path to the upload bat file

piastri2
Posts: 6
Joined: Thu Oct 06, 2016 5:42 pm

Re: STM32F4 upload problem

Postby piastri2 » Thu Oct 06, 2016 11:40 pm

Thanks for your reply, it just says {path}

Linking everything together...
"C:\Users\Andrea\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -Os -Wl,--gc-sections -mcpu=cortex-m4 "-TC:\Users\Andrea\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\variants\discovery_f407/ld/jtag.ld" "-Wl,-Map,C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/stm32test.ino.map" "-LC:\Users\Andrea\Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\variants\discovery_f407/ld" -o "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/stm32test.ino.elf" "-LC:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp" -lm -lgcc -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -Wl,--warn-unresolved-symbols -Wl,--start-group "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp\sketch\stm32test.ino.cpp.o" "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp\core\stm32_isrs.S.o" "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp\core\stm32_vector_table.S.o" "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp\core\wirish\start.S.o" "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp\core\wirish\start_c.c.o" "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp\core\discovery_f4.cpp.o" -Wl,--whole-archive "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/core\core.a" -Wl,--no-whole-archive -Wl,--end-group
"C:\Users\Andrea\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/stm32test.ino.elf" "C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/stm32test.ino.bin"

Sketch uses 15,868 bytes (1%) of program storage space. Maximum is 1,048,576 bytes.
Global variables use 13,504 bytes of dynamic memory.
{path}/stlink_upload.bat COM6 {upload.altID} {upload.usbID} C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/stm32test.ino.bin
java.io.IOException: Cannot run program "{path}/stlink_upload.bat": CreateProcess error=2, Impossibile trovare il file specificato
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:26)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:206)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:78)
at processing.app.Sketch.upload(Sketch.java:1187)
at processing.app.Sketch.exportApplet(Sketch.java:1160)
at processing.app.Sketch.exportApplet(Sketch.java:1132)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2409)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: CreateProcess error=2, Impossibile trovare il file specificato
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:386)
at java.lang.ProcessImpl.start(ProcessImpl.java:137)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 9 more
An error occurred while uploading the sketch

User avatar
ahull
Posts: 1422
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: STM32F4 upload problem

Postby ahull » Fri Oct 07, 2016 12:37 am

First thing that jumps out is that there are "/" and "\" characters in those file paths.
Cannot run program "{path}/stlink_upload.bat"

and
{path}/stlink_upload.bat COM6 {upload.altID} {upload.usbID} C:\Users\Andrea\AppData\Local\Temp\buildce9e731677e900d0235ca5321b266c98.tmp/stm32test.ino.bin


This may have some bearing on the issue. Also I would expect the IDE to expand "{path}" but perhaps it does..
Just my tuppence worth, as I am not running Windows, so can't test.
- Andy Hull -

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Postby RogerClark » Fri Oct 07, 2016 12:58 am

Which board do you have selected ?

As none of the STM32F4 boards use Serial as the upload method as far as I can tell ( just tried them all on my machine)

Or did you modify something ?

stevestrong
Posts: 883
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: STM32F4 upload problem

Postby stevestrong » Fri Oct 07, 2016 4:25 am

Roger, i think it is using the stlink to upload, as the batch file name suggests, not serial.

Mixing different slashes is handled correctly by windows.
I think, too, that expanding {path} seems to be the problem, but i dont know the solution...
Maybe searching the batch files in the f4 directory for text "stlink" would bring you closer to the root cause.
Please tell us your solution if you find one, as i also want to use f4 in the near future.

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Postby RogerClark » Fri Oct 07, 2016 4:44 am

Steve

Thanks. For some reason I thought they were trying to do a serial upload.

I just tested all 4 F4 boards and they all tried to upload OK (But I didnt actually have any attached)

I wonder what version of the IDE they are using, because like you say, this looks like an issue with the IDE not expanding the {path} definition, which is specified a few lines above where its used.

I installed 1.6.12 a few days ago and its working fine, but perhaps some older versions of the IDE don't like the syntax. But its not changed for ages, and we hardly ever update the F4 stuff

piastri2
Posts: 6
Joined: Thu Oct 06, 2016 5:42 pm

Re: STM32F4 upload problem

Postby piastri2 » Fri Oct 07, 2016 8:58 am

Managed to fix! Thanks everyone!
Open Documents\hardware\Arduino_STM32-master\STM32F4\platform.txt

search for
tools.stlink.upload.pattern={path}/{cmd}

edit {path} to {runtime.hardware.path}/tools/win

Thanks again, i just uploaded my first sketch

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32F4 upload problem

Postby RogerClark » Fri Oct 07, 2016 9:00 am

Umm
Very odd

Normally the expansion works fine.

What version of IDE are you using, What version of Windows ?

It looks very much like an obscure bug in the IDE and probably worth posting an issue on github to the IDE dev team if its repeatable

piastri2
Posts: 6
Joined: Thu Oct 06, 2016 5:42 pm

Re: STM32F4 upload problem

Postby piastri2 » Fri Oct 07, 2016 9:11 am

Windows 7 home premium, arduino ide 1.6.11


Return to “STM32F4 Boards”

Who is online

Users browsing this forum: No registered users and 1 guest