Hi guys,
I am new to Arduino. Now I want to update my Arduino program by UART, the details as below:
Any relevant information and advice is appreciated.
Thanks!
Question 4
According to here, I can find the hex file as below:
(Or operate in Arduino IDE with Sketch-->Export Compiled Binary, then Sketch-->Show Sketch Folder, in the build folder, also can see the following file)

But, there is only hex for the firmware which is without a bootloader. When updating, we need to transmit the bin format, right? So, How to get the bin file?
The last file in your list is a HEX with bootloader
1. There is a difference between Firmaware and Software --
Firmaware refers to a piece of ROM-resident program which is not changed/updated until it gets corrupted. For example: Bootloader Program of the ATmega328P MCU of Arduino UNO Board.
Software, in general, refers to an application program which can be stored in the "Application Flash Section: of the ATmega328P MCU with the help of the Bootloader program, which resides in the "Boot Flash Section" of the MCU.
2. You do not want to use Arduino IDE platform, which means that you want to make your own Learning System for the ATmega328P MCU -- is it correct? If yes, then --
(1) What programming language you want to use to create application program -- C or Assembler?
(2) Do you want to use AVR programmer to store the program codes into the MCU or GUI based ISP Programming Interface?
(3) Which programming language you want to use to develop the GUI based ISP Programming Interface to communicate with the MCU -- Visual Studio or else? Fig-1 is an example of a GUI Bases UART/ISP Programming Interface.
@GolamMostafa Thanks for your reply.
What I want to do is find a way to update the software by UART port.
2. You do not want to use the Arduino IDE platform, which means that you want to make your own Learning System for the ATmega328P MCU -- is it correct?
I write the source code(C language) with Arduino IDE, however, others update the software may in anywhere. The one update the software may not install Arduino IDE and doesn't have the update tools, so I want to update by UART. The GUI may be written in Python.
@b707 Thanks for your reply.
I mean there is no bin software.
I don't know Which file needs to be sent by the PC in the above picture so I can update my software.
That depends on the microcontroller.
The compiler/linker will generate the correct file for use with avrdude (HEX file) or for use with bossac (BIN file).
@sterretje Thanks for your sharing.
If using the hex file, that says the bootloader will change the hex to bin first, then burn to flash.
I'm sure that avrdude does the conversion, not the bootloader.
Do you know --
1. What is an Intel-Hex formatted file and its structure?
2. What is the reason of giving preference in using Hex-formatted file for Serial Transmission instead of a raw Binary-formatted file?
The MCU has to have a bootloader installed and the USB to serial cable may be a $15 FTDI cable.
When making and loading MCU on a breadboard, an Arduino board is often used to burn the bootloader via ICSP pins then use Serial to load new sketches. Note that loading via ICSP can do the whole process but is more of a pain.
Even if you don't use this, it should give insight into Duino's and be interesting as well. His second example uses the ATmega1284P!
@sterretje Yes, you are absolutely correct.
@GoForSmoke
Thanks for your help.
Even if you don't use this, it should give insight into Duino's and be interesting as well. His second example uses the ATmega1284P!
Could you give me a URL? I am not very clear about what is Duino.
Thanks again!
Hi everyone,
A lot of thanks to everybody's help.
At last, I address this issue and make a summary about it at here.
Following are the answers to my questions above:
Arduino IDE --> Tools --> Burn Bootloader is the bootloader(according the command, we can find the bootloader source code);0x7800. So we just need to jump to that address to execute the bootloader.Arduino IDE --> Sketch--> Upload, and you will find the upload command in the IDE output window(first you need to enable the verbose output in file-->Preferences...). And execute the command in cmd.exe with option -vvvvv, then you will see all the details of the upload.Sketch-->Export Compiled Binary, Sketch-->Show Sketch Folder, then you will see the hex file. We need the hex file without the bootloader.Flash Memory of ATmega328P is word-organized; where, every word-location (16-bit) has an address.
The Boot Flash Section of the ATmega328P of the UNO Board begins at word-location addrees 0x3C00 (which is half of 0x7800). So, we need to jump at location 0x3C00:
jmp BOOTLOC
.org $3C00
BOOTLOC:
It can be BIN. Avrdude switch -U memtype :op :filename [:format ] where format is i for HEX, r for BIN...
Arduino boards are official where roll your own get called Duinos...
Sorry about the link, I (doh!) forgot!
Nick Gammon's Minimal Breadboard Arduino Tutorial.
One level up has a whole list of informative Arduino tutorials.
@GolamMostafa
Thanks for your important information.