0

ATMEGA32U4 Breakout Board (296) dead
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

ATMEGA32U4 Breakout Board (296) dead

by CIM on Sat Apr 14, 2018 6:32 pm

We recently purchased an ATMega32u4 Breakout Board, and have tried to load a test program (Blink) using Arduino 1.8.5 and then AVRDude. At first, the PC recognised the board (using a .inf driver from Pimoroni) and assigned it a COM port, but neither Arduino nor AVRDude recognised the COM port assigned, even though it showed up in the PC device manager, and therefore would not program it. We have tried all of the reset board tricks, deleted and reloaded drivers, replaced cables.

We have a LattePanda 2/32 which has an Arduino Leonardo with the same processor and a LUFA core / bootloader, and that works fine from Arduino 1.8.5, so its not the PC host, either. Looks like dud hardware. Replacement, please? How do we go about this?

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by adafruit_support_mike on Sun Apr 15, 2018 11:46 pm

Does the red LED pulse when you click the reset button?

adafruit_support_mike
 
Posts: 54079
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Mon Apr 16, 2018 5:46 am

When we power up for the first time, only the green LED is on, and the PC (running Win7 Pro) double beeps and assigns COM17. Pressing RESET disconnects the COM port, flashes the red LED five times, and reconnects the COM port, and the red LED goes out. Using Arduino 1.8.5 (with the board type set to Leonardo) and port = COM17, pressing upload starts a sketch compile. When compile completed, and the status message changes to "Uploading", the PC disconnects the port, and then Arduino hangs, waiting for the upload to complete. No LEDS flash on the board.

As the PC disconnects the port, it suggests that the board has either changed the port number, and the PC can't detect this, or the board has simply pulled the plug and gone to sleep. Attempting either single or double press RESET during the compile doesn't help, as the port isn't connected by the time Uploading starts, and the PC reports that the port cannot be found, and hangs again.

We have now acquired an Arduino Pro Micro with the 324 chip, and this behaves exactly the same, which suggests that this is a firmware problem with the generic 324 bootloader as opposed to a hardware fault. We also have an Arduino Nano, and this works perfectly, uploading and running Blink as expected - different USB system, and presumably, a different bootloader. The LattePanda onboard Leonardo seems to be ok with the LUFA USB core - is this the same bootloader as yours?

We have read lots of posts about "bricked" 324's going back a long way - is this an industry wide problem? And anyway, if we can't load even one program, how can we change / update the bootloader? Very confusing.

We have also tried the same exercise for your board on the LattePanda which is running Windows 10 and Arduino, again set to Leonardo. The LTP assigns COM3, but then behaves exactly the same as the PC running Win7, so it doesn't help. However, the LTP onboard Leonardo on USB COM1 works ok, loading and running Blink.

Perhaps "dead" in our title line was the wrong word - "ill" is probably better?

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by adafruit_support_mike on Mon Apr 16, 2018 11:20 pm

It's an issue with USB signal timing on high-speed and USB-3 ports. The device recognition starts with a burst of data 30x faster than the 32u4's CPU clock, and sometimes the code that handles the USB connection crashes.

Enable verbose messages during upload in the Arduino IDE's preferences, upload a sketch without bothering to select a port, and click the reset button when you see the lines that egin with 'PORTS' start to scroll past. That will force the bootloader to launch and open a USB connection while the IDE is waiting for a device to do that. Things usually fall back in line after that.

adafruit_support_mike
 
Posts: 54079
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Tue Apr 17, 2018 5:36 am

Blinkscreen.jpg
Copy of the Arduino screen at point of upload failure
Blinkscreen.jpg (149.2 KiB) Viewed 337 times


This was tried on the Win7 PC.

I tried what you suggested, but pressing reset at the PORTS point just locked everything up when the PC uninstalled the board. If I just leave it alone and let it run through without a reset, the PORTS section has a forced reset of COM17 by setting the baud rate to 1200 baud, then 2 PORTS lines, the second with an assignment output to COM17, and then a confirmation that COM17 was set as the upload port.

Unfortunately the Arduino IDE doesn't allow you to copy the output to the clipboard, so I include a .jpg of the failure text for the upload. It all looks sensible, sets the correct programmer (AVR109) by invoking through avrdude, waits for it, and then locks up again.

An additional piece of information - both on the Win7 PC and on the LattePanda, I used a USB 3.0 (blue) port for the test, and the board was recognised and showed in the Device Manager list correctly. I then retried using a USB 2.0 port, and on both CPU's, the board was not recognised. To make sure that the test was run on a level playing field, I logged the board into the USB 3.0 port, then uninstalled the board and its driver, then moved it to a USB 2.0 port, and it still failed. I persisted, trying it again, and on the third attempt, the PC recognised it, but had no driver, so it went looking for one, correctly identifying the board as a Leonardo, but this time could't find a driver. I tried again using the USB 3.0 port, and still couldn't find one.

It first identified an an unknown device, an AVR CDC Bootloader, then changed to an Arduino Leonardo, but still couldn't find a driver. I tried pointing it at the .inf driver downloaded from Pimoroni (which worked), but no dice, it wouldn't load it and it still couldn't find one on Windows. Pressing reset and getting it to reload didn't help.

Is there a better (i.e sure-fire) USB port driver you can point me at which is tested on USB 2.0 and 3.0? The fact that the board wasn't recognised on USB 2.0 when it did have a driver is probably an indication that the driver is non-compliant in some way.

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Wed Apr 18, 2018 7:53 am

More information.

I ran the board through a Beagle USB480 analyser to see what is actually happening. In the "rest" state connected to the Win7 PC, it is cycling every 2 seconds with just 3 transfers:-

2000 SOF, 63 IN-NAK and 68996 IN-NAK. When I compile and upload, it runs through a series of exchanges (reseting ports, baud rate changes, passing ident strings etc)., but at the point where the Arduino IDE is trying to contact the programmer, the board is back in its 3 transfer loop, and so there is a sync failure somewhere in the exchanges.

Just in case this was a Win7 problem, I also downloaded the Arduino IDE into an laptop running XP Pro, but no difference, it still failed.

I am out of suggestions and things to try.

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by adafruit_support_mike on Wed Apr 18, 2018 11:28 pm

There's still a timing issue to nail down. I just double-checked the documentation to make sure, and that board doesn't automatically reset when you do an upload:

https://learn.adafruit.com/atmega32u4-b ... th-arduino

How much time are you giving the bootloader to become active and open a USB connection before the IDE starts looking for a COM port to send data?

adafruit_support_mike
 
Posts: 54079
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Thu Apr 19, 2018 5:03 am

This is one of the problems, I think. If you try to press the reset and get the bootloader LED blinking, by the time the PC has recognised the event and removed the COM port, then waited for the board to re-apply and a new port is reinstated, the bootloader LED has gone out. There is no combination of delays in either direction that can have a connected port with the bootloader still active, because the clear and re-instate takes longer than the 8 second window that the bootloader is supposed to have (I don't think it is a function of PC reaction time, either - my PC is a quad core i7). Tried single and double pulse resets, still no difference.

I don't know if there is a mechanism within Windows for locking a COM port in the Device Manager? Can't find one, but that doesn't mean that one doesn't exist.

I can't be the only one suffering this problem - I have been forum scanning to see what anyone else does, but so far, nothing gives any clues.

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Thu Apr 19, 2018 8:14 am

I have now tried to disable Windows Plug and Play in services.msc - despite what MS says, you cannot do this, even as Administrator - a very frustrating morning wasted.

To make sure it isn't something in the Arduino IDE, I tried using just AVRDude (in the WinAVR package) from the command prompt:-

C:/>avrdude -c AVR109 -p m32u4 -P COM17 -U flash:w:blink.hex

It replied "waiting for programmer", waited for about a minute, and then gave a serial error. Tries various reset / delays etc, still no dice.

So - how DO you program this board? How did YOU do it before you shipped it, and with what?

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by adafruit_support_mike on Fri Apr 20, 2018 12:14 am

Windows does make the reset timing a challenge, no argument there. The hardware is deterministic though, so once you find the right timing it tends to be highly repeatable.

Working from the command line with avrdude, you should be able to click the reset button a second or two before hitting the return key on the command and have things sync up.

adafruit_support_mike
 
Posts: 54079
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Fri Apr 20, 2018 6:23 am

I have already tried what you suggested, but there are no circumstances when this board and Windows can work together.

When you press reset and the "bootstrap" led is blinking (presumably waiting for input), Windows disconnects the port, so there is no time when the bootstrap phase is active that there is a live port connected to it. Windows only reconnects the port when the bootstrap phase ends.

So, my question again - how do YOU do it? Are you using Windows or (perhaps) a Linux-based rig which doesn't have such an aggressive plug-and-play strategy?

Is there anyone else viewing this forum topic who has either the same problem or who has a solution?

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Fri Apr 20, 2018 7:23 am

BADUSB.jpg
BADUSB.jpg (254.15 KiB) Viewed 274 times


This morning I received a different ATMEGA32u4 board, plugged it into the Win7 PC which registered it as COM15, ran the Arduino IDE and programmed "blink", which ran correctly. Total time spent, less than 1 minute.

I think that you have a problem with your breakout board firmware - either just on this board (can I have a replacement, please, to test?) or generically.

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Re: ATMEGA32U4 Breakout Board (296) dead

by adafruit_support_mike on Fri Apr 20, 2018 11:12 pm

When we connect a board to a Windows machine, we click the reset button, start the upload, and it works. The same is true for pretty much everyone who's bought one of those boards in the years we've been making them.

The comparison test with another ATmega32u4 confirms your machine will handle the connection, but the upload behavior you've described points to a highly specific and unusual kind of failure. In general, a chip with a failed USB interface won't show up as a device at all. One with a bad bootloader won't pulse the LED indicating it's ready for an upload.

We can try another board and see if that helps. Send a note containing a link to this thread and your order number to support@adafruit.com. The folks there will get you another 32u4 breakout.


(#296)

adafruit_support_mike
 
Posts: 54079
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATMEGA32U4 Breakout Board (296) dead

by CIM on Sun Apr 22, 2018 7:54 am

OK, request sent - will update this post after testing replacement

CIM
 
Posts: 9
Joined: Fri Apr 13, 2018 8:29 am

Please be positive and constructive with your questions and comments.