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

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
scanet
Posts: 11
Joined: Thu Mar 26, 2020 3:49 pm

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

Post 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.
User avatar
fpiSTM
Posts: 1757
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

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

Post 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
scanet
Posts: 11
Joined: Thu Mar 26, 2020 3:49 pm

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

Post by scanet »

Yes, I saw it, thanks for answering.
But how can I update ? Wait for release 1.9.0 ?
User avatar
fpiSTM
Posts: 1757
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

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

Post by fpiSTM »

Wait the 1.9.0 or simply update your platform.txt in your installation.
scanet
Posts: 11
Joined: Thu Mar 26, 2020 3:49 pm

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

Post by scanet »

Thanks !!!
scanet
Posts: 11
Joined: Thu Mar 26, 2020 3:49 pm

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

Post 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.
User avatar
fpiSTM
Posts: 1757
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

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

Post 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"
scanet
Posts: 11
Joined: Thu Mar 26, 2020 3:49 pm

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

Post by scanet »

Ok, thanks, now it works! Well done.
Post Reply

Return to “General discussion”