Page 1 of 1

[arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Tue Apr 07, 2020 1:04 pm
by scanet
Hi,
I've tested compilation and upload with Arduino IDE, but when I use arduino-cli and want to upload thanks to "upload_method=MassStorage" argument I have the message "File not found - tmp.STM32.stm32.Nucleo_64.bin".
In 'tmp' directory I don't have the bin file, I thought it was fixed.

Do you have any idea to help me ?
Many thanks.

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Tue Apr 07, 2020 1:45 pm
by fpiSTM
This is a known issue which is fixed in the master and will be available in the 1.9.0.

https://github.com/stm32duino/Arduino_C ... /pull/1018

Mainly this commit:
https://github.com/stm32duino/Arduino_C ... 436e13215d

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Thu Apr 09, 2020 12:44 pm
by scanet
Yes, I saw it, thanks for answering.
But how can I update ? Wait for release 1.9.0 ?

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Thu Apr 09, 2020 1:06 pm
by fpiSTM
Wait the 1.9.0 or simply update your platform.txt in your installation.

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Sat Apr 11, 2020 9:39 am
by scanet
Thanks !!!

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Mon Apr 20, 2020 3:45 pm
by scanet
Hi again,
I tried but when I change platform.txt with the latest version, I cannot compile anymore:
sh: can't open 'Y:\...\packages\STM32\hardware\stm32\1.8.0\system/extras/prebuild.sh': No such file or directory Error during build: exit status 2
So upload is impossible of course.

Is there another file to change?
Many thanks.

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Mon Apr 20, 2020 4:31 pm
by fpiSTM
In fact you should not copy the entire file, only to change the line like it is done in the commit I gave you:

Code: Select all

@@ -133,16 +133,14 @@ recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.f
## Create output (.bin file)
recipe.objcopy.bin.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.elf2bin.flags} {compiler.elf2bin.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.bin"

- ## Save bin
- recipe.output.tmp_file={build.project_name}.bin
-recipe.output.save_file={build.project_name}.{build.variant}.bin
- 
## Create output (.hex file)
recipe.objcopy.hex.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"

- ## Save hex
- recipe.output.tmp_file={build.project_name}.hex
- recipe.output.save_file={build.project_name}.{build.variant}.hex
+ build.preferred_out_format=bin
+ 
+ ## Save binary
+ recipe.output.tmp_file={build.project_name}.{build.preferred_out_format}
+ recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_out_format}

## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"

Re: [arduino-cli] upload_method=MassStorage does not work for NucleoL476RG

Posted: Mon Apr 20, 2020 10:07 pm
by scanet
Ok, thanks, now it works! Well done.