I am interested in learning how the Arduino IDE handles parameters in order to correctly upload hex files with avrdude.

I found this in boards.txt:

uno.name=Arduino/Genuino Uno





There is this in platform.txt:

# AVR Uploader/Programmers tools
# ------------------------------


tools.avrdude.upload.params.quiet=-q -q
tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"

tools.avrdude.program.params.quiet=-q -q
tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i"

tools.avrdude.erase.params.quiet=-q -q
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m

tools.avrdude.bootloader.params.quiet=-q -q
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m

This line is particularly interesting:

tools.avrdude.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"

It seems like these variables are corresponding:

{cmd.path} --> tools.avrdude.cmd.path
{config.path} --> tools.avrdude.config.path
{upload.verbose} --> tools.avrdude.upload.params.verbose
{build.mcu} --> uno.build.mcu
{upload.protocol} --> uno.upload.protocol
{serial.port} --> ?
{upload.speed} --> uno.upload.speed
{build.path} --> ?
{build.project_name} --> ?

It seems these are likely used in the Java code for the IDE. There are obviously a few I am unsure of. I would guess these are considered user inputs in the IDE. Though I am by no means a Java or JavaScript programmer.

Where are these variables explicitly defined in the Arduino library? (e.g. {runtime.tools.avrdude.path}, {path}, {cmd.path} ....) Or how do they get defined by IDE?

  • where can I find, Boards.txt Platform.txt programmers.txt file. I use - Mac Mojave 10.14.6 Arduino iDE - 1.8.12 When I run the data logger code (to save in SD card) I am getting /Users/placidafernando/Library/Caches/Homebrew Error. I reinstalled Brew and Avrdude. I. see it has installed under when I look via Terminal. Cannot see from MAC apple man /Users/myUserID/Library/Caches/Homebrew But my sketch and Arduino is in /Documents libraries Following message is due to IDE or Arduino-CLI unable to fine the avrdude.tar file in the current directory? I am npt a big mac user. How can I set the path Commented Jan 31, 2021 at 7:30
  • @ShaunChristianFernando you should probably just ask your own question.
    – wgwz
    Commented Feb 1, 2021 at 15:46

2 Answers 2


There are 3(or 4) places that you need to look at to know how to upload.
There is the boards.txt file and the platform.txt file.
You can consider a platform.txt file line


as (in linux in windows replace ${xx} by %xx%)

set tools.avrdude.path ${runtime.tools.avrdude.path}

and the board.txt for the selected board like



set bootloader.tool avrdude

The arduino ide uses the following string to know the upload command environment variable


This way it knows the command to upload is

"{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"

{cmd.path} is hardcoded as tools.${bootloader.tool}.cmd.path which equals {path}/bin/avrdude
where {path} is to be understood as tools.${bootloader.tool}.path wich equals {runtime.tools.avrdude.path}.
{runtime.tools.avrdude.path} is defined by the boardsmanager based n the json file and the location where the boardsmanager extracted the download.

So that makes 3 files: boards.txt, platform.txt and json file and some hard coding.

A 4th file comes into play when you use the "other upload commands". These are located in the programmers.txt file.

IMHO Arduino IDE core team did not opt for the simplest solution to define these things. They also change the way they work from time to time.
If you use a makefile know that a lot of people have done this already so it may be a good idea to "reuse other peoples work" instead of "reinventing the wheel". It is not so easy or straightforward.

Note I know all these things because I implemented the Arduino eclipse IDE. As far as I know none of this is documented.


The Arduino library is about what runs on the target, while the "IDE" (not sure if it can still be called IDE, as now they try to do also command line) is about everything else.

But my impression is that if you are ready to ask these sort of question, you could consider dropping the IDE and moving to a more standard Makefile approach. Or Maybe Eclipse, where you still have the IDE, but you can define everything in a more standard way.

The Arduino approach is good to get people with little experienced started, but after a while one started to feel its limitations.

  • I've used a makefile approach. So I am now interested in finding out how and where the parameters that get sent to avrdude are defined. More specifically the variables involved in tools.avrdude.upload.pattern.
    – wgwz
    Commented Nov 2, 2015 at 15:45
  • Not sure I understand you. Do you want to know how to invoke avrdude by replicating what the IDE does? Commented Nov 2, 2015 at 17:08
  • I want to know how to choose the parameters that need to be sent to the avrdude program for a given board type. I have found where the flags are settools.avrdude.upload.pattern. I am unsure of how they are set. Please see the block in my post with arrows signifying "corresponding". All the variables prefixed with uno, I understand where those values come from (boards.txt). But the variables prefixed with tools and the ? marks, I am unsure of where those are defined. I would like to know where those are defined.
    – wgwz
    Commented Nov 2, 2015 at 17:24
  • Ok, my bad, I should have asked an open question. Next try: what are you trying to achieve with this? Why do you want to know this? Commented Nov 2, 2015 at 18:38
  • I want to know this because I want wrap the Arduino C library for use with Python. I want to know this because it is part of the design for how the wrapper would work, i.e. the upload process.
    – wgwz
    Commented Nov 2, 2015 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.