boards.txt

Arduino IDE 1.8.1 on Windows 7 64b:

In the boards menu there is an option for "Arduino Pro or Pro Mini".
After selecting this you have to select 1 of 4 options: Atmega328 or Atmega168 and 5V/16MHz or 3.3V/8MHz."
I want to add a few more options (ie "Atmega168 3.3V 8MHz internal oscillator") and added the following in the appropriate location in boards.txt (in the "pro.name-Arduino Pro or Pro Mini" section):

## Arduino Pro or Pro Mini (3.3V, 8 MHz Internal) w/ ATmega328
## --------------------------------------------------
pro.menu.cpu.8MHzatmega328=ATmega328 (3.3V, 8 MHz Internal)
pro.menu.cpu.8MHzatmega328.upload.maximum_size=30720
pro.menu.cpu.8MHzatmega328.upload.maximum_data_size=2048
pro.menu.cpu.8MHzatmega328.upload.speed=57600
pro.menu.cpu.8MHzatmega328.bootloader.low_fuses=0xD2
pro.menu.cpu.8MHzatmega328.bootloader.high_fuses=0xDA
pro.menu.cpu.8MHzatmega328.bootloader.extended_fuses=0x05
pro.menu.cpu.8MHzatmega328.bootloader.file=atmega/ATmegaBOOT_168_atmega328_pro_8MHz.hex
pro.menu.cpu.8MHzatmega328.build.mcu=atmega328p
pro.menu.cpu.8MHzatmega328.build.f_cpu=8000000L

What happens now is that I still get only 4 options, but the second one ("Atmega328 (3.3V 8 MHz") is replaced by the new one.

What do I have to do to add instead of replace options in that location?

I have these boards.txt files in 3 locations:

c:\program files (x85)\Arduino\hardware\arduino\avr
c:\users\me\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.1.17
c:\users\me\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.1.16\

I changed the file in all 3 locations, identically.

Each menu option needs to have a unique identifier, 8MHzatmega328 is already used.

brice3010:
c:\program files (x85)\Arduino\hardware\arduino\avr
c:\users\me\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.1.17
c:\users\me\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.1.16\

  • You can find the active package by doing this:
  • Select one of the package's boards from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor (or any other example sketch of the SPI library.
  • Sketch > Show Sketch Folder
  • Move up folder levels until you get to the one with the boards.txt file in it.

I'd recommend creating your own custom hardware package when you want to do this sort of thing. The reason is that anytime you update to a new version of the Arduino AVR Boards/Arduino IDE you would need to redo the changes as you have done them now.

Just FYI, there is an excellent 3rd party hardware package:

that has just about any configuration you could possibly want and also uses the optiboot bootloader, rather than the buggy and bloated bootloader used by the Pro Mini. However, I think learning how to create custom hardware definitions is very useful.

pert:
Each menu option needs to have a unique identifier, 8MHzatmega328 is already used.

  • You can find the active package by doing this:
  • Select one of the package's boards from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor (or any other example sketch of the SPI library.
  • Sketch > Show Sketch Folder
  • Move up folder levels until you get to the one with the boards.txt file in it.

I'd recommend creating your own custom hardware package when you want to do this sort of thing. The reason is that anytime you update to a new version of the Arduino AVR Boards/Arduino IDE you would need to redo the changes as you have done them now.

Does this entail creating a new header with the likes of this one:

##############################################################
pro.name=Arduino Pro or Pro Mini
pro.upload.tool=avrdude
pro.upload.protocol=arduino
pro.bootloader.tool=avrdude
pro.bootloader.unlock_bits=0x3F
pro.bootloader.lock_bits=0x0F
pro.build.board=AVR_PRO
pro.build.core=arduino
pro.build.variant=eightanaloginputs

