Upload via the command promt

Post here first, or if you can't find a relevant section!
Post Reply
alexandros
Posts: 76
Joined: Mon Oct 02, 2017 6:51 pm

Upload via the command promt

Post by alexandros » Sun Feb 04, 2018 11:06 pm

Is there a way to replicate the arduino IDE commands for uploading the sketch in DFU mode with maple_loader v0.1 ?
i am trying to find the commands the arduino IDE uses to
  • Set the device in DFU
  • to upload the bin file.
i know about the bat files (maple_upload.bat) but i cant do anything with them , i also tried the executables dfu-util.exe

dfu-util -a 0 -D MyPROJECT.bin -R -p COM_29

all i get
USB device paths are not supported by this dfu-util.


as i understand from platform.txt there are 9 parameters
so i have to just pass them over this?
java -jar maple_loader.jar %1 %2 %3 %4 %5 %6 %7 %8 %9

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

Re: Upload via the command promt

Post by RogerClark » Mon Feb 05, 2018 2:46 am

Look at the linux or OSX version not the windows code

On Windows we use a JAR file that handles the reset via serial and caling of DFU Util, but we don't have source for it

Linux upload is handled by a script which you can read and copy

alexandros
Posts: 76
Joined: Mon Oct 02, 2017 6:51 pm

Re: Upload via the command promt

Post by alexandros » Mon Feb 05, 2018 7:58 am

i think i found the source https://github.com/bobc/maple-asp,
i am reading the linux ones , but i am lost! :?

alexandros
Posts: 76
Joined: Mon Oct 02, 2017 6:51 pm

Re: Upload via the command promt

Post by alexandros » Mon Feb 05, 2018 11:56 am

ok i manage to upload my bin to the device. i set it to dfu and i upload the bin file

Code: Select all

@echo off
rem: Note %~dp0 get path of this batch file
rem: Need to change drive if My Documents is on a drive other than C:
set driverLetter=%~dp0
set driverLetter=%driverLetter:~0,2%
 
%driverLetter%
cd %~dp0
 java -jar maple_loader.jar COM29 2 1EAF:0003 b.bin

for /l %%x in (1, 1, 40) do (
  ping -w 50 -n 1 192.0.2.1 > nul
  mode %1 > nul
  if ERRORLEVEL 0 goto comPortFound
)

echo timeout waiting for %1 serial
:comPortFound
pause
apparently the
  • COM29
  • 1EAF:0003
  • b.bin
have to be set with parameters.
i think i will propably make a .net windows project to fill those values

User avatar
mrburnette
Posts: 2232
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Upload via the command promt

Post by mrburnette » Mon Feb 05, 2018 1:01 pm

alexandros wrote:
Mon Feb 05, 2018 11:56 am
<...>
i think i will propably make a .net windows project to fill those values
I am trying to figure out where you are going with this? I am finding your notes interesting, but I just cannot figure out the end-game.
Is the intent to build your own compile/link/upload script or application? From a script build perspective, there is already lot of information out about using the traditional make to build.

The ArduinoIDE is rudimentary, but that is the charm; one codes, clicks, and has near-immediate gratification (or frustration.) Anyway, it is like picking up the TV remote, pressing On and statistically, the TV comes on.

I am aware that many here do not even use the ArduinoIDE, rather they use more professional tools. But, with all of the faults inherent in the IDE, the forum is still titled STM32duino and not STM32make or STM32eclipse or STM32dotnet...

While I find this thread very interesting, we (as a forum) certainly do not wish to trip-up a noob so I just want to go on record here to say that the documented and supported method of uploading compiled code is with the ArduinoIDE, currently at version 1.8.5 and even then the process is not guaranteed to be 100%.

Ray

alexandros
Posts: 76
Joined: Mon Oct 02, 2017 6:51 pm

Re: Upload via the command promt

Post by alexandros » Mon Feb 05, 2018 1:21 pm

i need an app for a group of people (not commercial usage) that will upload a bin file from usb , without the need of an ard. ide , quick and easy.
Thats all.

User avatar
mrburnette
Posts: 2232
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Upload via the command promt

Post by mrburnette » Mon Feb 05, 2018 1:27 pm

alexandros wrote:
Mon Feb 05, 2018 1:21 pm
i need an app for a group of people (not commercial usage) that will upload a bin file from usb , without the need of an ard. ide , quick and easy.
Thats all.
Ok. Makes more sense when the need is put into context. I just want to ensure that as we discuss various aspects of your need in the forum, that newbies/noobs do not get the idea that this is how stuff is normally done... which is to say, I'm going to send all of their questions to you :lol:

Ray

alexandros
Posts: 76
Joined: Mon Oct 02, 2017 6:51 pm

Re: Upload via the command promt

Post by alexandros » Mon Feb 05, 2018 1:31 pm

mrburnette wrote:
Mon Feb 05, 2018 1:27 pm
alexandros wrote:
Mon Feb 05, 2018 1:21 pm
i need an app for a group of people (not commercial usage) that will upload a bin file from usb , without the need of an ard. ide , quick and easy.
Thats all.
Ok. Makes more sense when the need is put into context. I just want to ensure that as we discuss various aspects of your need in the forum, that newbies/noobs do not get the idea that this is how stuff is normally done... which is to say, I'm going to send all of their questions to you :lol:

Ray
thats a big project i guess :)

User avatar
mrburnette
Posts: 2232
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Upload via the command promt

Post by mrburnette » Mon Feb 05, 2018 1:41 pm

alexandros wrote:
Mon Feb 05, 2018 1:31 pm
...
thats a big project i guess :)
Let's try an keep it contained ;)

Post Reply