Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test programmer definition on hardware #1

Closed
per1234 opened this issue Jan 19, 2019 · 31 comments
Closed

Test programmer definition on hardware #1

per1234 opened this issue Jan 19, 2019 · 31 comments

Comments

@per1234
Copy link
Owner

per1234 commented Jan 19, 2019

This issue is for discussion related to the testing.

I don't own an AVR Dragon so I am unable to test the definition.

Some time ago, @nmaas87 mentioned they might be willing to help with this (https://github.com/arduino/Arduino/issues/650#issuecomment-443155601).

@nmaas87, if/when you have a little spare time to work on this project. Please comment here. Thanks! I don't have anything in the repository yet because it's not worth that effort without the ability to test, but I have already worked on this in the past so I should be able to quickly get something up ready to test. I'm hoping to set this up as something installable and updatable via Boards Manager. There is a quirk to the Arduino IDE that may be problematic for that but I don't remember how that impacts this particular project. If Boards Manager installation is not possible, testing will still only require pasting a bit of text into the programmers.txt file in your Arduino AVR Boards installation.

I made the repo private for now since I prefer to publish things after they're in a somewhat workable state.

I also still have some hope that this work can get pushed directly into Arduino AVR Boards, rather than requiring a 3rd party solution. I want to wait until I can confirm this is even possible before I make that proposal to the Arduino developers.

@per1234 per1234 added Waiting For Feedback Progress is on hold until a response from someone is received Help Wanted Seeking someone to help with this issue labels Jan 19, 2019
@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 19, 2019

I got an AVR Dragon and would be willing to test :)!

@per1234
Copy link
Owner Author

per1234 commented Jan 19, 2019

Yay! I'll start working on this now and let you know as soon as I have something ready.

@per1234 per1234 removed the Waiting For Feedback Progress is on hold until a response from someone is received label Jan 19, 2019
@per1234
Copy link
Owner Author

per1234 commented Jan 19, 2019

OK. I have something ready to test. This looks like a lot of steps but most of it is quick, simple stuff. I just like to be very clear in my instructions so there is no room for confusion. Please let me know if you have any questions.


Test Burn Bootloader

  1. (In the Arduino IDE) File > Preferences
  2. In the "Additional Boards Manager URLs" field, enter https://github.com/per1234/test/raw/InoAVRDragon-BoardsManager/package_per1234_InoAVRDragon_index.json If you already have a URL in that field, separate the URLs with a comma.
  3. Click "OK".
  4. Tools > Board > Boards Manager
  5. Wait for downloads to finish.
  6. Scroll down until you see "InoAVRDragon by per1234". Click on it.
  7. Click "Install".
  8. Wait for installation to finish.
  9. Click "Close".
  10. File > Preferences
  11. Uncheck the box next to "Show verbose output during: compilation". This is to keep the output clean of irrelevant compilation commands when you're testing Upload Using Programmer.
  12. Check the box next to "Show verbose output during: upload".
  13. Tools > Programmer > AVR Dragon (workaround)
  14. Connect your AVR Dragon to a target board/microcontroller. I recommend against using an especially valuable target device for testing, just in case.
  15. Tools > Board > select the appropriate board
  16. Tools > Burn Bootloader
  17. Click in the black console window at the bottom of the Arduino IDE window
  18. Press Ctrl+A to select all the text.
  19. Press Crl+C to copy the selected text to the clipboard.
  20. Paste the copied text in a reply here.

The expected behavior is that the Burn Bootloader process will fail:

avrdude: usbdev_open(): did not find any USB device "usb"

However, if you scroll up the black console window at the bottom of the Arduino IDE window, You should see that two avrdude commands were run. The first command should have completed successfully and the second command was the one that failed with the above error. The trick to the workaround we are currently testing is that the commands normally run by the Arduino IDE in two parts:

  1. Erase flash and set fuses
  2. Flash bootloader

are now being done all in the first command. So the bootloader is burned and the fuses are set and it doesn't matter that the second command fails because everything it normally does is already done.


Test the bootloader:

  1. Disconnect the AVR Dragon from the target.
  2. Open a sketch that will give you a clear indication that it's running (e.g. Blink).
  3. Do a standard serial upload to your target.
  4. Confirm that the sketch is running.
  5. Modify the sketch in a way that gives a different obvious behavior (e.g. change blink rate)
  6. Do a standard serial upload to your target.
  7. Confirm that the sketch is running.

Test Upload Using Programmer

  1. Connect the AVR Dragon to your target.
  2. Open a sketch that will give you a clear indication that it's running (e.g. Blink).
  3. Sketch > Upload Using Programmer
  4. Confirm that the sketch is running.
  5. If the process fails, copy the full output from the console window and paste it in a reply here.

Note that when you do Upload Using Programmer the bootloader is erased. After doing this, you will need to do another Burn Bootloader before you can go back to doing standard uploads.

Upload Using Programmer should work properly, with no error.


Now, I realize the situation with Burn Bootloader in this workaround is far from ideal. It's the best I can do from an easily installable 3rd party hardware package due to a quirk of the Arduino IDE (platform.txt associated with the selected board is used for Burn Bootloader, rather than the platform.txt associated with the selected programmer). This means that I can only affect the behavior of Burn Bootloader via the programmer definition, which doesn't give me much to work with. There are a couple of additional hacky aspects to this regarding the configuration fuses that are a bit more technical, which I can explain if you're interested in that sort of thing. My feeling is that a well documented hacky way of easily making the AVR Dragon work with the Arduino IDE is better than nothing. Even if we can't get any farther than making this work, I still think it will be worth the effort.

However, there is the stretch goal of getting Arduino to officially support the AVR Dragon. If that happens, I will be able to make the necessary modifications to platform.txt and the spurious Burn Bootloader failure will not occur. The hacky workaround is the first step. If testing shows this works, we can proceed to the slightly more complicated testing of the true solution.

It's also possible for 3rd party hardware packages to do the same thing I would like to do to Arduino AVR Boards to offer AVR Dragon support for their boards. My initial investigation of this was with the goal of getting that done in the popular MCUdude cores but that ended up not happening.

