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

Problem with 8u2 (uno) #6

Closed
thesymbol opened this issue Mar 23, 2015 · 104 comments
Closed

Problem with 8u2 (uno) #6

thesymbol opened this issue Mar 23, 2015 · 104 comments
Labels

Comments

@thesymbol
Copy link

I have been trying to upload the HoodLoader2_NoUSB_Blink to the 8u2 (since i do not have the space to fit the HID library for keyboard). but every time it fails to verify. here is the output from Arduino 1.6.1

Sketch uses 646 bytes (15%) of program storage space. Maximum is 4 096 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
Forcing reset using 1200bps open/close on port COM14
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
Uploading using selected port: COM14
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega8u2 -cavr109 -PCOM14 -b57600 -D -Uflash:w:C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:i 

avrdude: Version 6.0.1, compiled on Jan 15 2015 at 16:58:43
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : COM14
         Using Programmer              : avr109
         Overriding Baud Rate          : 57600
         AVR Part                      : ATmega8U2
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC6
         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    20     4    0 no        512    4    128  9000  9000 0x00 0x00
           flash         65     6    64    0 yes      8192   64    128  4500  4500 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
           lock           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
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : butterfly
         Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "HL2.0.4"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9389
avrdude: reading input file "C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex"
avrdude: writing flash (646 bytes):

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

avrdude: 646 bytes of flash written
avrdude: verifying flash memory against C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:
avrdude: load data flash data from input file C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:
avrdude: input file C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex contains 646 bytes
avrdude: reading on-chip flash data:

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

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

avrdude done.  Thank you."
@NicoHood
Copy link
Owner

do you use the newest 2.0.4? Have you installed the 8u2 version? the
16u2 version will not work on an 8u2.
I never tested it since i dont have a 8u2.

Does the usb serial still work to flash the 328?

Nico

On 3/23/2015 9:32 PM, Marcus wrote:

I have been trying to upload the HoodLoader2_NoUSB_Blink to the 8u2
(since i do not have the space to fit the HID library for keyboard).
but every time it fails to verify. here is the output from Arduino 1.6.1

|Sketch uses 646 bytes (15%) of program storage space. Maximum is 4 096 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
Forcing reset using 1200bps open/close on port COM14
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
Uploading using selected port: COM14
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega8u2 -cavr109 -PCOM14 -b57600 -D -Uflash:w:C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:i

avrdude: Version 6.0.1, compiled on Jan 15 2015 at 16:58:43
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

      System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"

      Using Port                    : COM14
      Using Programmer              : avr109
      Overriding Baud Rate          : 57600
      AVR Part                      : ATmega8U2
      Chip Erase delay              : 9000 us
      PAGEL                         : PD7
      BS2                           : PC6
      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    20     4    0 no        512    4    128  9000  9000 0x00 0x00
        flash         65     6    64    0 yes      8192   64    128  4500  4500 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
        lock           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
        signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

      Programmer Type : butterfly
      Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "HL2.0.4"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9389
avrdude: reading input file "C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex"
avrdude: writing flash (646 bytes):

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

avrdude: 646 bytes of flash written
avrdude: verifying flash memory against C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:
avrdude: load data flash data from input file C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:
avrdude: input file C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex contains 646 bytes
avrdude: reading on-chip flash data:

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

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

avrdude done. Thank you."
|


Reply to this email directly or view it on GitHub
#6.

@thesymbol
Copy link
Author

Yes im using the 2.0.4 version for the 8u2, the flashing went through without any errors, (i used a Arduino Mega ADK to flash the UNO with Hoodloader 2.0.4)

And yes i can still upload sketches to the 328. (for example the blink from arduinos example sketches).

i used these settings in the ino sketch:

// make some of these false to reduce compile size (the ones you don't want)
#define USE_ATMEGA8U2 true
#define USE_ATMEGA16U2 false
#define USE_ATMEGA32U2 false
#define USE_AT90USB162 false // todo, not supported

// also use Mega 16u2 bootloader files?
#define USE_MEGA_BOOTLOADER false

// force Mega bootloader for blind pin selection/DFU hex file
#define FORCE_MEGA_BOOTLOADER false

