Can anybody point me to documentation on how to create a board.txt file for a board I am developing and compatible with the 2.x ide? I can’t seem to even find example board files with the 2.x ide. Thanks so much.
Start in C:\Users<username>\AppData\Local\Arduino15\packages
Pick a board, look in the hardware folder and drill down to see board.txt
Hi @iitgrad. The documentation for boards.txt
and the rest of the Arduino boards platform framework is here:
https://arduino.github.io/arduino-cli/latest/platform-specification/
I do think it is useful to use existing boards platforms as a reference. The "Arduino AVR Boards" platform is a pretty good reference as a complete standalone platform. You can find it on your computer at the location mentioned by @UKHeliBob (assuming you are using Windows) or in this GitHub repository:
If your boards platform is for microcontrollers of the same architecture as an existing platform, you should be aware of the useful referencing capability of the framework:
This allows the creation of a minimal platform by referencing resources from another platform installation. Some examples of this type of platform:
Thanks UKHeliBob, but sorry I neglected to mention that I am on a Mac.
Kevin L McQuown
Principal Engineer
Windy City Lab, LLC
To book a time with me, click on the link below.
Then your Arduino boards platforms are installed under this folder:
/Users/<username>/Library/Arduino15/packages/
(Where <username>
is your macOS username)
The
Library
folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
Thank you for the guidance. I now have a clearer direction.
I'm working with a custom PCB that incorporates an ATmega2560 microcontroller and a 16MHz external crystal. For USB-to-serial conversion, it's interfaced with a CH340 chip, a more cost-effective alternative to the FTDI chip. While I've successfully uploaded sketches via ArduinoISP using an Arduino Uno, my goal is to burn the bootloader onto the ATmega2560. This step would eliminate the need for ArduinoISP for future programming, simplifying the process for users.
My concern stems from a previous attempt where I selected "Burn Bootloader" with the board set as an Uno. This process seems to rely on the board.txt file of the chosen board configuration. However, during my initial attempt, my board was configured to use its internal oscillator. After burning the bootloader, which was designed for an external crystal, I ended up bricking the board. Unfortunately, my board's design doesn't allow direct access to the crystal pins for reconfiguration.
This time around, I want to ensure I select the correct board.txt file and settings before proceeding with the bootloader burning process. Any advice on this matter would be greatly appreciated.
Correct. So if the target is equivalent to an "Arduino Mega 2560" board then you must select Tools > Board > Arduino AVR Boards > Arduino Mega or Mega 2560 from the Arduino IDE menus.
That doesn't sound right. The chip signature is checked at the start of the "Burn Bootloader" process. If you had the Uno board selected from the Tools > Board menu in Arduino IDE then the process should have simply failed without any changes being made to the ATmega2560's configuration fuses.
If you selected the correct board from the Tools > Board menu then it also should not have occurred since the "Arduino Mega or Mega 2560" board definition is configured to use the external crystal.
Select Tools > Board > Arduino AVR Boards > Arduino Mega or Mega 2560 from the Arduino IDE menus.
Yes, sorry I think I am not being clear with actually two boards. I have a board that has the atmega2560 but I also have boards with the atmega386. They now all have external crystals but originally I thought I could get away with just using the internal clock. But when I realized that inadvertently setting the lfuse bit to use the external clock (and it not being present) which I did by trying to burn the bootloader I have changed my design to always have a 16Mhz external crystal. The cost is minimal. That being said, this taught me that the "burn bootloader" does more than just upload the bootloader but changes the fuse bits based on a config file.
Ah, I got it. I had the impression you were saying the very opposite (that the "Burn Bootloader" operation configured the fuses to use the internal clock).
If you would like a board definition for the internal clock, I recommend the excellent 3rd party MiniCore boards platform for the ATmega328P:
And MegaCore for the ATmega2560:
After selecting the board in Arduino IDE (i.e., Tools > Board > MiniCore > ATmega328, Tools > Board > MegaCore > ATmega2560), you will find some new menus will appear under the Tools menu. You can use those to adjust the configuration for your hardware. One of these menus is Tools > Clock, which allows you to configure whether the internal oscillator should be used or an external clock, as well as the clock speed.
Yeah. This is important to understand in the case of MiniCore and MegaCore because even when you already have a bootloader on your board, you might need to perform a "Burn Bootloader" operation after changing one of the custom Tools menu items (e.g., Tools > BOD) just to reconfigure the fuses on the board. In fact, the "MCUdude" platforms even have a Tools > Bootloader > No bootloader option for use when you are using an ISP programmer to upload to the board and so have no waste flash memory to reserve a boot section. Even with this "No bootloader" configuration, you will still use a "Burn Bootloader" operation when you want to set fuses, even though you aren't actually flashing a bootloader at all!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.