@per1234 per1234 added the Waiting For Feedback Progress is on hold until a response from someone is received label Jan 19, 2019
@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 19, 2019

Hey there,

got a first test setup:
An AVR Dragon with an ATTiny 85 - hooked up in ISP Mode.
I did also test it beforehand with Atmel Studio 7, so the wiring is correct (can read the ATTiny and got connection to the AVR Dragon) - but probably that Windows Machine could need another USB Driver for the AVR Dragon, as it appears as Atmel Device in the Device Manager and really cannot be found. The whole output from trying to burn the bootloader showed as such:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/avrdude.conf -v -pattiny85 -cdragon_isp -Pusb -Uflash:w:X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex:i -e -Uefuse:w:0xFF:m -Uhfuse:w:0b11010111:m -Ulfuse:w:0xF1:m 

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

         System wide configuration file is "X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
         Setting bit clk period        : 5.0
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2107)

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 19, 2019

Ha, perfect, I got something nice!
I used the current Zadig tool (https://zadig.akeo.ie/ , Version 2.4) to replace the original AVR Dragon Driver with libusb-win32 (v1.2.6.0).
After that, it worked:

Burn bootloader:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/avrdude.conf -v -pattiny85 -cdragon_isp -Pusb -Uflash:w:X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex:i -e -Uefuse:w:0xFF:m -Uhfuse:w:0b11010111:m -Ulfuse:w:0xF1:m 

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

         System wide configuration file is "X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
         Setting bit clk period        : 5.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         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    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65    12    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: erasing chip
avrdude: reading input file "X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex"
avrdude: writing flash (2 bytes):

Writing | ################################################## | 100% 0.10s

avrdude: 2 bytes of flash written
avrdude: verifying flash memory against X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex:
avrdude: load data flash data from input file X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex:
avrdude: input file X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex contains 2 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.12s

avrdude: verifying ...
avrdude: 2 bytes of flash verified
avrdude: reading input file "0xFF"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFF:
avrdude: load data efuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0b11010111"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.15s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0b11010111:
avrdude: load data hfuse data from input file 0b11010111:
avrdude: input file 0b11010111 contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xF1"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.15s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xF1:
avrdude: load data lfuse data from input file 0xF1:
avrdude: input file 0xF1 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/avrdude.conf -v -pattiny85 -cdragon_isp -Pusb -Uflash:w:X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex:i -Uflash:w:X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/bootloaders/empty/empty_all.hex:i 

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

         System wide configuration file is "X:\arduino\portable\packages\ATTinyCore\hardware\avr\1.2.2/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
         Setting bit clk period        : 5.0
avrdude: usb_open(): cannot read serial number "libusb0-dll:err [control_msg] sending control message failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.


"
avrdude: usb_open(): cannot read product name "libusb0-dll:err [control_msg] sending control message failed, win error: Das System kann die angegebene Datei nicht finden.


"
avrdude: usbdev_open(): Found [unnamed product], serno: [unknown]
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
avrdude: failed to sync with the AVR Dragon in ISP mode

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

Normal Upload (but the AVR Dragon is used)

Der Sketch verwendet 2266 Bytes (27%) des Programmspeicherplatzes. Das Maximum sind 8192 Bytes.
Globale Variablen verwenden 9 Bytes (1%) des dynamischen Speichers, 503 Bytes für lokale Variablen verbleiben. Das Maximum sind 512 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/BreathingLED_ATTiny85.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         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    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/BreathingLED_ATTiny85.ino.hex"
avrdude: writing flash (2266 bytes):

Writing | ################################################## | 100% 4.31s

avrdude: 2266 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex contains 2266 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 4.33s

avrdude: verifying ...
avrdude: 2266 bytes of flash verified

avrdude done.  Thank you.

Upload with programmer Option

Der Sketch verwendet 2266 Bytes (27%) des Programmspeicherplatzes. Das Maximum sind 8192 Bytes.
Globale Variablen verwenden 9 Bytes (1%) des dynamischen Speichers, 503 Bytes für lokale Variablen verbleiben. Das Maximum sind 512 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/BreathingLED_ATTiny85.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         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    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/BreathingLED_ATTiny85.ino.hex"
avrdude: writing flash (2266 bytes):

Writing | ################################################## | 100% 4.31s

avrdude: 2266 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex contains 2266 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 4.33s

avrdude: verifying ...
avrdude: 2266 bytes of flash verified

avrdude done.  Thank you.

I changed the used pin during the uploads (did two uploads with the upload only option, changing the pin, and another upload with the upload using programmer option in the arduino, also changing to the third pin - everything worked right out of the box! Also, the error on burning the bootloader came up, as you suggested. Very fine work! 👍

@per1234
Copy link
Owner Author

per1234 commented Jan 19, 2019

Hey, good work on fixing the driver issue. I was just typing out a recommendation to use Zadig. I love that program!

I had that exact problem with my Atmel AVRISP mkII after using it with Atmel Studio.

That programmer has the similar issue to the AVR Dragon. In the case of the AVRISP mkII, the problem was solved for me either by using avrdude 6.3.0 or changing from libusb-win32 to libusbk (using Zadig). Some other people have claimed those solutions don't work for them with the AVRISP mkII and also have said they don't work for the AVR Dragon. The fix I would like to make to Arduino AVR Boards would also solve the issue for AVRISP mkII for good (at least when using Arduino AVR Boards).


Regarding your Burn Bootloader results: How long does it take to do the spurious failure of the second step. From the output, it looks like avrdude keeps retrying. On the AVRISP mkII, the second command fails instantly. It would be very inconvenient if the failure of the second command causes a long delay of Burn Bootloader with the AVR Dragon.


Regarding your normal upload results: Unfortunately, the ATtiny85 board definition you're using does not really use a bootloader (it does burn a dummy bootloader file just to appease the IDE's process) and it automatically does the equivalent of an Upload Using Programmer even when you do a standard Upload. For this reason, the ATtiny85 is not ideal for testing purposes. Do you happen to have something like an ATmega328P board on hand to test with?


This all looks very promising. I'm actually quite surprised that the results were so good on the first test, considering I'm essentially working blind. I would like to get that normal upload test done, after which we can proceed to test the ideal solution.

I notice that the ATTinyCore you're using for your ATtiny85 has its own AVR Dragon programmer definition and that the issue we're working to solve has been discussed there (SpenceKonde/ATTinyCore#136 (comment)). I will probably submit a proposal to make the ideal fix to that repository if the test reveals it will work. Maybe I'll have better luck there than I did in the MCUdude cores. I have done a bit of work on ATTinyCore in the past.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 19, 2019

Regarding the first bootloader burn: Did not take long, so no problem there :)

Yeah got an 328P here.
Bootloader burn:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -v -v -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\portable\packages\atmega\hardware\avr\1.3.1/bootloaders/{bootloader.file}:i -e -Uefuse:w:0xfd:m -Uhfuse:w:0xdb:m -Ulfuse:w:0xe2:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: stk500v2_dragon_isp_open()
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
avrdude: jtagmkII_getsync()
avrdude: jtagmkII_getsync(): Sending sign-on command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Sent: . [1b] . [00] . [00] . [01] . [00] . [00] . [00] . [0e] . [01] . [f3] . [97] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 0 (command_sequence == 0)
avrdude: Recv: . [86] . [01] . [ff] ' [27] . [07] . [01] . [ff] ' [27] . [07] . [07] . [00] . [a2] . [00] . [05] $ [24] A [41] A [41] V [56] R [52] D [44] R [52] A [41] G [47] O [4f] N [4e] . [00] 

Raw message:
0x86 0x01 0xff 0x27 0x07 0x01 0xff 0x27 0x07 0x07 0x00 0xa2 0x00 0x05 0x24 0x41
0x41 0x56 0x52 0x44 0x52 0x41 0x47 0x4f 0x4e 0x00 
Sign-on succeeded

JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
avrdude: jtagmkII_setparm()
avrdude: jtagmkII_setparm(): Sending set parameter command (parm 0x03, 1 bytes): 
avrdude: jtagmkII_send(): sending 3 bytes
avrdude: Sent: . [1b] . [01] . [00] . [03] . [00] . [00] . [00] . [0e] . [02] . [03] . [03] . [89] f [66] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 1 (command_sequence == 1)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

avrdude: jtagmkII_getsync(): Sending get sync command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Sent: . [1b] . [02] . [00] . [01] . [00] . [00] . [00] . [0e] . [0f] . [e2] u [75] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 2 (command_sequence == 2)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK

         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
avrdude: jtagmkII_getparm()
avrdude: jtagmkII_getparm(): Sending get parameter command (parm 0x06): 
avrdude: jtagmkII_send(): sending 2 bytes
avrdude: Sent: . [1b] . [03] . [00] . [02] . [00] . [00] . [00] . [0e] . [03] . [06] l [6c] . [ed] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 3 (command_sequence == 3)
avrdude: Recv: . [81] P [50] . [13] 

Raw message:
0x81 0x50 0x13 
parameter values:
0x50  0x13  

         Vtarget         : 4.9 V

avrdude: jtagmkII_send(): sending 5 bytes
avrdude: Sent: . [1b] . [04] . [00] . [05] . [00] . [00] . [00] . [0e] / [2f] . [03] . [00] . [03] . [98] = [3d] . [f4] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 4 (command_sequence == 4)
avrdude: Recv: . [88] . [03] . [00] . [06] 
         SCK period      : 8.00 us


avrdude: jtagmkII_send(): sending 15 bytes
avrdude: Sent: . [1b] . [05] . [00] . [0f] . [00] . [00] . [00] . [0e] / [2f] . [02] . [00] . [10] . [c8] d [64] . [19]   [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00] | [7c] % [25] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 5 (command_sequence == 5)
avrdude: Recv: . [88] . [10] . [00] 
avrdude: AVR device initialized and ready to accept instructions

Reading | 
avrdude: jtagmkII_send(): sending 11 bytes
avrdude: Sent: . [1b] . [06] . [00] . [0b] . [00] . [00] . [00] . [0e] / [2f] . [07] . [00] . [1d] . [04] . [04] . [00] 0 [30] . [00] . [00] . [00] . [08] . [d0] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 6 (command_sequence == 6)
avrdude: Recv: . [88] . [1d] . [00] . [00] 0 [30] . [00] . [1e] . [00] 

avrdude: jtagmkII_send(): sending 11 bytes
avrdude: Sent: . [1b] . [07] . [00] . [0b] . [00] . [00] . [00] . [0e] / [2f] . [07] . [00] . [1d] . [04] . [04] . [00] 0 [30] . [00] . [01] . [00] 7 [37] 1 [31] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 7 (command_sequence == 7)
avrdude: Recv: . [88] . [1d] . [00] . [00] 0 [30] . [00] . [95] . [00] 
################
avrdude: jtagmkII_send(): sending 11 bytes
avrdude: Sent: . [1b] . [08] . [00] . [0b] . [00] . [00] . [00] . [0e] / [2f] . [07] . [00] . [1d] . [04] . [04] . [00] 0 [30] . [00] . [02] . [00] . [87] . [1e] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 8 (command_sequence == 8)
avrdude: Recv: . [88] . [1d] . [00] . [00] 0 [30] . [00] . [0f] . [00] 
################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip

avrdude: jtagmkII_send(): sending 10 bytes
avrdude: Sent: . [1b] . [09] . [00] . [0a] . [00] . [00] . [00] . [0e] / [2f] . [02] . [00] . [12] . [09] . [00] . [ac] . [93] 2 [32] F [46] p [70] . [09] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 9 (command_sequence == 9)
avrdude: Recv: . [88] . [12] . [00] 

avrdude: jtagmkII_send(): sending 15 bytes
avrdude: Sent: . [1b] . [0a] . [00] . [0f] . [00] . [00] . [00] . [0e] / [2f] . [02] . [00] . [10] . [c8] d [64] . [19]   [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00] a [61] . [01] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 10 (command_sequence == 10)
avrdude: Recv: . [88] . [10] . [00] 
avrdude: reading input file "X:\arduino\portable\packages\atmega\hardware\avr\1.3.1/booFehler beim Brennen des Bootloaders.
tloaders/{bootloader.file}"
avrdude: can't open input file X:\arduino\portable\packages\atmega\hardware\avr\1.3.1/bootloaders/{bootloader.file}: No such file or directory
avrdude: read from file 'X:\arduino\portable\packages\atmega\hardware\avr\1.3.1/bootloaders/{bootloader.file}' failed

avrdude: jtagmkII_send(): sending 6 bytes
avrdude: Sent: . [1b] . [0b] . [00] . [06] . [00] . [00] . [00] . [0e] / [2f] . [02] . [00] . [11] . [01] . [01] . [af] . [c5] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 11 (command_sequence == 11)
avrdude: Recv: . [88] . [11] . [00] 
avrdude: stk500v2_jtagmkII_close()
avrdude: jtagmkII_close()
avrdude: jtagmkII_close(): Sending sign-off command: 
avrdude: jtagmkII_send(): sending 1 bytes
avrdude: Sent: . [1b] . [0c] . [00] . [01] . [00] . [00] . [00] . [0e] . [00] . [18] . [bd] 
avrdude: jtagmkII_recv():

avrdude: jtagmkII_recv(): Got message seqno 12 (command_sequence == 12)
avrdude: Recv: . [80] 

Raw message:
0x80 
OK


avrdude done.  Thank you.

Upload 1:

Der Sketch verwendet 2412 Bytes (7%) des Programmspeicherplatzes. Das Maximum sind 32768 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/BreathingLED_ATTiny85.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/BreathingLED_ATTiny85.ino.hex"
avrdude: writing flash (2412 bytes):

Writing | ################################################## | 100% 2.63s

avrdude: 2412 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex contains 2412 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.65s

avrdude: verifying ...
avrdude: 2412 bytes of flash verified

avrdude done.  Thank you.

Upload 2:

Der Sketch verwendet 2412 Bytes (7%) des Programmspeicherplatzes. Das Maximum sind 32768 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/BreathingLED_ATTiny85.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/BreathingLED_ATTiny85.ino.hex"
avrdude: writing flash (2412 bytes):

Writing | ################################################## | 100% 2.63s

avrdude: 2412 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex contains 2412 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.65s

avrdude: verifying ...
avrdude: 2412 bytes of flash verified

avrdude done.  Thank you.

Upload with Programmer:

Der Sketch verwendet 2412 Bytes (7%) des Programmspeicherplatzes. Das Maximum sind 32768 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/BreathingLED_ATTiny85.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/BreathingLED_ATTiny85.ino.hex"
avrdude: writing flash (2412 bytes):

Writing | ################################################## | 100% 2.63s

avrdude: 2412 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex:
avrdude: input file X:\arduino\build/BreathingLED_ATTiny85.ino.hex contains 2412 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 2.65s

avrdude: verifying ...
avrdude: 2412 bytes of flash verified

avrdude done.  Thank you.

Everything went very fast and worked out! Same test as beforehand - no problems whatsoever! :)

