No-IDE Arduino Programming! Hex/Bin File upload from Command Line - AVR/ESP8266/ESP32
HTML-код
- Опубликовано: 22 сен 2019
- 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) www.tindie.com/stores/kdcircu...
Thanks to all the Patrons for dropping a few bucks in the tip jar to help make these videos happen!
/ kdarrah
Twitter: / kdcircuits
For inquiries or design services:
www.kdcircuits.com Наука
That was super helpful!
It's really beginner-friendly and well detailed.
Thank you for sharing this ;)
Just had this though few weeks before and here we are with this video. Thanks a lot man.
Wow... what a wonderful tutorial, thanks a lot bro for sharing such a good piece of information.
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.
love your videos. Informative and right to the point.
Thanks Kevin !
Perfect -- exactly the info I was looking for! Thanks for posting it 🙂
I could have used this tutorial a few weeks ago, thank you for taking the time to do it.
thanks - loving your channel by the way!
Again and also - Thanks for doing these!
One video just answers questions i spent days trying to solve. thanks.
Short and to the point thanks for posting
Useful little tip. I like the approach of simply copying what the IDE does rather than try and figure the tools out from scratch. Nice thinking! Some windows folks might appreciate this too. Stick it in a file with a .bat extension (replacing the echo command with the flash command) and run it. That way you only have to keep whacking space every time you connect a new device to flash.
@echo off
:here
echo "put your flasher command here"
pause
goto here
Hey Kevin that's so kool. Thanks for sharing this.
You saved my Project, thank you very much!
Easiest to follow directions I've found for this - Thanks!!!
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
Thanks for this, been doing long way
Do you have a video on pushing the bin/hex through WiFi to use the Esp8266 as a master for programming some slave uC?
Do you know how to generate the .bin file for esp32 from command line? Very well explained! Thank you!
Thank Kevin you save my day, Merry Christmas!!HO...HO!!
Super helpful. Only listened to the first 3 minutes before I got my answer ;-). Thanks for a simple solution. Now to make a just need to make a GUI for batch programming, also including support for ESP32 encryption (not that hard, actually) and ESP32 Sketch Data all in 1 step...a true "batch programming" method. I know Arduino is slated to the DIY guy, not us development people...but that just means there's still room for improvement ;-).
Nice! How can I do this but with an Adafruit with SAMD like SAMD51 Cortex M4 (like Adafruit Grand Central M4 or Adafruit Metro M4)? Thank you in advance
Keep up these gems
Great video! But say, I have to load my sketch into an nRF52840 chip for example (which is not on a development board. Just a bare chip) then how do we do it?
How to generate C code ino.Hex file with C# or any alternative library for it?
Very cool and just what I was looking for. Many thanks from an old man ;-)
am i right in thinking that if you use the file that doesn't have "bootloader" in the name it will remove the botloader?
is this be done over the network to 1000 devices simultaneously ?
Great! This is upload existed *.hex file, how can we Export compiled Binary (*.hex-similar Ctrl+Alt+S in Arduino IDE) use CLI?
Hello, I am using windows 10 and it gives me the error "Access is denied" in cmd. What is the possible reason?
it was so helpful but is there any way to upload bin file on esp32 without using COM port? I mean using OTA update feature without webserver . I havenot access to my esp32 device
Thanks... Great video...
It's possible upload bin/hex to stm32 with same procedure?
HELL YES. Thanks!
Very helpful . All the same i wonder how you would make this fool proof, so future 'firmware updates' could be sent to a 'dumb customer'. It seems to me you might have to create a tiny front end , with a prompt to select the bin/hex file, which then auto finds the connected board. Or a 'setup' bat file in the same directory as the bin/hex file which just has the task of finding the connected board.
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.
Well obviously you can't program an AVR over serial if it doesn't have the Arduino bootloader on it. That's the whole point of the bootloader.
Just ditch the bootloader and serial programming and program via ISP. As soon as you got a hardware programmer (as you do with your nano that you flashed to be one), there's no point of having the Arduino bootloader on any AVR anymore. It only uses up flash and delays the startup.
avrdude (the program that does the actual flashing of the chip) can be used completely independently of Arduino (as shown in the video). It was around long before Arduino came around and used it. Even better get a GUI front end for it, like AVRDUDESS. It will show you the command line it uses to program the chip, which you can then use without even running the GUI. That makes batch processing easy, one command that sets the fuses, another line to flash the hex (and maybe also write the eeprom). Put it in a script file and it's a single command.
ISP programming is much faster. Just connect the 6 ISP pins (even easier with ISP programmers (like usbasp) you can get on ebay for less than 2$ in case you want a ready made thing), hit program and you are done.
If it has to go even faster, instead of installing a pinheader, I just stuck pogo pins into the ISP programmer's connector, pushed them against the six contacts on the AVR board (those mini, micro or nano boards often come without the header soldered), and with the command line ready hit enter with my other hand. I'm done programming an AVR chip in 10-15 seconds.
There are plenty of explanations on the internet about the details.
Check out this video: ruclips.net/video/hY5aydgilTk/видео.html
It explains a lot.
What if you don't have Arduino IDE or know how to install or use itl, Is there a easier way of uploading the Bin file without having to have all that there?
I got something coming soon - standalone flasher. contact me for more details
Cube led 16x16x16 ?
If I understand this correctly, you still need the sketch to generate the verbiage used in the command line. What if all you have is the hex file?
did you figured it out? i'm asking it myself
The verbose mode was so you could find the commands which sends the files to the board. Im guessing that same line of code has the switches which turns on , or turns off verbose mode. If you only had the hex file, then you would have to first make sure it was compatible with your board ;) , then create a test ide script in verbose mode to obtain that command line which sends that hex to the board. Im guessing there's would be some kind of identifier in the hex file to say which board it was compiled for.
How to convert .bin file to .ino ?
Can't it be scripted then with board detection
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 ; 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 ; 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 ; echo ; sleep 5; done
Where it says , 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.
nice, thanks for the info! I'll have to try this out some time
Hi Kevin, Om my mac I get: [Errno 16] Resource busy
Whats up? I use a TTGO V1 LoRa Oled
Bien Excelente sigue así !!!
How long did it take to flash 1000 boards?
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
thanx itsi nteresting
thanks
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.
For sure there will be a special space in heaven for you! Thanks!
make this video for windows os please
if you watch entire video, you'll see windows as well
Your title implies that you don't need the IDE. You even mention several times shipping off the hex/bin to people without an IDE. However all your video is using command line copies that use utilities that are only loaded on with the IDE. A standard windows box without the IDE won't have those utilities. What do you do when a "customer" that can't program needs to upload the binary on a box without the IDE? How do you adjust the command line to take in account their ESP8266 will be on another USB port than is in the command line?
The point was to not send out the source code. He didn't say you wouldn't need to have the Arduino IDE installed on the target computer system.
Windows ?!? Oh you mean the ancient crappy os prior #LINUX
The main thing keeping many people on Windows is available software. I get that there are alternatives on Linux e.g. Photohop and GIMP but they aren't really equivalent. The open source community is great but I don't think they will ever be able to replicate or even innovate like programmers working full time on a piece of software, from inside a company. And things like wine won't ever be perfect. I think if the Linux community built solid and user-friendly software protection into the kernel and developers wouldn't have to worry about coding their own DRM, that would invite a lot of developers to consider Linux as a target platform because by now, some distros have become "easy enough" for normal people to use.
@@krass76 clearly you never really used a modern #LINUX distro. Your are just replaying ancient old pseudo arguments. there is plenty of excelent open source software out there. mostly free of charge. often better than "originals" . if YOU find yourself unable to use them instead of your beloved obscure closed source unsecure version, then the problem is within yourself. not the OS, not the software. Linux is for people who care. not for dummies who just rant and without knowledge.
@@AxelWerner how i pirate games and programs on linux?
If you have a windows computer and want to have access to the WindowsApps folder watch this video ruclips.net/video/lEB9_JCaqFY/видео.html. That way you do not have to reinstall your IDE and can install arduino using the windows store.
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.
can you be more specific
@@Fedreal_Bureau_Of_Investigaton yes I can, but what specifically do you want me to be more specific about?
@@MikeysLab how programming the Arduino inside visual studio is a much better experience? What you mean by limitations of the arduino ide?
@@Fedreal_Bureau_Of_Investigaton the Arduino IDE prevents many of the object oriented aspects of the language by removing .h and .cpp file, well forcing them into seperated libraries. Feature like auto complete and find all references, plus actual run time debugging make developing with visual studio a much better experience. There is a reason it is in the top 2 IDE's used professionally
@@Fedreal_Bureau_Of_Investigaton not to mention memory profiling, proper project management, multi developer support and integration with GIT
like the information, but dislike that its strechted to 10 minutes if you could have done it easily in under 2 minutes
I think a detailed walk through like most of Kevin's videos can be helpful to more people. Keep in mind some viewers might lack some knowledge that seems trivial to you. More knowledgeable viewers can simply watch @ 2x speeds and voila! problem solved.
@therealnightwriter Well said.
lol, when I watch my own videos back to preview them I watch them at 2x... :)
It's possible upload bin/hex to stm32 with same procedure?