Custom ISP programmers.txt on 2.x and macOS. Location, structure

Hi,

It's been I while since I've used Arduino IDE and things have quite changed in 2.x :slight_smile:

I have been using OLIMEX AVR-ISP500-TINY to burn bootloaders, do some stuff with bare ATmegas on breadbord w/ internal clock, ATtiny stuff.

Currently I have not been able to make this programmer to appear in Arduino IDE.

Previously I used programmers.txt to define the programmer, such as

olimexisp500tiny.name=Olimex AVR-ISP500-TINY
olimexisp500tiny.communication=serial
olimexisp500tiny.protocol=stk500v2
olimexisp500tiny.program.tool=avrdude
olimexisp500tiny.program.protocol=stk500v2
olimexisp500tiny.program.extra_params=-P{serial.port}

I've read the manual

which suggests, that programmers.txt should be placed under Sketchbook dir which when left untouched in Arduino prefs points to ~/Documents/Arduino/ resulting in path ~/Documents/Arduino/hardware/arduino/avr/programmers.txt. Created the dir tree. I have also tried different directory structures, based on random posts.

Doc also states

Starting with Arduino IDE 1.8.13 (and in all relevant versions of other Arduino development tools), only the programmers defined by the board and core platform of the currently selected board are available. For this reason, platforms may now need to define copies of the programmers that were previously assumed to be provided by another platform.

which leaves me more puzzled about how to add this programmer on 2.x.

Also, I found this open issue Changes to programmers.txt are not recognized · Issue #591 · arduino/arduino-ide · GitHub which does not help, knowing that there might be side effects.

Could someone please hint on where and how to add programmer definition on macOS, Arduino IDE 2.0.4.

Thank you!

Excellent work tracking down that reference! The mentioned change is indeed the cause of your custom programmer no longer being available. This loss of support for packaging custom programmer definitions in a dedicated platform was an unfortunate side effect of what was otherwise a very beneficial change.

You will need to add your custom to the programmers.txt file of the platforms of any boards you want to use as a target with the programmer.

You can find the location of the platform by compiling any sketch for the target and then examining Arduino IDE's verbose compilation output:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "Show verbose output during: ☐ compilation".
  3. Click the "OK" button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to finish.
  6. Click on the black "Output" panel at the bottom of the Arduino IDE window.
  7. Scroll the panel all the way up to the top.
  8. Look for the line that starts with "Using board ...".
    For example:
    Using board 'uno' from platform in folder: 
    C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
    

The path you see in that output line is the location of the board's platform. You will find the programmers.txt file under that path.

Thanks!

As a reference built for Dueminalove both on macos and MSW10, which gave me paths respectively

  • ~/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/programmers.txt
  • %LOCALAPPDATA%\Arduino15\packages\arduino\hardware\avr\1.8.6\programmers.txt

Entered

olimexisp500tiny.name=Olimex AVR-ISP500-TINY
olimexisp500tiny.communication=serial
olimexisp500tiny.protocol=stk500v2
olimexisp500tiny.program.protocol=stk500v2
olimexisp500tiny.program.tool=avrdude
olimexisp500tiny.program.tool.default=avrdude
olimexisp500tiny.program.extra_params=-P{serial.port}

but programmer still does not show up.

Clearing

  • ~/Library/Application Support/arduino-ide/
  • %APPDATA%\arduino-ide\