Yeah it would be awesome to fix ATTinyCores problem as well, tend to use them from time to time and really a nice package :).

something else you need :)?

@per1234
Copy link
Owner Author

per1234 commented Jan 19, 2019

Thanks for getting out the ATmega328P.

I'm glad to hear the Burn Bootloader delay I feared is not a thing.

The normal uploads you're doing are still the equivalent of Upload Using Programmer. The reason is the atmega hardware package you're using does the same thing as the ATTinyCore's standard ATtiny85 board definition where it turns Upload into Upload Using Programmer.

Upload Using Programmer will work regardless of whether the bootloader is working. Upload Using Programmer erases the bootloader so when you're doing that the purpose of Burn Bootloader is just to set the fuses according to the definition of the board you have selected from the Tools menu (that's all it's doing with the standard ATTinyCore ATtiny85 board or the atmega boards).

What I need is for you to do an upload to the ATmega328P over a serial connection, as this is the way to verify the burned bootloader is working. This is how people normally upload to the regular Arduino boards like the Uno. The Uno has a USB to TTL serial adapter chip (ATmega16U2 on the official Uno or CH340 on the Chinese version) right on the board that creates a virtual COM port on your computer when you connect the board to the computer with a USB cable.

Do you have a board with the USB to TTL serial adapter on board (e.g. Uno, Nano, Mega, Leonardo, Pro Micro, etc.), or a separate USB to TTL serial adapter board or cable you can connect to the ATmega328P?

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 19, 2019

Burning Bootloader with AVR Dragon to an ATMega328P Arduino Style Board (with external 16 MHz Resonator) via the ISP Interface:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: load data flash data from input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% -0.00s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDE"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDE:
avrdude: load data hfuse data from input file 0xDE:
avrdude: input file 0xDE contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usb_open(): cannot read serial number "libusb0-dll:err [control_msg] sending control message failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.


"
avrdude: usb_open(): cannot read product name "libusb0-dll:err [control_msg] sending control message failed, win error: Das System kann die angegebene Datei nicht finden.


"
avrdude: usbdev_open(): Found [unnamed product], serno: [unknown]
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
avrdude: failed to sync with the AVR Dragon in ISP mode

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

Uploading via TTL Serial

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM25 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM25
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (950 bytes):

Writing | ################################################## | 100% 0.14s

avrdude: 950 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 950 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude: verifying ...
avrdude: 950 bytes of flash verified

avrdude done.  Thank you.

Uploading via TTL Serial 2nd Time, other blink parameters

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM25 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM25
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% -0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (950 bytes):

Writing | ################################################## | 100% 0.14s

avrdude: 950 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 950 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude: verifying ...
avrdude: 950 bytes of flash verified

avrdude done.  Thank you.

Upload using AVR Dragon

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (950 bytes):

Writing | ################################################## | 100% 1.09s

avrdude: 950 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 950 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.12s

avrdude: verifying ...
avrdude: 950 bytes of flash verified

avrdude done.  Thank you.


Worked out :)!

