No-IDE Arduino Programming! Hex/Bin File upload from Command Line – AVR/ESP8266/ESP32
|No-IDE Arduino Programming! Hex/Bin File upload from Command Line – AVR/ESP8266/ESP32
Need to program 1000 boards quickly? or maybe you want to upload a pre-compiled binary/hex file? Well, this might be the solution for you! Might be common knowledge for some people, but just in case you didn’t know about this, here you go!
Check out my Tindie store (trigBoard is available) https://www.tindie.com/stores/kdcircuits/
Thanks to all the Patrons for dropping a few bucks in the tip jar to help make these videos happen!
https://www.patreon.com/kdarrah
Twitter: https://twitter.com/KDcircuits
For inquiries or design services:
https://www.kdcircuits.com
No-IDE Arduino Programming! Hex/Bin File upload from Command Line – AVR/ESP8266/ESP32
No-IDE Arduino Programming! Hex/Bin File upload from Command Line – AVR/ESP8266/ESP32
thanks
Thanks for the video. I do this everyday and its so useful that I would have PAID if someone had told me I could do that from the beggining.
What i ended up doing (which idk if its advance or not) is getting a cheap usbavr, set up a zip instalation of avrdude that contains the micros and the hex to program.
Then a quick program that selects the port and program and make a .bat file (windows) that programs the chip and then u click enter to restart.
I also had an option for the .bat to reset the program after a timer so you dont have to touch it until enter to stop.
10/10 would watch again 😂
like the information, but dislike that its strechted to 10 minutes if you could have done it easily in under 2 minutes
Keep up these gems
Short and to the point thanks for posting
Wow… what a wonderful tutorial, thanks a lot bro for sharing such a good piece of information.
Cube led 16x16x16 ?
love your videos. Informative and right to the point.
Thanks Kevin !
Why don't you just export it as a bin file and then flash it that way over and over by hitting flash by using a program like ESP easy or something like that
I could have used this tutorial a few weeks ago, thank you for taking the time to do it.
Kind of glasses over the bit about sending the precompiled file to someone else and why the target path needs to be changed, and that sort of thing. Good info, though.
Good. Your videos are very easy to understand. Keep it up. Some suggestions: videos about sensor readings hourly plotted on chats (offline or online). Cheers
If you needed to load many many boards, then you should write a shell script. On Mac and Linux, a bash shell script. The simplest one is:
while true; do <insert avrdude command here>; done
When you've done your last board, hit control-c a few time until you get here your command prompt back.
The only problem is synchronizing each call to avrdude with the act of disconnecting each complete board and reconnecting the next one. The simplest way to handle that is to have the script block for user input between each call to avrdude, like this:
while true; do <insert avrdude cmd>; read x; done
Now you have to press enter after you connect each new board to be programmed. That isn't a whole lot better than pressing up arrow and enter. So another idea is have the script beep and sleep a few seconds:
while true; do <avrdude cmd>; echo <control-v><control-g>; sleep 5; done
Where it says <control-v><control-g>, you hold control key and press v at the same time, release them both, then hold control key again and press g at the same time, then release both. When the script runs, this will make a beep. Now you have 5 seconds (or whatever number of seconds you want) to remove the competed board. I believe that as long as there is no board on the programmer, then avrdude will block until one is detected. If I am wrong about that, then this sleep method may not be suitable.
Check out the man page for avrdude, as it may have command line options to assist with automation and scripting.
On Windows, you could do an equivalent power shell script, I suppose. Powers hell is nice to have as an option, but I never look forward to using it.
Windows ?!? Oh you mean the ancient crappy os prior #LINUX
Great stuff! I was glad to learn this. Will be looking forward to a video explaining more of what's going on in verbose output.
Kevin have you checked out iOTAppStory? You can upload binary files to your online account there and have them pushed to esp8266’s over WiFi. The boards check for new updates periodically then download any new scripts. It’s very handy
Hi Kevin. Very useful info. 2 questions: #1 what about the fuses to set the ATmega328 clock to 16Mhz? I think this is accomplished when using the "burn bootloader" command in the IDE. But what about "fresh" chips that are still set to factory defaults?
I am using the standalone programmer from Robert Patterson (based upon the Nick Gammon code), and this does burn the fuses to set the clock speed.
Question #2: From the video it looks like you are using a 6 pin Serial to USB FTDI (as opposed to ICSP port). Maybe I am doing something wrong, but when I tried to communicate with the 328 chip using the serial connection, it would not work until I executed the "burn bootloader" command using the ICSP port and a NANO configured as a programmer.
We have close to 1000 boards to program every year, and I am looking for the best solution for this process. Thanks for your help.
I use these metod some times. But there is a tiny program xloader. Try it. You won't regret.
thanx itsi nteresting
Just had this though few weeks before and here we are with this video. Thanks a lot man.
Can't it be scripted then with board detection
Hey Kevin that's so kool. Thanks for sharing this.
Finally someone explained how to do it. However, it was too fast for me to keep up. Could you do an instructibles.com tutorial on it? Really appreciate your videos.
Nice vid. Arduino has also developed a dedicated command line program called arduino-cli which allows you to do basically everything the ide does. Create sketches, include libraries, compile and upload sketches, etc all from the command line. You can get it from the Arduino GitHub: https://github.com/arduino/arduino-cli/
Platformio.
I honestly have no idea why anyone uses the Arduino IDE anymore, with the availability of Visual Micro for Visual Studio, programming the Arduino inside visual studio is a much better experience, plus you get all the features of the language instead of the limitations the Arduino IDE imposes.