Hi, I started using Arduino IDE2, I find that after the configuration and programming and compilation of the Arduino due board (native USB PORT), it does not save its HEX file, while for the lower boards of arduino, nano, mega etc. everything works and also save the HEX file, I ask if possible help on this phenomenon. Thank you
There is no .hex file with Due, but a .bin file.
Thanks but, for the bottom boards of arduino, nano, mega etc. everything works and also saves the HEX file,
Everything works for the Due also. It is only that this board is configured to use a different binary file format. Don't get hung up on the fact that it is not a .hex file.
Try this:
- Select the Due board from the Tools > Board > Arduino SAM Boards (32-bits ARM Cortex-M3) menu in the Arduino IDE.
- Select Sketch > Export Compiled Binary from the Arduino IDE menus.
- Wait for the compilation process to finish.
- Select Sketch > Show Sketch Folder from the Arduino IDE menus.
In this folder, you will find the exported binary in one of two subfolders (depending on whether you selected the "Arduino Due (Programming Port)" or "Arduino Due (Native USB Port)" board.
build/arduino.sam.arduino_due_x_dbgbuild/arduino.sam.arduino_due_x
This use of subfolders for the export is the only difference between the behavior of Arduino IDE 2.x and 1.x (Arduino IDE 1.x exports into the root folder of the sketch. You would get a .bin file even using Arduino IDE 1.x
It might be useful if you tell us why you want this .hex file. The fact you are looking for it might indicate you are following a tutorial intended for the AVR boards (e.g., Uno, Mega) which is not directly applicable to the Due.
Hello, thanks for info. I'm using Arduino IDE 2.0 since few hours. I was seeing the difference between Nano and Mega with same IDE, for which I have compiled HEX.
I've read about IDE 2.x doesn't give HEX files but I want to know if IDE can upload BIN or HEX to Due. Thanks in advance for further notes
Not directly. The upload process in the Arduino IDE always works like this:
- Compile the sketch into a binary.
- Upload the binary to the board.
There is no way to skip step (1).
However, it is possible to use the upload tool directly to upload the binary file to the board (this is one of the use cases for the IDE's Sketch > Export Compiled Binary feature) .
Try this:
- Select File > Preferences... from the Arduino IDE menus.
- Check the box next to Show verbose output during > ☐ upload.
- Click the OK button.
- Select the Due board from the Tools > Board > Arduino SAM Boards (32-bits ARM Cortex-M3) menu in the Arduino IDE.
- Open any sketch that will compile for the Due.
- Select Sketch > Upload from the Arduino IDE menus.
- Wait for the upload to finish.
Now study the contents of the black "Output" view at the bottom of the Arduino IDE window. There you will see the bossac command the Arduino IDE ran to upload to the board (the IDE does not do the upload directly, but instead uses an appropriate standard flashing tool).
You could run that same command from the command line to do an upload of the binary file without compiling.
In the case of the Due and other ARM-based Arduino boards that use this bossac command line tool, you also have the option of using the BOSSA tool for the upload in case you prefer a GUI over a command line.
This is the upstream project:
https://www.shumatech.com/web/products/bossa
Arduino maintains their own version of BOSSA, which has some (poorly documented) modifications:
It is this modified version of bossac that is used by the Arduino IDE, and found at the path you will see in the command in the verbose upload output.