// DFU options (16u2 only)
#ifdef USE_ATMEGA16U2
#define USE_ATMEGA16U2_DFU true
// use the full 16kb DFU Bootloader with USB-Serial
// you have to deactuivate the mega bootloader then
// but you can stull burn a mega DFU file in the followed setting
#define USE_ATMEGA16U2_DFU_FULL false
#endif

@NicoHood
Copy link
Owner

Interesting. Try the UNO or Mega file. Both should work the same, no
matter what board is used.
Can you try to upload a hex file via avrdude in the tools folder? the
usbserial firmware for example.

I'd have to get a board myself to test this. and I wont buy this myself.

Nico

On 3/23/2015 9:41 PM, Marcus wrote:

Yes im using the 2.0.4 version for the 8u2, the flashing went through
without any errors, (i used a Arduino Mega ADK to flash the UNO with
Hoodloader 2.0.4)

And yes i can still upload sketches to the 328. (for example the blink
from arduinos example sketches).

i used these settings in the ino sketch:

|// make some of these false to reduce compile size (the ones you don't want)
#define USE_ATMEGA8U2 true
#define USE_ATMEGA16U2 false
#define USE_ATMEGA32U2 false
#define USE_AT90USB162 false // todo, not supported

// also use Mega 16u2 bootloader files?
#define USE_MEGA_BOOTLOADER false

// force Mega bootloader for blind pin selection/DFU hex file
#define FORCE_MEGA_BOOTLOADER false

// DFU options (16u2 only)
#ifdef USE_ATMEGA16U2
#define USE_ATMEGA16U2_DFU true
// use the full 16kb DFU Bootloader with USB-Serial
// you have to deactuivate the mega bootloader then
// but you can stull burn a mega DFU file in the followed setting
#define USE_ATMEGA16U2_DFU_FULL false
#endif
|


Reply to this email directly or view it on GitHub
#6 (comment).

@NicoHood
Copy link
Owner

Do you have a 16u2 to test this? Maybe the fuses are set wrong :S
I'd have to retest this myself. Maybe i uploaded crap?

On 3/23/2015 9:32 PM, Marcus wrote:

I have been trying to upload the HoodLoader2_NoUSB_Blink to the 8u2
(since i do not have the space to fit the HID library for keyboard).
but every time it fails to verify. here is the output from Arduino 1.6.1

|Sketch uses 646 bytes (15%) of program storage space. Maximum is 4 096 bytes.
Global variables use 9 bytes (1%) of dynamic memory, leaving 503 bytes for local variables. Maximum is 512 bytes.
Forcing reset using 1200bps open/close on port COM14
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
PORTS {COM1, COM14, } / {COM1, COM14, } => {}
Uploading using selected port: COM14
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf -v -patmega8u2 -cavr109 -PCOM14 -b57600 -D -Uflash:w:C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:i

avrdude: Version 6.0.1, compiled on Jan 15 2015 at 16:58:43
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

      System wide configuration file is "C:\Program Files (x86)\Arduino/hardware/tools/avr/etc/avrdude.conf"

      Using Port                    : COM14
      Using Programmer              : avr109
      Overriding Baud Rate          : 57600
      AVR Part                      : ATmega8U2
      Chip Erase delay              : 9000 us
      PAGEL                         : PD7
      BS2                           : PC6
      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    20     4    0 no        512    4    128  9000  9000 0x00 0x00
        flash         65     6    64    0 yes      8192   64    128  4500  4500 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
        lock           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
        signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

      Programmer Type : butterfly
      Description     : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .
Found programmer: Id = "HL2.0.4"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
Device code: 0x44

avrdude: devcode selected: 0x44
avrdude: AVR device initialized and ready to accept instructions

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

avrdude: Device signature = 0x1e9389
avrdude: reading input file "C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex"
avrdude: writing flash (646 bytes):

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

avrdude: 646 bytes of flash written
avrdude: verifying flash memory against C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:
avrdude: load data flash data from input file C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex:
avrdude: input file C:\Users\Marcus\AppData\Local\Temp\build3428156613028146164.tmp/HoodLoader2_NoUSB_Blink.cpp.hex contains 646 bytes
avrdude: reading on-chip flash data:

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

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

avrdude done. Thank you."
|


Reply to this email directly or view it on GitHub
#6.

@thesymbol
Copy link
Author

Interesting. Try the UNO or Mega file. Both should work the same, no
matter what board is used.

what files are you reffering to?

Can you try to upload a hex file via avrdude in the tools folder? the
usbserial firmware for example.

Getting the same error, or atleast a similar validation error.

Do you have a 16u2 to test this? Maybe the fuses are set wrong :S
I'd have to retest this myself. Maybe i uploaded crap?

No i do not have a 16u2 to test, i wish i had. :(

@NicoHood
Copy link
Owner

Too bad the ADK has no 16u2.
In the uploading process you can say 'M' for mega and 'U' for uno. try both.

Otherwise I have no clue why that error occurs. Is it a real atmega 8u2
or atusb9082? What does the print on the chip say?

Where do you live? I'd be willing to test this if you send me the board
on your cost or buy me one. ADK is 25€ on banggood.
Otherwise I suggest you to use a mega and buy a shield separate for usb
host if needed.

Nico

On 3/23/2015 9:48 PM, Marcus wrote:

Interesting. Try the UNO or Mega file. Both should work the same, no
matter what board is used.

what files are you reffering to?

Can you try to upload a hex file via avrdude in the tools folder? the
usbserial firmware for example.

Getting the same error, or atleast a similar validation error.

Do you have a 16u2 to test this? Maybe the fuses are set wrong :S
I'd have to retest this myself. Maybe i uploaded crap?

No i do not have a 16u2 to test, i wish i had. :(


Reply to this email directly or view it on GitHub
#6 (comment).

@thesymbol
Copy link
Author

it says
ATMEL
mega8u2
and two more rows that i cant read.

i think the uno is a rev 1 since the mega8u2 chip is turned a bit so it looks like a diamond when the arduino is correctly orianted.

I think the mega has a 16u2 but cant make out the text that well, but i wont flash that board since im borrowing it from a friend.

Im not willing to pay for a board tho, i might just try and get my hands on a 32u2 or 16u2 uno later down the road.

@NicoHood
Copy link
Owner

yeah. just grab a new one.
It would be interesting to get it working though. very weird. And i
have no real idea why. maybe I compiled the files wrong?

Can you please open an issue on github? maybe others have this problem
as well. also as reminder for me.
I will try to recompile the bootloader. Just remind me. I think I
probably forgot to change the size of the bootloader.

Nico

On 3/23/2015 10:03 PM, Marcus wrote:

it says
ATMEL
mega8u2
and two more rows that i cant read.

i think the uno is a rev 1 since the mega8u2 chip is turned a bit so
it looks like a diamond when the arduino is correctly orianted.

I think the mega has a 16u2 but cant make out the text that well, but
i wont flash that board since im borrowing it from a friend.

Im not willing to pay for a board tho, i might just try and get my
hands on a 32u2 or 16u2 uno later down the road.


Reply to this email directly or view it on GitHub
#6 (comment).

@thesymbol
Copy link
Author

this conversation is already on github ;)

Tried to flash an old hid .hex firmware from another project that i used to be able to flash and got this

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

avrdude.exe: safemode: Fuses OK (E:FC, H:D8, L:EF)

avrdude.exe done.  Thank you.

here is the output from flashing the normal Arduino-usbserial-uno.hex

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

avrdude.exe: safemode: Fuses OK (E:FC, H:D8, L:EF)

avrdude.exe done.  Thank you.

If i take your HoodLoader2_0_4_Uno_8u2.hex file and flash it it goes through and verify correctly

avrdude.exe: verifying ...
avrdude.exe: 8192 bytes of flash verified

avrdude.exe: safemode: Fuses OK (E:FC, H:D8, L:EF)

avrdude.exe done.  Thank you.

@NicoHood
Copy link
Owner

how do you flash? via real ISP or via installation sketch?

Totally missed, that this was a github post. though it was by mail from my blog. well.... :D

@thesymbol
Copy link
Author

I dont have a real ISP, and im flashing with avrdude.exe from the tools folder directly to the UNO.
i also tried doing the bootloader_converter.lua way but the .hex file's turned into 16384 when the 8u2 only has 8192 of memory to flash to and that will just end badly if i try to flash that.

hehe, the more you know eh? ;)

@thesymbol
Copy link
Author

i tried the M way aswell nothing changed.

@thesymbol
Copy link
Author

Got some good news, i managed to manually upload the sketch (HoodLoader2_NoUSB_Blink) to the 8u2, but to do so i had to use avrdude and specify at90usb82 instead of atmega8u2 for the -p parameter. im guessing this is because its a rev 1 uno.

The command i used was this:
avrdude -C avrdude.conf -F -p at90usb82 -c avr109 -b 57600 -P COM14 -U flash:w:HoodLoader2_NoUSB_Blink.cpp.hex:i

now the RX and TX leds are blinking as they should :D

@NicoHood
Copy link
Owner

Try to change this line to at90usb82, restart the IDE and try to upload.
It should then work. If yes, I'll probably add this MCU type as well.

Still weird though.

https://github.com/NicoHood/HoodLoader2/blob/master/avr/boards.txt#L164

@thesymbol
Copy link
Author

Already one step ahead of you, did that already (but copied the whole 8u2 section and renamed it to at90usb82).
But i get an signature verification error if i dont specify -F to skip the check.

avrdude: Device signature = 0x1e9389
avrdude: Expected signature for AT90USB82 is 1E 93 82
         Double check chip, or use -F to override this check.

@NicoHood
Copy link
Owner

that is weird.

So you get an error with the IDE on both 8u2 and at90usb82.
With avrdude you only get an error with 8u2, right?

I am wondering why avrdude accepts the wrong device signature with manual control
A good idea is to provide a blink.hey file. good idea!

The only thing I can think of is to burn the hex file via ISP and not with the installation sketch. maybe the conversion was wrong.
I know this page has to be improved, but you may want to try ISP with one of your other arduinos.
https://github.com/NicoHood/HID/wiki/Arduino-as-ISP

@NicoHood NicoHood reopened this Mar 24, 2015
@thesymbol
Copy link
Author

So you get an error with the IDE on both 8u2 and at90usb82.
With avrdude you only get an error with 8u2, right?

in the IDE i get the signature verification check error (and it suggest to force it with -F)
so when i enter the same command manually into cmd with the -F parameter the upload goes through successfully.

I am wondering why avrdude accepts the wrong device signature with
manual control A good idea is to provide a blink.hey file. good idea!

The -F parameter makes avrdude skip the verification completely and just uploads the data to the 8u2 without questioning the signature of the device.

The only thing I can think of is to burn the hex file via ISP and not with the installation sketch. maybe the conversion was wrong.
I know this page has to be improved, but you may want to try ISP with one of your other arduinos.
https://github.com/NicoHood/HID/wiki/Arduino-as-ISP

Doesnt there exist a list of devices (atmega16u2 etc) with their device signatures? could help in finding why the at90usb82 doesnt match the uno 8u2 chip.

@NicoHood
Copy link
Owner

here is the signature
https://github.com/nickgammon/arduino_sketches/blob/master/Atmega_Board_Programmer/Atmega_Board_Programmer.ino#L282-L286

try to burn via isp, maybe the installation sketch did something wrong.

@thesymbol
Copy link
Author

still no success, still getting the verification error of the device if i use at90usb82 and with atmega8u2 i get the 0xff != 0x0c

@NicoHood
Copy link
Owner

With an ISP you can do 2 things:
Burn a bootloader and try to upload via bootloader
or flash a program directly

Can you please try both versions? At least uploading the blink via the IDE via programmer should work, since it has nothing to do with the bootloader itself.

@thesymbol
Copy link
Author

Uploading normal ino for the 328 works.
I do not have the ADK anymore (had to give it back today) so i cannot test this if i need the ADK as ISP.

but if i do not can you point me in the right direction (im a bit confused by you phrasing) what do you mean by flashing a program directly?

@NicoHood
Copy link
Owner

You can flash a program via bootloader or via ISP. You can burn Bootloaders only via ISP.

I want to know if its an IDE or chip problem or a bootloader problem. When you upload the blink via ISP there is no bootloader used. If this works, we know that its not a chip/IDE problem.

Then you can burn the bootloader via ISP instead of the installation sketch (which emulates an ISP but a bit different stil, with file conversion etc). Then we know if its an installation sketch problem or a real bootloader problem.

Just buy a new Arduino with a 16u2. One from china is 6,5€ so why not buy one with even a better usb chip? It takes some time till it arrives but otherwise you wont be able to use it, it seems. And I have no idea where to get a 8u2 from and also it doesnt really make sense to buy that "old" chip.

@thesymbol
Copy link
Author

Im going to buy one when i get the time for it, but im probably going to buy a real arduino.

I dont mind paying extra for the real deal :P
i will just have to make sure its a 16u2 and not a 8u2 but i guess all rev 3 has 16u2?

i will report back once i get my hands on a new arduino.

@NicoHood
Copy link
Owner

All rev3 (official ones) have a 16u2 so you are at the secure side. Good idea to support the developers!

FYI: march 28th is Arduino day. I think a lot of shops offer sales. So you should have a look then (this saturday). Sparkfun, Adafruit and Seeed looks promising (for international shops, also see local sellers).

@thesymbol
Copy link
Author

Ah thx, then i dont have to worry that i get a different chip. I love the arduino so its a no brainer to support the developers :P

Ok I will look for deals on the 28th then :D

@chandran13
Copy link

Greetings

I am chandran from Chennai India I get the following error can you pl help not very good on electronis or programming

Arduino: 1.6.3 (Windows 7), Board: "Arduino Uno"

HoodLoader2_Installation_Sketch.ino.ino:218:35: fatal error: bootloader_atmega16u2.h: No such file or directory

compilation terminated.

Error compiling.

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

regards
chandran

@NicoHood
Copy link
Owner

What chip do you want to use? 8u2 or 16u2?
Have you changed anything in the sketch?

It compiles for me, not sure what you are doing wrong. In the IDE you must see several tabs with different .h files.

@chandran13
Copy link

16u2

I have not touched any thing in sketch

@NicoHood
Copy link
Owner

NicoHood commented Aug 8, 2015

Issue opened. Looks like an avrdude bug. And I cannot imagine of any clean solution for this. I could compile the hex file for the at90usb82 and mark it as an 8u2 (as you have it right now) and change the boards.txt. Since avrdude wont be updated in the IDE (even if they'd have a patch) there is no other way to fix it.

You have time to play with it now. can you also test if the IDE uploading now works (edit the baords.txt and set the at90usb82 mcu instead).

@NicoHood NicoHood added the bug label Aug 8, 2015
@thesymbol
Copy link
Author

i will give it a shot as soon as im back at my computer.

@NicoHood
Copy link
Owner

NicoHood commented Aug 8, 2015

screenshot from 2015-08-08 18 02 45

Looks like an avrdude configuration file issue.

@NicoHood
Copy link
Owner

NicoHood commented Aug 8, 2015

Thx for all the help.
So today we found 2 bugs. And both make HL2 not work with 8u2 or at90usb82 :D
I'll wait for some feedback from them now.

HL2 > Lufa (fixed in HL2, not yet in lufa itself, affected at90usb82)
HL2 > Arduino > avrdude (has to be fixed on one of those projects, affected atmega8u2)

@thesymbol
Copy link
Author

Glad i could help with figuring this out 👍

EDIT: changed the boards.txt and added the special version of the at90usb82 and i can compile in the gui now aswell! thanks alot for this.
Will have to reflash once the bugs are fixed in avrdude 👍

@NicoHood
Copy link
Owner

Cool. Any bugs you noticed? I tent to push this to master soon.

What about Windows 10 drivers? Does it work natively?

@thesymbol
Copy link
Author

No bugs so far, other than i cannot fit the entier USBCore on the 8u2 (not enough space to store it).
And there was no need for drivers on windows 10.

@NicoHood
Copy link
Owner

Oh sure, space could be a problem. You can use it without usb or without serial I think.
Thx for the infos!

@thesymbol
Copy link
Author

It works without USB atleast when i try and compile in DFU mode in Arduino IDE. and i can get the LEDs to blink and get some output from the chip without problem.

@NicoHood
Copy link
Owner

Could you do me a favor? I need a screen shot of the window that pops up if you try to install the Teensy driver:
https://www.pjrc.com/teensy/serial_install.exe

Do not fully install it, abort it but take a screenshot with Control + Print please. There must pop up two windows. A welcome window and a windows "do you really want to install" like window. Please shot both. You can drop the pics here in the github comment. That'd be nice, because I dont have a windows system here.

@thesymbol
Copy link
Author

Sorry for being so late to respond.
sadly i have already installed it on my machine so i can not take screenshots of it.
It is possible to do it through a virtualmachine, but if you can wait a while i might be able to take some shots off my laptop when im done installing windows on it again :)

@NicoHood
Copy link
Owner

Nevermind, played with win10 today.
install
install2

@thesymbol
Copy link
Author

Oki, sorry that i couldnt help.

@NicoHood
Copy link
Owner

at90usb82 support now got added. the problem with avrdude is still there though.

Can you please try to force upload the bootloader to your 8u2 (better use the at90usb82 bootloader and modify the installation sketch a bit, I trust in you that you can do that) and upload this sketch then:
https://github.com/nickgammon/arduino_sketches/tree/master/Atmega_Self_Read_Signature

Can you please report your signature then?

@thesymbol
Copy link
Author

I will see what i can do, but I do not have the time to do it today, might be able to do it tomorrow tho.

@thesymbol
Copy link
Author

i have forced the at90usb82 hex to upload to the arduino now, no problem there but im having trouble making the signature reading scetch to fit onto the 8u2's 4096 byte memory. (the scetch is 15592 bytes large).

@NicoHood
Copy link
Owner

hahaha damn. Well I contacted atmel now. If they dont respond I will ask Joarg wunsch again for patching avrdude anyways. for now there is no better solution and its not a bug of the hoodloader2 itself.

@thesymbol
Copy link
Author

well i managed to get it down to around 5000 bytes but it looks like the usbcore is still uploading (taking away around 3000 bytes). so the program should fit onto the 4096 bytes of memory if i dont have to upload the usbcore.

@NicoHood
Copy link
Owner

place #undef USBCON inside arduino.h and replace serial with serial1. you need to read the data via the RX pin of the uno from another board/ftdi device.

@thesymbol
Copy link
Author

After doing some tinkering i now cant compile the .ino file, getting


In file included from C:\Users\thesymbol\Desktop\Atmega_Self_Read_Signature\Atmega_Self_Read_Signature.ino:35:0:

d:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\boot.h:116:6: error: #error AVR processor does not provide bootloader support!

 #    error AVR processor does not provide bootloader support!

      ^

d:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\boot.h:127:4: error: #error Cannot find SPM Enable bit definition!

 #  error Cannot find SPM Enable bit definition!

    ^

exit status 1
Error compiling.

this happened when i did a clean install of arduino ide 1.6.6

@NicoHood
Copy link
Owner

which ino file? which nightly build? For me it works with the IDE from yesterday, recompiled myself

@thesymbol
Copy link
Author

Arduino 1.6.6 Hourly Build 2015/09/28 05:01
and the self read signature ino file, it complains about <avr/boot.h>

@NicoHood
Copy link
Owner

Seems like an avrlib problem. Can you please post your fully modified sketch somewhere? Via github repository, via fork of this repo is maybe the best idea.

Very interesting.

@thesymbol
Copy link
Author

Here is the modified version of the ino file: https://gist.github.com/thesymbol/483dcdbd88f057d2d3eb
i removed the md5 functions since that was taking up around 10kb, and it didnt have any problems before i did a clean install.

@NicoHood
Copy link
Owner

What did your setup look like before?

@thesymbol
Copy link
Author

i used an older version of the nightlies, but i do not have that left sadly. it was the old PR version atleast that is what i know, and i installed the hardware manually. (HoodLoader2 folder in the Arduino folder in Documents).

@NicoHood
Copy link
Owner

Closing as this is an avrdude problem. Information can be found in this issue.

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

No branches or pull requests

3 participants