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?
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.
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?
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.
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.
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.
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..