does not help either (ref: Changes to programmers.txt are not recognized · Issue #591 · arduino/arduino-ide · GitHub)

Messed also with ~/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino17/etc/avrdude.conf as tried using avrdude from terminal directly to push hex.

programmer
  id    = "olimexisp500tiny";
  desc  = "Olimex AVR-ISP500-TINY";
  type  =  "stk500v2";
  connection_type = serial;
;

It seems that programmer adding does not work. To test, just dummyclone AVR ISP entry, it should show up

avrispdummyclone.name=AVR ISP Dummy Clone
avrispdummyclone.communication=serial
avrispdummyclone.protocol=stk500v1
avrispdummyclone.program.protocol=stk500v1
avrispdummyclone.program.tool=avrdude
avrispdummyclone.program.tool.default=avrdude
avrispdummyclone.program.extra_params=-P{serial.port}

Try this

  1. If Arduino IDE is running, select File > Quit from the Arduino IDE menus to close all windows.
  2. Open the file at the following path in a text editor:
    ~/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/programmers.txt
    
  3. Add the following to the file:
    olimexisp500tiny.name=Olimex AVR-ISP500-TINY
    olimexisp500tiny.communication=serial
    olimexisp500tiny.protocol=stk500v2
    olimexisp500tiny.program.protocol=stk500v2
    olimexisp500tiny.program.tool=avrdude
    olimexisp500tiny.program.tool.default=avrdude
    olimexisp500tiny.program.extra_params=-P{serial.port}
    
  4. Save the file.
  5. Delete the folder at the following path:
    ~/Library/Application Support/arduino-ide/
    
  6. Start Arduino IDE.
  7. Select any board from the Tools > Board > Arduino AVR Boards menu in Arduino IDE.

You should now find a "Olimex AVR-ISP500-TINY" item in the Tools > Programmer menu:

@ptillisch thanks for chiming in.

Your suggested workflow is exactly what I did #3

FYI. This is an old x64 mac, it had clean install recently thus has not had Arduino 1.x installs before. I observe same issue on MSW10 too, which makes this puzzling.

Arduino IDE 2.1.0, CLI 0.32.3

Just rm -rf-ed

~/Documents/Arduino
~/Library/Arduino15
~/Library/Application\ Support/arduino-ide/
~/Library/Logs/Arduino\ IDE
/Applications/Arduino\ IDE.app
  • Installed Arduino (IDE 2.1.0, CLI 0.32.3)
  • Launched once
  • Installed AVR boards core so that hardware dir actually populates
  • Exited
  • Did changes in ~/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/programmers.txt
  • rm -rf ~/Library/Application\ Support/arduino-ide/

Nope. But it works for you. Heisenbug?

Mkay, at last

trashed all of this, key apparently being ~/.arduinoIDE

~/Documents/Arduino
~/Library/Arduino15
~/Library/Application\ Support/arduino-ide/
~/Library/Preferences/cc.arduino.IDE2.plist
~/Library/Logs/Arduino\ IDE
~/.arduinoIDE
/Applications/Arduino\ IDE.app

For reference also followed up with

  • Installed Arduino (IDE 2.1.0, CLI 0.32.3)
  • Launched once
  • Installed AVR boards core so that hardware dir actually populates
  • Exited
  • Did changes in ~/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/programmers.txt
  • rm -rf ~/Library/Application\ Support/arduino-ide/

Shows up now!

Screenshot 2023-04-20 at 18.47.02

Phew :slight_smile:

Yay! Nice work getting it working. I was planning to suggest you try deleting the ~/.arduinoIDE folder specifically. I didn't find it was necessary as a workaround for Changes to programmers.txt are not recognized · Issue #591 · arduino/arduino-ide · GitHub, but it is a place where Arduino IDE stores application state data in addition to ~/Library/Application Support/arduino-ide/ so it definitely could be a culprit in this sort of UI caching glitch.

I delete both of those folders when I want to effectively simulate the fresh installation conditions while beta testing the IDE.

Something you should note is that your preferences are stored in ~/.arduinoIDE, so if you had previously made any adjustments to your preferences (e.g., "Additional Boards Manager URLs"), you may want to go back into the "Preferences" dialog and set them as you like.

1 Like

Yeah, trashing everything obviously trashed ... everything. But it is ok.

I had Teensy added https://www.pjrc.com/teensy/package_teensy_index.json and board definitions installed (maybe that somehow interfered with programmers cache). Just reinstalled Teensy defs and the programmer still shows up so who knows.

BTW, just burnt bootloader to a blank 328 as well as sketch uploading via programmer works :saluting_face: :tada:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.