Changes to programmers.txt are not recognized #591
Labels
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
Describe the problem
🐛 The first time a board is selected, its programmers are cached by the IDE. After that, changes to the
programmers.txt
configuration file of the boards platform are not reflected in the IDE's Tools > Programmer menu.To reproduce
Close all Arduino IDE windows.
Clear the Programmer menu cache by deleting the
C:\Users\<user name>\AppData\Roaming\arduino-ide
(Windows) or~/.config/arduino-ide
(Linux) folder.This is done in order to ensure there are boards available without a cached Programmer menu to compare with the board that has a cache.
Start the Arduino IDE.
Use Boards Manager to install "Arduino AVR Boards" (if it is not already installed).
Select Tools > Board > Arduino AVR Board > Arduino Uno from the Arduino IDE menus.
The Programmer menu entries have now been cached for the "Arduino Uno" board, but not for the other boards of the "Arduino AVR Boards" platform that have not yet been selected in the IDE.
Open the Tools > Programmer menu and take note of the programmers listed there:

Close all Arduino IDE windows
Open
C:\Users\<user name>\AppData\Local\Arduino15\packages\arduino\hardware\avr\<platform version>\programmers.txt
(Windows) or~/.arduino15/packages/arduino/hardware/avr/<platform version>/programmers.txt
(Linux) in a text editor.Add a new programmer definition to the file by adding the following lines to the file:
Modify a programmer definition by changing this line:
to this:
Remove a programmer definition by deleting these lines:
Save the file.
Start the Arduino IDE.
Select Tools > Board > Arduino AVR Board > Arduino Uno from the Arduino IDE menus.
Open the Tools > Programmer menu.

🐛 The menu contents don't reflect any of the changes that were made to
programmers.txt
:Select Tools > Board > Arduino AVR Board > Arduino Leonardo from the Arduino IDE menus.
This is the first time selecting this board so its Programmers menu cache is populated now.
Open the Tools > Programmer menu.

🙂 The menu contents reflect the changes that were made to
programmers.txt
:Select Tools > Board > Arduino AVR Board > Arduino Uno from the Arduino IDE menus.
Select File > Save As... from the Arduino IDE menus.
Save the sketch to any convenient name and location.
ⓘ The purpose of this step is to allow the sketch with the incorrect associated state metadata to be opened after restarting the IDE.
Select File > New Sketch from the Arduino IDE menus.
Open the Tools > Programmer menu.
🙂 The menu contents reflect the changes that were made to
programmers.txt
.Close all Arduino IDE windows.
Delete the "user data" folder at the following path:
<username>
is your Windows username)❗ If looking for it with your file manager or command line, note that the
AppData
folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".<username>
is your Linux username)❗ The
.config
folder may be hidden by default in your file manager and terminal.<username>
is your macOS username)❗ The
Library
folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.⚠ Please be very careful when deleting things from your computer. When in doubt, back up!
Start the Arduino IDE.
Select Tools > Board > Arduino AVR Board > Arduino Uno from the Arduino IDE menus.
Open the Tools > Programmer menu.

🙂 The menu contents reflect the changes that were made to
programmers.txt
.Expected behavior
Tools > Programmer menu always reflects the contents of the
programmers.txt
files at the time the Arduino IDE was started, just as it is in the classic Arduino IDE.Arduino IDE version
2.0.0-beta.12-nightly.20211028
Operating system
Operating system version
Additional context
The `programmers.txt` changes are recognized as expected by Arduino CLI:
Complete modified `programmers.txt` file:
Originally reported at https://forum.arduino.cc/t/programmers-txt-change-ignored/862718
Additional Reports
Workaround
Select File > Quit (or Arduino > Quit Arduino for macOS users) from the Arduino IDE menus if it is running.
Delete the following folder to force Arduino IDE to update the Tools > Programmer menu data:
<username>
is your Windows username)❗ If looking for it with your file manager or command line, note that the
AppData
folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".<username>
is your Linux username)❗ The
.config
folder may be hidden by default in your file manager and terminal.<username>
is your macOS username)❗ The
Library
folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.⚠ Please be very careful when deleting things from your computer. When in doubt, back up!
Start Arduino IDE.
You should now see the expected list of programmers under the Tools > Programmer menu.
Issue checklist
The text was updated successfully, but these errors were encountered: