AVRisp MKII + Mega168 + Arduino > Please choose Port before uploading

I've got a problem using this programmer ( https://www.diamex.de/dxshop/Diamex-ALL-AVR-ISP-Programmer ) with a Atmega168 connected via ISP (10Pin-Header) and Arduino using Debian.

I think it's a GUI-Problem, because:

avrdude -c avrispmkII -p m168 -P usb -e -v

will result in:

avrdude: Version 6.3
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/xgaduch/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 0000000000000
         AVR Part                      : ATmega168
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no        512    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 0
         Firmware Version Master : 1.32
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9406 (probably m168)
avrdude: safemode: hfuse reads as DD
avrdude: safemode: efuse reads as F9
avrdude: erasing chip

avrdude: safemode: hfuse reads as DD
avrdude: safemode: efuse reads as F9
avrdude: safemode: Fuses OK (E:F9, H:DD, L:FF)

avrdude done.  Thank you.

I added this Board-Package to arduino:


I added My Progger to "arduino-1.8.7/hardware/arduino/avr/programmers.txt" like this:

diamexallavr.name=Diamex All-AVR

reads like:


# ATmega168/168p




atmega168.menu.clock.external15=External 15 MHz

reads like:

name=ATmega Microcontrollers
tools.avrdude.erase.params.verbose=-v -v -v -v
tools.avrdude.erase.params.quiet=-q -q
tools.avrdude.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
tools.avrdude.bootloader.params.verbose=-v -v -v -v
tools.avrdude.bootloader.params.quiet=-q -q
tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params}

tools.avrdude-noefuse.erase.params.verbose=-v -v -v -v
tools.avrdude-noefuse.erase.params.quiet=-q -q
tools.avrdude-noefuse.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
tools.avrdude-noefuse.bootloader.params.verbose=-v -v -v -v
tools.avrdude-noefuse.bootloader.params.quiet=-q -q
tools.avrdude-noefuse.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params}

Sadly, Arduino won't upload anything because I did not (and weren't able to) choose a port for Uploading, since the Programmer is using usb as Protocol&Port (See Attachment Unbenannt.PNG):

Arduino: 1.8.7 (Linux), Board: "ATmega168/168p, External 15 MHz, ATmega168"

Der Sketch verwendet 8658 Bytes (52%) des Programmspeicherplatzes. Das Maximum sind 16384 Bytes.
Globale Variablen verwenden 713 Bytes (69%) des dynamischen Speichers, 311 Bytes für lokale Variablen verbleiben. Das Maximum sind 1024 Bytes.
Bitte wählen Sie vor dem Hochladen einen Port aus

Dieser Bericht wäre detaillierter, wenn die Option
"Ausführliche Ausgabe während der Kompilierung"
in Datei -> Voreinstellungen aktiviert wäre.

I guess, this will be a common issue, but didn't find anything helpfully. Adding the Udev-Rules to create a symlink won't show the Progger under /dev/
What to try next?


This is a known bug of Arduino IDE 1.8.7:

It only occurs if you have never selected a port from the Tools > Port menu. The easiest workaround is to select any port from the Tools > Port menu. Since you're using an ISP programmer, it doesn't make any difference what device that port is for.

If the Tools > Port menu is grayed out and you don't have any device you can plug in that creates a virtual COM port then you would need to use a version of the Arduino IDE other than 1.8.7. You can use Arduino IDE 1.8.6 or if you're feeling adventurous you can use the hourly build of the Arduino IDE since the bug has already been fixed. Please note that the hourly build is intended primarily for beta testing and has not been so thoroughly tested as the production releases of the Arduino IDE.