SparkFun's ATmega32u4 loading issues

Need help? Ask here and someone will help
Post Reply
WayfaringNinja
Posts: 6
Joined: Wed Nov 21, 2012 3:06 am

SparkFun's ATmega32u4 loading issues

Post by WayfaringNinja »

Hi there! First post!

I'm a little frustrated with the lack of information I've been able to dig up and calling out to see whatever I can find.

First of all, I just wish I just bought the official teensy instead of SparkFun's "teensy". The teensy loader of course doesn't work with mine, but it was worth a shot.
Then I tried Flip 3.4.7 (Win7 64bit), got a libusb0.dll missing error, fixed that by copying the libusb0.dll from the "usb" folder in the Flip directory over to the system32 folder. But then Flip throws another missing dll error, this time missing atlibusbdfu.dll <--- this is where I get really frustrated, because every where I've looked in the past 4 hours on this problem always winds up that the person fixed it and didn't explain how. I've copied atlibusbdfu.dll from the Flip 3.4.7 "bin" folder into every directory for Flip and the system... and it still comes up. Of course I tried run as admin, same thing, reboot, no change...

I've tried this on 2 different windows xp machines, 64bit ubuntu 11.10, and 64bit windows 7 all with the no results.

SparkFun's(https://www.sparkfun.com/products/11117) product page on this says to use AVRdude but I can't figure that out to save my life! I can handle command prompt no problem but my issue again is I can't find enough information to figure out how to program the ATmega32u4 with it. I just don't know how to use it.

I've confirmed that SparkFun's drivers are installed for the ATmega32u4 CDC bootloader to work. I just can't get Flip to work well enough to see it, and haven't the slightest clue on how to load the hex file with AVRdude 5.11

HAALP! PUHLEEZE!
WayfaringNinja
Posts: 6
Joined: Wed Nov 21, 2012 3:06 am

Re: SparkFun's ATmega32u4 loading issues

Post by WayfaringNinja »

OK so now I've installed WinAVR just to see what happens and oddly enough it seems to solve my issue with Flip saying it can't find atlibusbdfu.dll... So that's good, but now when I try to connect to the atmega32u4 with Flip it says "Could not open USB device" which is exactly the message you would get if it wasn't even plugged in. I've checked that the drivers for the atmega are installed (They're sparkfun drivers), and it shows in the device manager properly, but Flip can't see it.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: SparkFun's ATmega32u4 loading issues

Post by Matlo »

Some flip documentation (may be outdated): http://www.atmel.com/Images/doc7769.pdf
Did you check the Flip directory for instructions?

Avrdude for windows: http://www.nongnu.org/avrdude/user-manu ... de_19.html
GIMX creator
WayfaringNinja
Posts: 6
Joined: Wed Nov 21, 2012 3:06 am

Re: SparkFun's ATmega32u4 loading issues

Post by WayfaringNinja »

Just looking through the flip information quickly while I have time today. I've read all of that before, the problem is, there is only one button on this m32u4 (that doc is for an at90 I know) and when I push it absolutely nothing happens accept it disconnects from my computer and reconnects as soon as I release it. The LED never does anything but stay on, never blinks at all. I've read up on how to jump it with the ground but the "pins" are all labeled differently. I've tried installing the flip drivers when it detects the device but it always tells me it's not suitable, only the SparkFun inf works but doesn't get picked up by Flip or anything else. The atmega shows up as "AVR CDC Bootloader" without the drivers installed and "Sparkfun COM port (COM15)" when it is installed...
WayfaringNinja
Posts: 6
Joined: Wed Nov 21, 2012 3:06 am

Re: SparkFun's ATmega32u4 loading issues

Post by WayfaringNinja »

The AVRDude documentation isn't helping me either. I just thought there would be an example anywhere out there that would tell me how to use the thing... I can run commands with special parameters no problem I just have no idea what those options should be...
WayfaringNinja
Posts: 6
Joined: Wed Nov 21, 2012 3:06 am

Re: SparkFun's ATmega32u4 loading issues

Post by WayfaringNinja »