@per1234
Copy link
Owner Author

per1234 commented Jan 19, 2019

Thanks! That's exactly what I needed to make sure it's 100% working.

Are you willing to continue with testing of the ideal solution? I will provide a hardware package with an ATmega328P board definition you can use with the hardware from the last test. That package can be installed, updated, and removed via Boards Manager so it should be pretty painless.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 19, 2019

Sure thing, I would do that :)

@per1234
Copy link
Owner Author

per1234 commented Jan 20, 2019

The ideal system test is ready for you:


Test Burn Bootloader

  1. (In the Arduino IDE) File > Preferences
  2. In the "Additional Boards Manager URLs" field, enter https://per1234.github.io/SingleCommandBurnBootloaderDemo/package_per1234_SingleCommandBurnBootloaderDemo_index.json
    • If you already have a URL in that field, separate the URLs with a comma.
  3. Click "OK".
  4. Tools > Board > Boards Manager
  5. Wait for downloads to finish.
  6. Scroll down until you see "SingleCommandBurnBootloaderDemo by per1234". Click on it.
  7. Click "Install".
  8. Wait for installation to finish.
  9. Click "Close".
  10. File > Preferences
  11. Uncheck the box next to "Show verbose output during: compilation". This is to keep the output clean of irrelevant compilation commands when you're testing Upload Using Programmer.
  12. Check the box next to "Show verbose output during: upload".
  13. Click "OK".
  14. Tools > Board
  15. Scroll down until you see the section heading "Single Command Burn Bootloader Demo"
  16. From that section, select "Arduino/Genuino Uno"
    • Make sure not to select the Uno board from the "Arduino AVR Boards" section of the Board menu
  17. Tools > Programmer > AVR Dragon (Single Command Burn Bootloader)
  18. Connect your AVR Dragon to a target board/microcontroller. I recommend against using an especially valuable target device for testing, just in case.
  19. Tools > Board > select the appropriate board
  20. Tools > Burn Bootloader
  21. Click in the black console window at the bottom of the Arduino IDE window
  22. Press Ctrl+A to select all the text.
  23. Press Crl+C to copy the selected text to the clipboard.
  24. Paste the copied text in a reply here.

Test the bootloader:

  1. Disconnect the AVR Dragon from the target.
  2. Open a sketch that will give you a clear indication that it's running (e.g. Blink).
  3. Do a standard serial upload to your target.
  4. Confirm that the sketch is running.
  5. Modify the sketch in a way that gives a different obvious behavior (e.g. change blink rate)
  6. Do a standard serial upload to your target.
  7. Confirm that the sketch is running.

Test Upload Using Programmer

  1. Connect the AVR Dragon to your target.
  2. Open a sketch that will give you a clear indication that it's running (e.g. Blink).
  3. Sketch > Upload Using Programmer
  4. Confirm that the sketch is running.
  5. If the process fails, copy the full output from the console window and paste it in a reply here.

Note that when you do Upload Using Programmer the bootloader is erased. After doing this, you will need to do another Burn Bootloader before you can go back to doing standard uploads.

@per1234
Copy link
Owner Author

per1234 commented Jan 20, 2019

Hi. I left out an important step in the instructions above (selecting the Arduino/Genuino Uno board from the "Single Command Burn Bootloader Demo" section of the Tools > Board menu). I have now updated the instructions above so they are now correct. Sorry for any confusion.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 20, 2019

Worked perfectly, awesome!
Just one little question: Would it be possible to not only include ISP but also HVSP and parallel programming modes? That would be really useful if you fry your chip (i.e. set for an external clock or disable the reset pin, last thing is made often with ATTiny 85 and similar to get one additional pin ;)).

Complete logs:

Test Burn Bootloader

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m -Uflash:w:X:\arduino\portable\packages\SingleCommandBurnBootloaderDemo\hardware\avr\0.0.1/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDE"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDE:
avrdude: load data hfuse data from input file 0xDE:
avrdude: input file 0xDE contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "X:\arduino\portable\packages\SingleCommandBurnBootloaderDemo\hardware\avr\0.0.1/bootloaders/optiboot/optiboot_atmega328.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% -0.00s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against X:\arduino\portable\packages\SingleCommandBurnBootloaderDemo\hardware\avr\0.0.1/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: load data flash data from input file X:\arduino\portable\packages\SingleCommandBurnBootloaderDemo\hardware\avr\0.0.1/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: input file X:\arduino\portable\packages\SingleCommandBurnBootloaderDemo\hardware\avr\0.0.1/bootloaders/optiboot/optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified
avrdude: reading input file "0x0F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.15s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x0F:
avrdude: load data lock data from input file 0x0F:
avrdude: input file 0x0F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lock verified

avrdude done.  Thank you.

Test the bootloader 1:

Build-Optionen wurden verändert, alles wird neu kompiliert
Der Sketch verwendet 930 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM21
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (930 bytes):

Writing | ################################################## | 100% 0.14s

avrdude: 930 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 930 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude: verifying ...
avrdude: 930 bytes of flash verified

avrdude done.  Thank you.

Test the bootloader 2:

Der Sketch verwendet 928 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM21 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM21
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (928 bytes):

Writing | ################################################## | 100% 0.14s

avrdude: 928 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 928 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude: verifying ...
avrdude: 928 bytes of flash verified

avrdude done.  Thank you.

Test Upload Using Programmer:

Der Sketch verwendet 930 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_ISP
         Description     : Atmel AVR Dragon in ISP mode
         Vtarget         : 4.9 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (930 bytes):

Writing | ################################################## | 100% 1.07s

avrdude: 930 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 930 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.10s

avrdude: verifying ...
avrdude: 930 bytes of flash verified

avrdude done.  Thank you.

@per1234
Copy link
Owner Author

per1234 commented Jan 20, 2019

Thanks for the testing! Looks like the ideal solution is fine. I suspect it may be a bit of a struggle making the case for changing such a fundamental part of the system (even though that change is very simple) just to add support for an outdated programmer. However, the Arduino developers haven't outright rejected any of the requests for Dragon support and ATTinyCore went ahead with adding partially broken Dragon support so I think it's worth a try. I'm sure there are a lot of AVR Dragons out there in the world and I'd love for people to be able to use them with the Arduino IDE. Even if the ideal solution proposals fail, we will still have accomplished something by providing some level of support via this repository.


