Programming arduino without ide or avrdude?

Hello, I’m just researching right now to see if it is possible to program an arduino Uno or leonardo board without having the arduino ide or avrdude? Just straight command line.

So my question is if you have a hex or bin file can I program an arduino in command line on windows without ide or avrdude?

I’m seeing a lot of mix results a lot of people say yes and a lot says no. I’m also seeing a lot of maybes. Not saying why though. Any help understanding what. I can do or not do without and arduino ide program.

Joseph

avrdude is command line.
What's the actual problem here?

I don't have a solid answer but I'm pretty sure you'd need multiple commands and probably some kind of "script" (maybe Python or Java, etc.).

The IDE (and I assume AVRdude) is open source so you can "see" how the programming is done.

There is a no problem. What. I mean is there a way to program an arduino if you don’t have avrdude or arduino ide installed?

That is what I’m trying to figure out if it possible to program an arduino if you do not have arduino ide on avrdude installed?

If I have a hex or bin file already made.

You need something to format and send the data to the Arduino. Why don't you want the tools designed to do that?

Yes it is

I’m setting up a temperature sensor in my brother place that also haves a webserver on it. I might need reprogram it for me. He knows nothing about arduino and might get confused. I’m just trying to get him the best way of programming it. Yes I do know the ide would be better.

Yes it is.
Try this, nothing to install

Oh that looks easy enough for him to do. Thank you

Joseph

It appears to be a front end to avrdude.

Nope not at all. My brother doesn't code or program. But if I can make it a little easy for him to help me out then it will be better to help me too.

Hello, Thank you for that. I was wondering I don't see a option for a Leonardo. Is that possilbe to add that or use it?

it appears that an Arduino can be programmed thru the USB/Serial interface using some protocol that makes the bootloader recognize the program mode, accepts the .hex file contents and programs it into flash.

presumably you're asking what that protocol is and are proposing writing a replacement for avrdude which your brother would run from the command line of a PC instead of avrdude.

is this about right?

I'm trying to find a program to where he can upload and program the arduino without having to open the sketch then go through all the boards, libraries like you normally do. just select the board and port as upload the hex or bin file and go.

That is all. I'm just trying to make it easy for him.

Can you supply him with a zip file that contains avrdude, the hex file and a batch file / shell script that executes the needed command(s). Your brother can extract the zip somewhere, double-click the batch file / script and it's done.

The batch file needs to contain a command (or a couple) to reset the Leonardo and the avrdude command to upload.

That is interesting. I never did a batch file before. I will have to look into it. Thank you.

I have made a correction to my previous post; it's one command (or a couple) to reset the Leonardo and a second one for avrdude.

Noter:
Reset is done by opening and closing the serial p[ort port with a baud rate of 1200 baud.

It's not my program.
It may be possible to add the Leonardo but I don't have one to experiment with.

@echo off

REM 1 reset Leonardo
REM 2 upload using avrdude

REM reset-port is the normal port
set reset-port=com12
REM upload-port is the booloader port
set upload-port=com6

echo leonardo on %reset-port%
echo bootloader on %upload-port%

REM reset Leonardo
echo reset Leonardo
mode %reset-port% 1200 > nul
echo > %reset-port%

REM give it a bit of time to switch to bootloader
echo wait a bit
timeout /t 5 > nul

REM upload
echo upload
avrdude\bin\avrdude.exe -C"avrdude/etc/avrdude.conf" -patmega32u4 -cavr109 -P%upload-port% -b57600 -D "-Uflash:w:blink/build/arduino.avr.leonardo/Blink.ino.hex:i"

pause

Sorry for inconsistency in \ and /. I had some problems initially with the avrdude command

Attached is a full zip to upload a modified blink. When you "export compiled binary" in the IDE, you will get a build directory in the sketch directory that contains the hex file. That is reflected in the attached zip; you can clean it out to only have the hex file in there (no sketch, no eep file etc)

1143375_dosUploadLeonardo.zip (360.6 KB)

Note:
you'll obviously have to check (and adjust) the com ports in the batch file