hf98a6r7fayh
hf98a6r7fayh

Reputation: 11

what are the arduino IDE build steps for a sketch?

I'm trying to build my own, terminal based environment to build and upload programs to a custom board I Have with an SAMD21 (Like in the arduino MKRZERO)

To do so I'm looking at the verbose output of the arduino IDE and trying to move the same commands / build steps to a simple makefile. I have some difficulties trying to understand a few of the steps the arduino IDE does, both at the programming stage, and at the exporting binary stage.

Programming

I have this very simple test code:

void setup() {
// put your setup code here, to run once:

}

int x = 0;

void loop() {
// put your main code here, to run repeatedly:

 x++;
 x--;
 x++;
}

And this is the verbose output on the IDE of a fresh compilation (called verify on the IDE):

https://pastebin.com/LnrC8BSi (sorry cannot post too many characters)

My questions are:

Exporting binaries

The IDE has an option to "export compiled binaries", and the output of that option is:

https://pastebin.com/zGQjgt2h

Which generates the file sketch.ino.with_bootloader.bin that I'm looking for. However, I cannot seem to find what command creates this version with the bootloader included.

I'm using Atmel SAM-ICE Programmer so it's convenient for me to have a binary with the bootloader already included so I don't erase the bootloader on the board when using openocd load command. But I cannot seem to be able to load this with_bootloader.bin file, because it does not contain symbols, and I get this output:

(gdb) file testProgram.ino.with_bootloader.mkrzero.bin 
«/home/user/Arduino/testProgram/testProgram.ino.with_bootloader.mkrzero.bin»: no está en formato ejecutable: file format not recognized
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
aviso: Architecture rejected target-supplied description
aviso: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
Truncated register 16 in remote 'g' packet
(gdb) load
No se especificó un archivo ejecutable.
Use the command «file» or «exec-file».

Any insight on the Arduino IDE build process is highly appreciated, I really want to understand what each step does, and which ones may not be necessary for me

Upvotes: 1

Views: 208

Answers (1)

Nino
Nino

Reputation: 707

Perhaps you should look at Arduino CLI instead of reverse engineering IDE.

Upvotes: 2

Related Questions