Would it be possible to not only include ISP but also HVSP and parallel programming modes?

I think it would be great. It especially makes sense for this repository to offer as much Dragon support as possible. I have added two new programmers to the InoAVRDragon package in the 0.1.0 release:

  • AVR Dragon HVSP mode (workaround)
  • AVR Dragon PP mode (workaround)

You can update to InoAVRDragon 0.1.0 like this:

  1. Tools > Board > Boards Manager
  2. Wait for downloads to finish
  3. Scroll down until you see "InoAVRDragon by per1234". Click on it.
  4. Click "Update".
  5. Wait for the update to finish.
  6. Click "Close".

Now run the usual tests after selecting Tools > Programmer > AVR Dragon HVSP mode (workaround) and Tools > Programmer > AVR Dragon PP mode (workaround).

Thanks!

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 21, 2019

PP Mode burning bootloader directly goes into error mode:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_isp -Pusb -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_isp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_FAILED
avrdude: jtagmkII_getsync(): ISP activation failed, trying debugWire
avrdude: jtagmkII_setparm(): bad response to set parameter command: RSP_DEBUGWIRE_SYNC_FAILED
avrdude: failed to sync with the AVR Dragon in ISP mode

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

With Atmel Studio 7 I can however read and erase the chip with (HV)PP, so the bug must be on our site :(

Did not try HVSP, as wiring for HVPP is a serious nightmare and I do not want to disconnect anything until HVPP is working... ( https://www.microchip.com/webdoc/GUID-04E3421E-81C3-4E6C-BD29-9E1A7BAEBA7E/index.html?GUID-0FC53DF1-7D1A-4790-A83F-EE7F4C2FFC00 )

@per1234
Copy link
Owner Author

per1234 commented Jan 21, 2019

Oops. Caused by a dumb mistake on my part. I'm working on a new release now.

@per1234
Copy link
Owner Author

per1234 commented Jan 21, 2019

OK, version 0.1.1 is now available via Boards Manager. You can install it via the same update procedure as 0.1.0.

Hopefully things will go more smoothly this time.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 21, 2019

Mh, very weird:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: usbdev_send(): wrote -5 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.



avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: usbdev_send(): wrote -116 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] timeout error

avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
################avrdude: usbdev_send(): wrote -116 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] timeout error

avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
################################## | 100% 40.03s

avrdude: Device signature = 0xdedede
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.
avrdude: usbdev_send(): wrote -116 out of 16 bytes, err = libusb0-dll:err [_usb_reap_async] timeout error

avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: usbdev_send(): wrote -116 out of 11 bytes, err = libusb0-dll:err [_usb_reap_async] timeout error

avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_close(): timeout/error communicating with programmer (status -1)

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

And it did not work, no bootloader on the chip afterwards

@per1234
Copy link
Owner Author

per1234 commented Jan 24, 2019

I did find a report of a signature mismatch error with the Dragon that was solved by setting the bit clock to 5 us via the -B5 option. I added that option to the programmer definitions and made a 0.1.2 release. It's available from Boards Manager. It's somewhat a shot in the dark but it's all I have to go on. Hopefully it will do the trick.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 27, 2019

Sorry I had no time during the week, so I just came in testing. Sadly, no luck:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B5 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 5.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: usbdev_send(): wrote -5 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.



avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: usbdev_send(): wrote -116 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] timeout error

avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
################avrdude: usbdev_send(): wrote -5 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.



avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
################################## | 100% 30.00s

avrdude: Device signature = 0x585858
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.
avrdude: usbdev_send(): wrote -116 out of 16 bytes, err = libusb0-dll:err [_usb_reap_async] timeout error

avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.



avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_close(): timeout/error communicating with programmer (status -1)

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

