Hello, One thing I noticed about the Bin files. I can download a compiled blink sketch for my arduino uno in the IDE. I can not find a way to upload a Bin file through the IDE. Is there a way to upload a bin file?
not sure the purpose Of downloading a bin but not able to upload a bin file to the board. Can someone please help make sense of all this?
the Arduino IDE compiles a program composed of one or more files into a (binary) .elf file and then translates that into a ASCII .hex file. (look under /cygdrive/c/Users/lenovo/AppData/Local/Temp/arduino_build_259140 on your PC)
The IDE then uses avrdude to program (up/download) an Arduino board with the .hex file. i believe the avrdude interfaces with the bootloader on the Arduino board to program to program flash memory on the avr chip with the program in the .hex file
as far as i know, avrdude does not have options to read the flash memory back into a file on the PC
might be interesting to write an Arduino program that reads the flash memory
Oh yeah. I forgot about the i. That tells it to use intel hex format.
Note that the speed will depend on the particular bootloader you have installed. This isn't always as easy to find out as the part number and the port. If you turn on verbose upload then you can initiate an upload to the chip normally and examine the AVRDude command that the IDE uses to get that information.
I find this very interesting. I never known Can do command line to upload a hex. I heard things about There is a hex file it converts the sketch and libraries to a hex file and it uploads to the board. but I never know you can use command or terminal to upload that hex file.
so my question is it possible to upload the bin file to the board? I know in boards such as the esp8266 and the esp32 you can use aflasher program to upload a bin file. But is it possible on aavr uno board to do the same in command line?
The esp boards use a python program called esptool. Again, if you will turn on verbose mode and do an upload you will see all of the commands that the IDE calls. It's not doing anything that you can't do yourself in a terminal.
The ESP and the AVR take different formats I think. For an AVR you want an intel hex file. It will usually have the extension .hex. I'm not sure what format the ESP boards use.