pert:
Each menu option needs to have a unique identifier, 8MHzatmega328 is already used.

  • You can find the active package by doing this:
  • Select one of the package's boards from the Tools > Board menu
  • File > Examples > SPI > BarometricPressureSensor (or any other example sketch of the SPI library.
  • Sketch > Show Sketch Folder
  • Move up folder levels until you get to the one with the boards.txt file in it.

I store my sketches and libraries in Google Drive, but there is no hardware folder present in my Google Drive.

Is there another way to find out which one is actively used?

Edit: the most recent folder seems to be the 1.6.17; around that time I installed 1.8.1 IDE. I assume that is the one to use? As well as the one in the c\Program Files (x86).. this has the same date (9/1/2017), but the time there is a half hour more recent.

brice3010:
I store my sketches and libraries in Google Drive, but there is no hardware folder present in my Google Drive.

The SPI library is bundled with the Arduino AVR Boards package, that's why I specified that library's example sketch.

brice3010:
Is there another way to find out which one is actively used?

Yes, check File > Preferences > Show verbose output during: > compilation, compile a sketch, and then examine the output in the console window. You'll see the path in there somewhere.

pert:
The SPI library is bundled with the Arduino AVR Boards package, that's why I specified that library's example sketch.

I see; but the issue is that even when opening an AVR boards package library example, the Google drive site is used.

pert:
Yes, check File > Preferences > Show verbose output during: > compilation, compile a sketch, and then examine the output in the console window. You'll see the path in there somewhere.

Hi pert, sorry for the dump here; the verbose output nowhere refers to the boards.txt in the users folders.
I assume it will be the one in the program folders that is being used.

I will try and see what happens when modifying them one by one.

Thks for your input!

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Mysafety\AppData\Local\Arduino15\packages -hardware C:\Users\Mysafety\Google Drive\documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Mysafety\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Mysafety\Google Drive\documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega168 -vid-pid=0X2341_0X0043 -ide-version=10801 -build-path C:\Users\Mysafety\AppData\Local\Temp\arduino_build_646195 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.0.0 -verbose C:\Users\Mysafety\Google Drive\documents\Arduino\promini_Blink\promini_Blink.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\Mysafety\AppData\Local\Arduino15\packages -hardware C:\Users\Mysafety\Google Drive\documents\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\Mysafety\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Mysafety\Google Drive\documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega168 -vid-pid=0X2341_0X0043 -ide-version=10801 -build-path C:\Users\Mysafety\AppData\Local\Temp\arduino_build_646195 -warnings=default -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avr-gcc.path=C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2 -prefs=runtime.tools.avrdude.path=C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino8 -prefs=runtime.tools.arduinoOTA.path=C:\Users\Mysafety\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.0.0 -verbose C:\Users\Mysafety\Google Drive\documents\Arduino\promini_Blink\promini_Blink.ino
Using board 'pro' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

When modifying the 3 different boards.txt files one by one I find out it is the "oldest" one (in folder 1.6.16) that has impact.

pert:
I'd recommend creating your own custom hardware package when you want to do this sort of thing. The reason is that anytime you update to a new version of the Arduino AVR Boards/Arduino IDE you would need to redo the changes as you have done them now.

Can you give an example how to do this? How do I write the header for example?

pert:
Just FYI, there is an excellent 3rd party hardware package:
GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB
that has just about any configuration you could possibly want and also uses the optiboot bootloader, rather than the buggy and bloated bootloader used by the Pro Mini. However, I think learning how to create custom hardware definitions is very useful.

Thank you, I will use that.

brice3010:
Using board 'pro' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr[/i]

Looks like that's the one.

brice3010:
Can you give an example how to do this? How do I write the header for example?

I've attached an example package. To install it:

  • Download the attached file
  • Copy the folder brice3010 from the downloaded file to {sketchbook folder}/hardware. You can find the location of the sketchbook folder at File > Preferences > Sketchbook location.
  • Restart the Arduino IDE if it's running.
  • You should now see the "brice3010 Arduino Pro or Pro Mini" option in the Tools > Board menu.

The package is currently just a copy of the Arduino Pro or Pro Mini hardware definition with a few minor changes. The Arduino IDE allows you to reference cores, tools, and variants from another package, which allows you to create very minimal packages that don't require a lot of maintenance to keep them up to date with changes to the Arduino IDE. In boards.txt you'll see I've changed:

pro.upload.tool=avrdude

to:

pro.upload.tool=arduino:avrdude

changed:

pro.bootloader.tool=avrdude

to:

pro.bootloader.tool=arduino:avrdude

changed:

pro.build.core=arduino

to:

pro.build.core=arduino:arduino

and changed:

pro.build.variant=eightanaloginputs

to:

pro.build.variant=arduino:eightanaloginputs

The "arduino:" part tells the Arduino IDE it's a reference to the package by the vendor named "arduino" and the architecture, avr (as indicated by the name of the architecture folders), is matched thus this means Arduino AVR Boards' avrdude tool, arduino core, and eightanaloginputs variants will be used by your package. Unfortunately the Arduino IDE doesn't allow you to reference bootloaders so you'll notice the standard bootloader of the pro mini is included in the package.

You can get more information on all this at:

brice3010.zip (25.7 KB)

pert:
Looks like that's the one.
I've attached an example package. To install it:

  • Download the attached file
  • Copy the folder brice3010 from the downloaded file to {sketchbook folder}/hardware. You can find the location of the sketchbook folder at File > Preferences > Sketchbook location.
  • Restart the Arduino IDE if it's running.
  • You should now see the "brice3010 Arduino Pro or Pro Mini" option in the Tools > Board menu.

The package is currently just a copy of the Arduino Pro or Pro Mini hardware definition with a few minor changes. The Arduino IDE allows you to reference cores, tools, and variants from another package, which allows you to create very minimal packages that don't require a lot of maintenance to keep them up to date with changes to the Arduino IDE. In boards.txt you'll see I've changed:

pro.upload.tool=avrdude

to:

pro.upload.tool=arduino:avrdude

changed:

pro.bootloader.tool=avrdude

to:

pro.bootloader.tool=arduino:avrdude

changed:

pro.build.core=arduino

to:

pro.build.core=arduino:arduino

and changed:

pro.build.variant=eightanaloginputs

to:

pro.build.variant=arduino:eightanaloginputs

The "arduino:" part tells the Arduino IDE it's a reference to the package by the vendor named "arduino" and the architecture, avr (as indicated by the name of the architecture folders), is matched thus this means Arduino AVR Boards' avrdude tool, arduino core, and eightanaloginputs variants will be used by your package. Unfortunately the Arduino IDE doesn't allow you to reference bootloaders so you'll notice the standard bootloader of the pro mini is included in the package.

You can get more information on all this at:
Arduino IDE 1.5 3rd party Hardware specification · arduino/Arduino Wiki · GitHub

Hi pert, thank you so much for your invaluable help and explanation!

I will be studying the reference to 3de party hardware in your link. If I have questions I will open a new thread since this is getting off topic.

I have downloaded the zip file and will start experimenting with it; I install it in the Drive folder containing my sketches and where I now have a "hardware" folder. I keep you posted in pm's.

I have to tell you that this thread has started running in the same context as another query I had posted (Running Arduino Pro Mini 5V,16MHz board @ 3.3V): Running Arduino Pro Mini 5V,16MHz board @ 3.3V - Project Guidance - Arduino Forum
where Jiggy-Ninja has been doing a lot of problemsolving.

Just wanted to let you know, the thread topics are different but the discussion there has been converging to the same issue: boards.txt

Have a great day,
Erik

pert:
Just FYI, there is an excellent 3rd party hardware package:
GitHub - MCUdude/MiniCore: Arduino hardware package for ATmega8, ATmega48, ATmega88, ATmega168, ATmega328 and ATmega328PB
that has just about any configuration you could possibly want and also uses the optiboot bootloader, rather than the buggy and bloated bootloader used by the Pro Mini. However, I think learning how to create custom hardware definitions is very useful.

Last question pert: should I better replace the current bootloader in the Pro Mini with the optiboot version?

Erik

pert:
Looks like that's the one.

No it is not: I changed the boards.txt there and no effect. When I change boards.txt in the ..\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.16\ folder it does have an effect.
Strange.

I still do not understand why there are any files at all in the ..\AppData\Local.. locations at all. And why I have two: ..\1.6.16.. and ..\1.6.17..

brice3010:
I still do not understand why there are any files at all in the ..\AppData\Local.. locations at all.

That's where the package is installed when you do an update using Boards Manager.

brice3010:
And why I have two: ..\1.6.16.. and ..\1.6.17..

That's not normal. Boards Manager must have failed to remove the previous version when you updated.

bonsoir
comment on ajoute sur arduino le atmegaS128 dans le boards.txt ?merci d'anvance