I was especially cautious to not to touch any wires - and I switched back to Atmel Studio 7 - could read the chip successfully in that configuration and wiring, but only got that error in Arduino :(. Sorry for the bad news :(!

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 27, 2019

I tested it with B8, that worked better, but I think its actually trying to push data too fast. Maybe an error in avrdude itself?

@per1234
Copy link
Owner Author

per1234 commented Jan 27, 2019

Sorry to hear it's still not working. Thanks for sticking with me on the testing.

Maybe an error in avrdude itself?

The err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht. does make me think that's possible. I ran into a problem with the 6.3.0 version of AVRDUDE that Arduino distributes when used with USBasp and the libusb-win32 driver. When I tried the 6.3.0 downloaded from the AVRDUDE website, the problem did not occur. It's quite likely that a bug which only affected the dragon_pp programmer would not have been discovered until now, and certainly Arduino wouldn't have done any testing of that programmer.

If you want to give it a try with the official AVRDUDE:
Download AVRDUDE: http://download.savannah.gnu.org/releases/avrdude/avrdude-6.3-mingw32.zip
Download a version of avrdude.conf that will work with standard avrdude: avrdude.zip

  1. Unzip both the downloaded files
  2. Put the unzipped files in the same folder.
  3. Open that folder in a command line.
  4. Run the command:
    avrdude -Cavrdude.conf -v -patmega328p -cdragon_pp -Pusb -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m
    

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 28, 2019

A lot better - but still not there yet.
It works a lot faster, no errors and the AVR Dragon does not become "lost" and inaccessible after try to get it working. So a lot better. But it cannot read the chip. Cross-tested again with Atmel Studio 7 - worked there. Oh and I had to get a new atmega328p, I set the fuses for clock source wrong the last time I was tinkering to get it working. So a fresh atmega328p for testing here...

avrdude>avrdude -Cavrdude.conf -v -patmega328p -cdragon_pp -Pusb -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3, compiled on Feb 17 2016 at 09:25:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.16s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.17s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0xffffff (probably .avr8x_mega)
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 28, 2019

Well, NICE!
I powered it via the internal powered usb hub of my hp monitor .... looks like that baby was really needing more juice!

avrdude>avrdude -Cavrdude.conf -v -patmega328p -cdragon_pp -Pusb -B8 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3, compiled on Feb 17 2016 at 09:25:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 8.0
avrdude: usbdev_open(): did not find any USB device "usb" (0x03eb:0x2107)

avrdude done.  Thank you.


C:\Users\Nico Maas\Desktop\avrdude>avrdude -Cavrdude.conf -v -patmega328p -cdragon_pp -Pusb -B8 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3, compiled on Feb 17 2016 at 09:25:53
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 8.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 8.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.16s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as FD
avrdude: erasing chip
avrdude: reading input file "X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: load data flash data from input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.06s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
         0xff != 0x3f
avrdude: verification error; content mismatch

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

avrdude done.  Thank you.

@per1234
Copy link
Owner Author

per1234 commented Jan 28, 2019

I powered it via the internal powered usb hub of my hp monitor .... looks like that baby was really needing more juice!

Great! Would you mind testing with the Arduino IDE again with the new power configuration? I suspect we'll be back to the same libusb0-dll error, but it's best to be certain.

avrdude: verification error, first mismatch at byte 0x0000
         0xff != 0x3f
avrdude: verification error; content mismatch

I believe this error is caused by a change in how AVRDUDE handles unused fuse bits. This change broke compatibility with the fuse values that worked in AVRDUDE versions previous to 6.3.0. That caused a lot of problems in Arduino land so Arduino's version of AVRDUDE is patched to also work with the old values. The only difference between 0xff and 0x3f are bits 6 and 7, which are unused, so the two values are functionally identical.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 29, 2019

Well, it started off with the same old error about libusb0-dll, but after replugging it a few times, it somehow worked. There is something really sketch between driver and the old avrdude version. I was able to complete all tests successfully, however, I had to try and try again / replugin etc. So patience and a good powersource should be needed... However, I think it is more of a driver and avrdude issue: Reason: I could use the AVRDragon with its original Atmel Driver from Atmel Studio 7 without these glitches. So something is not quite there yet, but a new avrdude version for Arduino would be already a good step in the right direction, I presume.

Bootloader with -B3

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% -0.00s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: load data flash data from input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% -0.00s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: WARNING: invalid value for unused bits in fuse "lock", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xff instead of 0x3f (double check with your datasheet first).
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDE"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDE:
avrdude: load data hfuse data from input file 0xDE:
avrdude: input file 0xDE contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usb_open(): cannot read serial number "libusb0-dll:err [control_msg] sending control message failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.


"
avrdude: usb_open(): cannot read product name "libusb0-dll:err [control_msg] sending control message failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.


"
avrdude: usbdev_open(): Found [unnamed product], serno: [unknown]
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request faFehler beim Brennen des Bootloaders.
iled, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
avrdude: failed to sync with the AVR Dragon in HV mode

avrdude done.  Thank you.

Uploadtest 1 with Serial

Der Sketch verwendet 930 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (930 bytes):

Writing | ################################################## | 100% 0.15s

avrdude: 930 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 930 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.12s

avrdude: verifying ...
avrdude: 930 bytes of flash verified

avrdude done.  Thank you.

Uploadtest 2 with Serial

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM3
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (950 bytes):

Writing | ################################################## | 100% 0.15s

avrdude: 950 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 950 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.12s

avrdude: verifying ...
avrdude: 950 bytes of flash verified

avrdude done.  Thank you.

Upload with AVR Dragon

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.16s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0xffffff (probably .avr8x_mega)
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Beim Hochladen des Sketches ist ein Fehler aufgetreten

Replug and try again

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: stk500v2_jtagmkII_recv(): error in jtagmkII_recv()
avrdude: usbdev_send(): wrote -5 out of 15 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.



avrdude: jtagmkII_send(): failed to send command to serial port

And again....

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (950 bytes):

Writing | ################################################## | 100% 0.85s

avrdude: 950 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 950 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.83s

avrdude: verifying ...
avrdude: 950 bytes of flash verified

avrdude done.  Thank you.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 31, 2019

Tried it again with PP:

With a higher quality, powered USB 3 hub - burning the bootloader only with a AVRDRAGON:

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex"
avrdude: writing flash (32768 bytes):

Writing | ################################################## | 100% -0.00s

avrdude: 32768 bytes of flash written
avrdude: verifying flash memory against X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: load data flash data from input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:
avrdude: input file X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex contains 32768 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 32768 bytes of flash verified
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: WARNING: invalid value for unused bits in fuse "lock", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xff instead of 0x3f (double check with your datasheet first).
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDE"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDE:
avrdude: load data hfuse data from input file 0xDE:
avrdude: input file 0xDE contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.05s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done.  Thank you.

X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Uflash:w:X:\arduino\hardware\arduino\avr/bootloaders/optiboot/optiboot_atmega328.hex:i -Ulock:w:0x0F:m 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usb_open(): cannot read serial number "libusb0-dll:err [control_msg] sending control message failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.


"
avrdude: usb_open(): cannot read product name "libusb0-dll:err [control_msg] sending control message failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.


"
avrdude: usbdev_open(): Found [unnamed product], serno: [unknown]
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [_usb_reap_async] reaping request failed, win error: Ein an das System angeschlossenes Gerät funktioniert nicht.



avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das System kann die angegebene Datei nicht finden.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: usbdev_send(): wrote -5 out of 11 bytes, err = libusb0-dll:err [submit_async] submitting request failed, win error: Das Gerät erkennt den Befehl nicht.


avrdude: jtagmkII_send(): failed to send command to serial port
avrdude: jtagmkII_getsync(): sign-on command: status -1
avrdude: jtagmkII_getsync(): timeout/error communicating with programmer (status -1)
avrdude: failed to sync with the AVR Dragon in HV mode

avrdude done.  Thank you.

Fehler beim Brennen des Bootloaders.

Uploading using serial on target system, test 1:

Der Sketch verwendet 930 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (930 bytes):

Writing | ################################################## | 100% 0.14s

avrdude: 930 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 930 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude: verifying ...
avrdude: 930 bytes of flash verified

avrdude done.  Thank you.

Uploading using serial on target system, test 2:

Der Sketch verwendet 950 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM4 -b115200 -D -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (950 bytes):

Writing | ################################################## | 100% 0.14s

avrdude: 950 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 950 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.10s

avrdude: verifying ...
avrdude: 950 bytes of flash verified

avrdude done.  Thank you.

Uploading using the AVRDragon -> tested afterwards in target board successfully

Der Sketch verwendet 928 Bytes (2%) des Programmspeicherplatzes. Das Maximum sind 32256 Bytes.
Globale Variablen verwenden 9 Bytes (0%) des dynamischen Speichers, 2039 Bytes für lokale Variablen verbleiben. Das Maximum sind 2048 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cdragon_pp -Pusb -B3 -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_pp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATmega328P
         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       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  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 : DRAGON_PP
         Description     : Atmel AVR Dragon in PP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (928 bytes):

Writing | ################################################## | 100% 0.85s

avrdude: 928 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 928 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.81s

avrdude: verifying ...
avrdude: 928 bytes of flash verified

avrdude done.  Thank you.


Second Test, ATTiny85 with HVSP using the ATtiny Microcontrolers package (not the ATtinyCore, as this got its own dragon definitions, which I tried to ignore here!)

Der Sketch verwendet 682 Bytes (8%) des Programmspeicherplatzes. Das Maximum sind 8192 Bytes.
Globale Variablen verwenden 9 Bytes (1%) des dynamischen Speichers, 503 Bytes für lokale Variablen verbleiben. Das Maximum sind 512 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cdragon_hvsp -Pusb -B3 -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_hvsp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         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    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_HVSP
         Description     : Atmel AVR Dragon in HVSP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.14s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (682 bytes):

Writing | ################################################## | 100% 1.20s

avrdude: 682 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 682 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.14s

avrdude: verifying ...
avrdude: 682 bytes of flash verified

avrdude done.  Thank you.

I went ahead, set the RST DISABLE fuse so that the RESET pin of the ATTiny could not be used for RESET/ISP programming again and I switched back to Arduino, tried to HVSP programm it (which should be the only way working)

Der Sketch verwendet 682 Bytes (8%) des Programmspeicherplatzes. Das Maximum sind 8192 Bytes.
Globale Variablen verwenden 9 Bytes (1%) des dynamischen Speichers, 503 Bytes für lokale Variablen verbleiben. Das Maximum sind 512 Bytes.
X:\arduino\hardware\tools\avr/bin/avrdude -CX:\arduino\hardware\tools\avr/etc/avrdude.conf -v -pattiny85 -cdragon_hvsp -Pusb -B3 -Uflash:w:X:\arduino\build/Blink.ino.hex:i 

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

         System wide configuration file is "X:\arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : dragon_hvsp
         Setting bit clk period        : 3.0
avrdude: usbdev_open(): Found AVRDRAGON, serno: 00A200052441
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              1
S_MCU:
  boot-loader FW version:        255
  firmware version:              7.39
  hardware version:              7
Serial number:                   00:a2:00:05:24:41
Device ID:                       AVRDRAGON
         AVR Part                      : ATtiny85
         Chip Erase delay              : 400000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : possible i/o
         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    12     4    0 no        512    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      8192   64    128 30000 30000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : DRAGON_HVSP
         Description     : Atmel AVR Dragon in HVSP mode
         Vtarget         : 5.0 V
         SCK period      : 4.00 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude: Device signature = 0x1e930b (probably t85)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "X:\arduino\build/Blink.ino.hex"
avrdude: writing flash (682 bytes):

Writing | ################################################## | 100% 1.20s

avrdude: 682 bytes of flash written
avrdude: verifying flash memory against X:\arduino\build/Blink.ino.hex:
avrdude: load data flash data from input file X:\arduino\build/Blink.ino.hex:
avrdude: input file X:\arduino\build/Blink.ino.hex contains 682 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.15s

avrdude: verifying ...
avrdude: 682 bytes of flash verified

avrdude done.  Thank you.

Everything worked out!
Leasons learned: Use an good quality, external powered USB hub and the latest zadig driver with libusb-win32 1.2.6.0

This concludes my testing. I would let the B3 option in, I think it does not hurt here. From my point on, I would advise to actually release this package, maybe with the informations found - giving the ISP option free as "working" and the PP and HVSP option as "depending on a good usb hub with external power supply and short wiring". However, in the future, new avrdude versions would be advisable and probably also decrese problems. Thanks for your awesome work!

@per1234
Copy link
Owner Author

per1234 commented Jan 31, 2019

Great! I'm definitely anxious to publish the package.

I would let the B3 option in, I think it does not hurt here.

Why do you recommend -B3 specifically? The AVRs come from the factory running at 1 MHz on the internal oscillator so it's definitely crucial to work with that. The forum thread I found recommended -B5 but I don't know how solid that was. I would prefer to use the smallest value possible to keep from slowing down the process too much, but I also want to make sure I can cover 1 MHz.

Some of the MCUdude hardware packages come with "slow" programmer definitions with -B32 to allow communication with MCUs running at kHz speeds but I think providing definitions that will work with >=1 MHz is good enough.

@nmaas87
Copy link
Collaborator

nmaas87 commented Jan 31, 2019

Hi there -B3 comes with no special suggestion. I just used it as my system was now configured now that way due to your latest version. However, I think the default is -B8 (so if nothing is configured it goes to 8 I think). We can also use the default, should be good as well :)!

@per1234 per1234 removed Help Wanted Seeking someone to help with this issue Waiting For Feedback Progress is on hold until a response from someone is received labels Feb 17, 2019
@per1234
Copy link
Owner Author

per1234 commented Feb 17, 2019

I have now made the repository public. Note that the Boards Manager URL has changed to:
https://per1234.github.io/InoAVRDragon/package_per1234_InoAVRDragon_index.json

As soon as I get some more free time, I'll submit some pull requests to see if I can get anyone to go for the ideal solution.

Thanks so much for your assistance nmaas87!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants