Strange problem using AVR ISP MKII to program Arduino Pro Mini (China)

Please help…, I am new in PlatformIO and learning coding using Arduino Pro Mini. For a while I manage to upload using the AVR ISP MKII (using the recomended PlatformIO.ini) that I bought via Aliexpress.

Then, recently I bought a HV Paralled programmer to experiment on unlocking MCUs, however due to the obsolete onboard USB chip, I tried to install different driver but without success.

In my surpriced, when going back to AVR ISP MKII and PlatformIO…Building the code is a Success but not for Uploading, it is not working anymore. I tried to uninstall and re-install two times, and even remove the installed folder manually still the error (I was in one of the thread here).

AVR ISP_mkII is still communicating with Michrochip Studio 7.0

Platformio.ini:

[env:program_via_AVRISP_mkII]
platform = atmelavr
board = pro16MHzatmega328
;board = ATmega328p
framework = arduino
upload_protocol = custom
upload_port = usb
upload_flags =
    -C
    ; use "tool-avrdude-megaavr" for the atmelmegaavr platform
    ${platformio.packages_dir}/tool-avrdude/avrdude.conf
    -p
    $BOARD_MCU
    -P
    $UPLOAD_PORT
    -c
    stk500v2
upload_command = avrdude $UPLOAD_FLAGS -U flash:w:$SOURCE:i

Here is the Uploading error message

Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.5% (used 51 bytes from 2048 bytes)
Flash: [=         ]   8.8% (used 2696 bytes from 30720 bytes)
Configuring upload protocol...
AVAILABLE: custom
CURRENT: upload_protocol = custom
Uploading .pio\build\program_via_AVRISP_mkII\firmware.hex

avrdude done.  Thank you.

*** [upload] Error 1
====================================================================== [FAILED] Took 1.70 seconds ======================================================================
The terminal process "C:\Users\L\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

Hm, error messages seem to be swallowed – that might be (new) general bug in PlatformIO.

What happens when you execute the project task Advanced → Verbose Upload?

Thank you for the reply, I have not tried that, I will check and share it.

Please see the message created when I do the Verbose Upload, thanks for the advice.

Does your programmer appear as a serial port in the device manager or as some sort of USB device?

If it’s a serial port, try replacing usb with the serial port name, e.g., COM3. Othehrwise, try removing the lines

so that maybe some autodetection in avrdude kicks in.

Its not showing any COM when I am plugging the AVR ISP MKII, but only showing in Microchip tool

What does Details → Hardware ID say for the AVRISP mkII? It should reveal the PID & VID.

grafik

The hardware-ID property, not the device description property.

… click THERE and then on “Hardware IDs”

1 Like

The USB VID & PID of 0x03eb and 0x2104 definitely match what avrdude is looking for.

I suggest you use https://zadig.akeo.ie/ to load WinUSB drivers for the AVRISP mkII device and retry with your original config. avrdude needs that to access the USB device. Use Options → List all devices in Zadig to make your device selectible.

If WinUSB does not work, try loading libusb-win32 drivers.

Thank you so much, I will try it. Happy New Year.

Eureka!!! Thank you so much sir, it can Upload now… libUSB-win32 is working!
Thank you for your patience and time…Happy New year…

1 Like