Compiler

Where is arduino compiler located in the github repo? And how it works (in simple).

Arduino uses the standard Atmel gcc compiler. You can find the toolchain on the Microchip website (they purchased Atmel)

Atmel???

@TomasRoj
if you are on Mac you can use homebrew (terminal tools) and install your own toolchain, but it takes some figuring out and experience to make it work.

For a beginner (I am guessing you are) using Arduino and its builder can help you learn more about it.
The builder Arduino IDE uses is located here, and it’s called arduino-builder
https://github.com/arduino/arduino-builder

this builder automates the firmware compilation process and uses the tools which are needed for the particular target architecture

this means that there’s no simple answer to your question, and the compiler depends on the selected architecture and board.
Boards manufactured by Arduino are currently based on AVR or SAMD microcontroller, which means two separate compilers are used:

  • avr-g++
  • arm-none-eabi-g++

It can be pretty overwhelming for a beginner to dive into the sea of information required to go behind the scene, but I invite you to feed your curiosity and explore this incredible world.
I have started exactly that way, over a decade ago :slight_smile:

What is toolchain? I am not beginner with tech but I am new into this arduino community.

Toolchain is the collection of tools that allow you to go from source to executable.

So can I make some program what will make binary and upload it via theese toolchains into arduino uno? There is no reason to do that if I can do that in IDE but just as a test.

I recommend doing this:

  • File > Preferences
  • Check the boxes next to "Show verbose output during: compilation, upload)".
  • Click "OK".
  • Sketch > Upload

After the upload finishes, examine the contents of the black console window at the bottom of the Arduino IDE window. There, you will see the commands the Arduino IDE used to compile and upload the sketch to your Arduino. There you will find the location of the tools on your computer. Note that this can be dependentent on which board you have selected from the Arduino IDE's Tools > Board menu. A different toolchain will be used if you have Arduino/Genuino Uno selected than would be if you have Arduino MKRZERO selected, and so on. You can run those commands from the command line if you prefer.

There is a lot of documentation available for the tools that make up the toolchains. You won't find it on arduino.cc because Arduino didn't create these tools. Instead, Arduino uses standard, high quality, free, open source tools that are used widely throughout the industry by hobbyists and professionals alike, whether they prefer the Arduino IDE, a makefile, or whatever. A little searching for any given tool name will give you all the information you can stand.