I've now tried the AVR Studio 6 to program it but once again there isn't any "tool" to use to upload the firmware through USB, just the AVR Simulator.
So I'm back on trying this is AVRdude as the SparkFun page suggests, I have a few questions I need help with.

avrdude -c ??? -P COM15 -p m32 -U flash:w:atmega32u4.hex

^^^ This is the command I think I need to use to load the firmware, but I'm not sure what "programmer" to use, every option seems to search for an external hardware programmer. So which programmer do I use from this list?:

[*]Valid programmers are:
dasa3 = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [C:\WinAVR\bin\avrdude.conf:763]
dasa = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [C:\WinAVR\bin\avrdude.conf:750]
siprog = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [C:\WinAVR\bin\avrdude.conf:737]
ponyser = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts [C:\WinAVR\bin\avrdude.conf:724]
frank-stk200 = Frank STK200 [C:\WinAVR\bin\avrdude.conf:689]
blaster = Altera ByteBlaster [C:\WinAVR\bin\avrdude.conf:676]
ere-isp-avr = ERE ISP-AVR <http://www.ere.co.th/download/sch050713.pdf> [C:\WinAVR\bin\avrdude.conf:666]
atisp = AT-ISP V1.1 programming cable for AVR-SDK1 from <http://micro-research.co.th/> [C:\WinAVR\bin\avrdude.conf:656]
dapa = Direct AVR Parallel Access cable [C:\WinAVR\bin\avrdude.conf:645]
xil = Xilinx JTAG cable [C:\WinAVR\bin\avrdude.conf:632]
futurlec = Futurlec.com programming cable. [C:\WinAVR\bin\avrdude.conf:615]
abcmini = ABCmini Board, aka Dick Smith HOTCHIP [C:\WinAVR\bin\avrdude.conf:605]
picoweb = Picoweb Programming Cable, http://www.picoweb.net/ [C:\WinAVR\bin\avrdude.conf:595]
sp12 = Steve Bolt's Programmer [C:\WinAVR\bin\avrdude.conf:584]
alf = Nightshade ALF-PgmAVR, http://nightshade.homeip.net/ [C:\WinAVR\bin\avrdude.conf:568]
bascom = Bascom SAMPLE programming cable [C:\WinAVR\bin\avrdude.conf:558]
dt006 = Dontronics DT006 [C:\WinAVR\bin\avrdude.conf:548]
pony-stk200 = Pony Prog STK200 [C:\WinAVR\bin\avrdude.conf:536]
stk200 = STK200 [C:\WinAVR\bin\avrdude.conf:520]
bsd = Brian Dean's Programmer, http://www.bsdhome.com/avrdude/ [C:\WinAVR\bin\avrdude.conf:509]
pavr = Jason Kyle's pAVR Serial Programmer [C:\WinAVR\bin\avrdude.conf:501]
dragon_dw = Atmel AVR Dragon in debugWire mode [C:\WinAVR\bin\avrdude.conf:494]
dragon_hvsp = Atmel AVR Dragon in HVSP mode [C:\WinAVR\bin\avrdude.conf:486]
dragon_pp = Atmel AVR Dragon in PP mode [C:\WinAVR\bin\avrdude.conf:478]
dragon_isp = Atmel AVR Dragon in ISP mode [C:\WinAVR\bin\avrdude.conf:470]
dragon_jtag = Atmel AVR Dragon in JTAG mode [C:\WinAVR\bin\avrdude.conf:462]
jtag2dw = Atmel JTAG ICE mkII in debugWire mode [C:\WinAVR\bin\avrdude.conf:454]
jtag2isp = Atmel JTAG ICE mkII in ISP mode [C:\WinAVR\bin\avrdude.conf:446]
jtag2 = Atmel JTAG ICE mkII [C:\WinAVR\bin\avrdude.conf:438]
jtag2fast = Atmel JTAG ICE mkII [C:\WinAVR\bin\avrdude.conf:430]
jtag2slow = Atmel JTAG ICE mkII [C:\WinAVR\bin\avrdude.conf:422]
jtagmkII = Atmel JTAG ICE mkII [C:\WinAVR\bin\avrdude.conf:414]
jtag1slow = Atmel JTAG ICE (mkI) [C:\WinAVR\bin\avrdude.conf:407]
jtag1 = Atmel JTAG ICE (mkI) [C:\WinAVR\bin\avrdude.conf:399]
jtagmkI = Atmel JTAG ICE (mkI) [C:\WinAVR\bin\avrdude.conf:391]
avr911 = Atmel AppNote AVR911 AVROSP [C:\WinAVR\bin\avrdude.conf:385]
avr109 = Atmel AppNote AVR109 Boot Loader [C:\WinAVR\bin\avrdude.conf:379]
butterfly = Atmel Butterfly Development Board [C:\WinAVR\bin\avrdude.conf:373]
usbtiny = USBtiny simple USB programmer [C:\WinAVR\bin\avrdude.conf:367]
usbasp = USBasp, http://www.fischl.de/usbasp/ [C:\WinAVR\bin\avrdude.conf:361]
avr910 = Atmel Low Cost Serial Programmer [C:\WinAVR\bin\avrdude.conf:355]
stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode [C:\WinAVR\bin\avrdude.conf:349]
stk500pp = Atmel STK500 V2 in parallel programming mode [C:\WinAVR\bin\avrdude.conf:343]
stk500v2 = Atmel STK500 Version 2.x firmware [C:\WinAVR\bin\avrdude.conf:337]
stk500v1 = Atmel STK500 Version 1.x firmware [C:\WinAVR\bin\avrdude.conf:331]
stk500 = Atmel STK500 [C:\WinAVR\bin\avrdude.conf:325]
avrisp2 = Atmel AVR ISP mkII [C:\WinAVR\bin\avrdude.conf:315]
avrispmkII = Atmel AVR ISP mkII [C:\WinAVR\bin\avrdude.conf:309]
avrispv2 = Atmel AVR ISP V2 [C:\WinAVR\bin\avrdude.conf:303]
avrisp = Atmel AVR ISP [C:\WinAVR\bin\avrdude.conf:297][*]

My other question is about the hex file. In "avrdude -c ??? -P COM15 -p m32 -U flash:w:atmega32u4.hex" the -U flash:w:atmega32u4.hex <-- Will this just create an empty hex file on the chip? How do I make sure it's going to load your hex file instead of just creating a new blank one?
WayfaringNinja
Posts: 6
Joined: Wed Nov 21, 2012 3:06 am

Re: SparkFun's ATmega32u4 loading issues

Post by WayfaringNinja »

UPDATE:
I managed to get it programmed using AVRdude in a 32bit Windows XP virtual machine. But I accidentally wrote it all to the Flash instead of the EEPROM, so it worked right after I programmed it but died after I finished testing and was ready to get it in a project box. I'm in the process now of building a simple AVR programmer because now the bootloader is gone and it's basically a blank chip...
Once I'm finished and satisfied that I have mine working I'll do a quick write-up for anyone trying to use SparkFun's ATmega32u4. Though after all this, it's just much MUCH simpler to just use the official teensy.
playonlcd
Posts: 2
Joined: Sun Dec 02, 2012 4:18 pm

Re: SparkFun's ATmega32u4 loading issues

Post by playonlcd »

I am having same issues with a minimus avr 32 k.
It is a ATmega32u2, tryed to program it with Flip but Windows XP dosen;t recognize it as joystick.
used ATmega32u4 hex and ATmega16u4, programmed ok with FLIP but no go.
Serial is good, tested with arduino ide.

Seesms it has bootloader, to program it i have to hold reset and hwb buttons, release reset and then reset; then it recognized as libusb device.
But if i just reset to run program, gives me unrecognized device.
User avatar
Matlo
Posts: 5768
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: SparkFun's ATmega32u4 loading issues

Post by Matlo »

GIMX creator
playonlcd
Posts: 2
Joined: Sun Dec 02, 2012 4:18 pm

Re: SparkFun's ATmega32u4 loading issues

Post by playonlcd »

Thanks, is working.
Good luck with xbox360 port. :)
Post Reply