Estonia
Offline
Newbie
Karma: 0
Posts: 17
Arduino rocks
|
 |
« on: May 20, 2012, 01:57:48 am » |
Hello! This is a bit embracing but I've managed to get my Arduino stuck thinking it is a HID device. I created a small test program on the arduino and then used Atmel's Flip software to upload the HID.hex file from this project http://hunt.net.nz/users/darran/weblog/cca39/Arduino successfully thinks it is a mouse now and follows the program that was uploaded prior to the hex file swap. However now I need to make some changes to the program but I can't get back to the usb-serial. Getting the UNO Rev3 hex file from https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares does not help. Flip says that the Hex file is not correctly formatted :/  Can anyone advise what I'm doing wrong?
|
|
|
|
« Last Edit: May 20, 2012, 11:25:34 am by TT »
|
Logged
|
|
|
|
|
|
|
Estonia
Offline
Newbie
Karma: 0
Posts: 17
Arduino rocks
|
 |
« Reply #2 on: May 20, 2012, 02:43:44 am » |
Seems that I was indeed saving an html version of the hex. It is better but still not there. Now when opening the HEX I get an error "Address is out of range." In Flip, the device is set to ATmega16U2 (rev3 UNO) 
|
|
|
|
« Last Edit: May 20, 2012, 03:09:06 am by TT »
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 119
Posts: 10170
|
 |
« Reply #3 on: May 20, 2012, 03:38:12 am » |
Now when opening the HEX I get an error "Address is out of range." Someone else will have to help with that error. It is outside of my experience.
|
|
|
|
|
Logged
|
|
|
|
|
Estonia
Offline
Newbie
Karma: 0
Posts: 17
Arduino rocks
|
 |
« Reply #4 on: May 20, 2012, 03:40:30 am » |
Still thanks for the quick response! Got me one step closer to getting my Arduino working again. Update: I toyed around with the buffer settings and now managed to get it working. For some reason it didn't adjust the Flash buffer range before. It seems as if the HEX gets uploaded nicely. But after replugging the arduino it is still acting as an HID device.  
|
|
|
|
« Last Edit: May 20, 2012, 04:02:01 am by TT »
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #5 on: May 20, 2012, 04:08:33 am » |
Try this: http://www.gammon.com.au/forum/?id=11638I just put that file (Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex) onto an SD card an verified it against my Uno USB chip, without errors. So the file is OK. You should be able to follow the wiring on that page (and get the SD card, heh) and re-flash the USB chip. Atmega hex file uploader. Written by Nick Gammon. Version 1.9 Reading SD card ...
HEX files in root directory:
FOO.HEX : 2915 bytes. ARDUIN~1.HEX : 20907 bytes. Created: 2012-05-17 16:16:06. Modified: 2012-05-17 16:16:06
--------- Starting ---------
Attempting to enter programming mode ... Entered programming mode OK. Signature = 0x1E 0x94 0x89 Processor = ATmega16U2 Flash memory size = 16384 bytes. LFuse = 0xEF HFuse = 0xD9 EFuse = 0xF4 Lock byte = 0xCF Clock calibration = 0x8B Actions: [E] erase flash [F] modify fuses [L] list directory [R] read from flash (save to disk) [V] verify flash (compare to disk) [W] write to flash (read from disk) Enter action:
V
Choose disk file [ ] ...
ARDUIN~1.HEX
Processing file: ARDUIN~1.HEX Checking file ...
############ Lowest address = 0x0 Highest address = 0x3D33 Bytes to write = 7414 No bootloader. Suggest making high fuse = 0xD9 Attempting to enter programming mode ... Entered programming mode OK. Processing file: ARDUIN~1.HEX Verifying flash ...
########################################################## No errors found.
|
|
|
|
« Last Edit: May 20, 2012, 04:24:17 am by Nick Gammon »
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #6 on: May 20, 2012, 04:10:17 am » |
It seems as if the HEX gets uploaded nicely. But after replugging the arduino it is still acting as an HID device.
Try rebooting the PC. I've heard some crazy tales about Windows and caching USB info.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #7 on: May 20, 2012, 04:11:00 am » |
Or, uninstalling the device driver and reinstalling.
Ah, Windows!
|
|
|
|
|
Logged
|
|
|
|
|
Estonia
Offline
Newbie
Karma: 0
Posts: 17
Arduino rocks
|
 |
« Reply #8 on: May 20, 2012, 04:23:22 am » |
Try rebooting the PC. I've heard some crazy tales about Windows and caching USB info. Ah, Windows! Hehe, good advice actually. " Have you tried turning it on and off again" Tried the reboot but still no change. I also have a mac nearby and its still acting as a mouse there aswell... Unfortunately I don't have an SD card module and they are not that freely available here  But the deadline for this project is within a few days so I'll have to find some other method.. I do have another UNO at home. Might be worth trying if i can flash the bootloader that way. But if possible I'd prefer to get it working just using the Flip software. Can't be that hard? 
|
|
|
|
« Last Edit: May 20, 2012, 04:25:28 am by TT »
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #9 on: May 20, 2012, 04:26:36 am » |
Well two things I noticed ... - The signature reported in your image doesn't agree with mine (0x1E 0x94 0x89)
- The file size (either on disk or as bytes to be changed) doesn't agree with mine (File: 20907 bytes ... Bytes to write = 7414)
So something fishy is going on.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #10 on: May 20, 2012, 04:34:02 am » |
|
|
|
|
|
Logged
|
|
|
|
|
Estonia
Offline
Newbie
Karma: 0
Posts: 17
Arduino rocks
|
 |
« Reply #11 on: May 20, 2012, 04:38:40 am » |
Darn, getting that Address is out of range error again..
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #12 on: May 20, 2012, 04:41:03 am » |
Don't use that Atmel software. Use something crafted by the Arduino community. 
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #13 on: May 20, 2012, 04:42:07 am » |
Show us your MD5 sum of the file you have.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Melbourne, Australia
Offline
Shannon Member
Karma: 219
Posts: 13896
Lua rocks!
|
 |
« Reply #14 on: May 20, 2012, 04:43:01 am » |
|
|
|
|
« Last Edit: May 20, 2012, 04:48:45 am by Nick Gammon »
|
Logged
|
|
|
|
|
|