Custom Atmega32u4 PCB connects to Windows as 'Unknown USB Device'

Go To Last Post
73 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm having a problem that i've seen in various posts like this one: 

http://www.avrfreaks.net/forum/l...

where a custom circuit board i've made isn't recognized properly in Device Manager. 

 

When I connect a different custom pcb that uses an atmega16u4 it shows up properly as an device under a newly created category in Device Manager.  I think i may be lacking drivers for the 32u4 since the 16u4 is properly recognized, but I haven't been able to find drivers for an atmega32u4 anywhere. The download mentioned in the linked post is merely a link to Atmel Studio 7. I've uninstalled and reinstalled this multiple times and the 32u4 still registers as an unrecognized USB device. Pressing reset while the HWB pin is pulled to GND does nothing to remedy this.

 

How can I verify I have drivers for the 32u4?

Images below.

 

32u4 shows up as Unknown device in Windows

windows does recognize 16u4 however

 

This topic has a solution.
Last Edited: Tue. Apr 4, 2017 - 04:41 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm not familiar with those chips but based on other megas I've used, I guess the only difference in the chips is the amount of memory.  So the code for the 16u4 should run in the 32u4. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Then, assuming the drivers are fine, what should I troubleshoot next?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it a bootloader that you are installing?  

 

The bootloader goes into memory above the application memory.  I don't know the details of your situation.  You may need to change the location where  the bootloader starts when you build it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No i'm not installing a bootloader. I'm trying to install a user program.

 

The the atmega32u4 (and 16u4) comes with a pre-installed bootloader out of the box. When the chip is properly recognized by Windows with a signed driver all you need to do is load a hex program onto it with atmel flip.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the bootloader working okay?  Does it indicate it has successfully installed your application program?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can't test the bootloader because the device isn't recognized by windows, therefore not recognized by Atmel FLIP when I select the "open USB device" option.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you testing the USB connection with the uC running the Bootloader?

 

The ATmega32U4 has the HWB input on  PE2 when the HWBE fuse bit is programmed.

 

Are you grounding the HWB input during Reset to start the Bootloader?

 

Check the fuses to verify that the HWBE fuse bit is programmed.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you testing the USB connection with the uC running the Bootloader?

Yes.

 

Are you grounding the HWB input during Reset to start the Bootloader?

Yes, this pin has been permanently grounded on my PCB.

 

Check the fuses to verify that the HWBE fuse bit is programmed.

How do i check the fuses?

Last Edited: Fri. Mar 17, 2017 - 02:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One typically uses an external programmer such as ISP to read the fuses.

If you don't have one, then don't worry about it for now.

 

Are you sure that the Bootloader is actually running?
 

From post #1, I take it that the board for the 16U4 is different than the one for the 32U4 - is this correct?

 

Have you checked the PCB for bad solder connections?  Shorted pins?

 

Would you show a partial schematic showing the power and USB connections?

 

 

Last Edited: Fri. Mar 17, 2017 - 03:55 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't have an ISP interface so I won't worry about it for now. I didn't have to change any fuses to get the 16u4 to work so I don't imagine that's the problem here.

 

I'm not 100% sure the bootloader is running; I merely assume it is after pressing the reset button while being plugged in to USB (that's what makes it run on my 16u4).

 

Youre right that the 16u4 board is different than this one. I've attached my two schematics for the 32u4 board below, you can open them with Eagle. GS_breakout_v1 is the USB male interface PCB that I wire to solder pads on the GS_board_v1 PCB (the main board). I did a basic multimeter check on the USB wires going from the breakout pcb to the main pcb and i'm seeing +5V on VBUS and ~3.6V on D+ & D-.

 

I haven't done a more thorough check on the pcb with my multimeter because i'm not sure what to test specifically but I can say that both PCBs should've passed fault tests before being fabricated by the manufacturer.

 

 

*Edit: Added schematics as PDFs*

 

Attachment(s): 

Last Edited: Fri. Mar 17, 2017 - 04:26 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:

I've attached my two schematics for the 32u4 board below, you can open them with Eagle.

 

Please use Eagle to generate  .pdfs of the schematics.  I believe that can be done through the print menu.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Added images to first post and pdfs to schematic post.

Last Edited: Fri. Mar 17, 2017 - 04:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

1) Have you verified that the 22 Ohm resistors are actually 22 Ohms?

 

2) What is the frequency of the xtal?  Did you verify the freq with a scope?

 

3) The uC connects to the USB connector on another board?  How long are the wires?  Is this the same as on the 16U4 board?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1) Yes, verified.

 

2) I scoped it at ~6kHz when plugged into USB. The power rail of the USB was showing 4.9V and the D+ & D- lines were at .39V

 

3) Yes, the wires between the usb and main pcb are about 2.5 inches long. Unlike this board, the 16u4 features a female usb port directly on the board itself instead of using a breakout board with a connector on it. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

re 2. 6KHz is definitely wrong.

 

Set your oscilloscope on the x10 attenuation probe setting and connect  to C7. You should see around 16 Mega Hertz. The probe will load that point so I would not expect to see 16MHz, but somewhere up there would be indicative of a healthy oscillator.

 

ps...

 

or you could make a loop by attaching your probe's ground wire to the probe tip and hold this "loop" near your crystal. You may be able to pickup enough of a signal to measure its frequency. Works for me if the crystal is operating in full swing mode.

Ross McKenzie ValuSoft Melbourne Australia

Last Edited: Mon. Mar 20, 2017 - 03:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay i'll retest the frequency. What should the ground tip be connected to when I probe C7?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ground

 

But try the loop technique first.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

valusoft wrote:
Set your oscilloscope on the x10 attenuation probe setting and connect to C7

 

Why C7?   XTAL2 is the output from the inverting Oscillator amplifier, so C10 would be preferred. 

 

One trick I've used is to use a 1K resistor in series with the scope probe. 

The resistor helps isolate the circuit from the probe capacitance.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OMG... short term memory failure... press Ctrl-Alt-Del

 

I knew C10 and wrote C7. Anyone know a good doc?

 

Apologies High Septon.

 

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The way Windows identifies USb devices is by way of .inf files. When a particular VID/PID appears it looks through its .inf files and finds the relevant one and than in turn tells it details such as what the device is and which .sys driver file needs to be loaded to support it.

 

The chances are that the PC where this works has the .inf and the other one does not.

 

Presumably you know the VID/PID that requires support? You could grep for those values in \windows\inf\*.inf

 

OTOH the original project files, as well as having .c and .h may well have also had .inf too - worth exploring.

EDIT: for example here is just one of the projects in LUFA...

https://github.com/abcminiuser/l...

 

Notice how that includes "LUFA LED Notifier.inf" and it contains:

;************************************************************
; Windows USB CDC ACM Setup File
; Copyright (c) 2000 Microsoft Corporation
;************************************************************

[DefaultInstall]
CopyINF="LUFA LED Notifier.inf"

[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
DriverVer=7/1/2012,10.0.0.0

[Manufacturer]
%MFGNAME%=DeviceList, NTx86, NTamd64, NTia64

[SourceDisksNames]

[SourceDisksFiles]

[DestinationDirs]
DefaultDestDir=12

[DriverInstall]
Include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection
AddReg=DriverInstall.AddReg

[DriverInstall.Services]
Include=mdmcpq.inf
AddService=usbser, 0x00000002, LowerFilter_Service_Inst

[DriverInstall.AddReg]
HKR,,EnumPropPages32,,"msports.dll,SerialPortPropPageProvider"

;------------------------------------------------------------------------------
;  Vendor and Product ID Definitions
;------------------------------------------------------------------------------
; When developing your USB device, the VID and PID used in the PC side
; application program and the firmware on the microcontroller must match.
; Modify the below line to use your VID and PID.  Use the format as shown below.
; Note: One INF file can be used for multiple devices with different VID and PIDs.
; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
;------------------------------------------------------------------------------
[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044

[DeviceList.NTx86]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044

[DeviceList.NTia64]
%DESCRIPTION%=DriverInstall, USB\VID_03EB&PID_2044

;------------------------------------------------------------------------------
;  String Definitions
;------------------------------------------------------------------------------
;Modify these strings to customize your device
;------------------------------------------------------------------------------
[Strings]
MFGNAME="http://www.lufa-lib.org"
DESCRIPTION="LUFA CDC-ACM Virtual Serial Port"

So clearly on this occasion the device is VID=0x3EB and PID=0x2044 and it will appear as "LUFA CDC-ACM Virtual Serial Port". You can see the associated VID/PID in the decriptors.c:

	.VendorID               = 0x03EB,
	.ProductID              = 0x2044,

 

Last Edited: Mon. Mar 20, 2017 - 12:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

The way Windows identifies USb devices is by way of .inf files.

 

OTOH the original project files, as well as having .c and .h may well have also had .inf too

 

The USB connection he is trying to get working is from the Atmel preinstalled Bootloader in the ATmega32U4.

Does Atmel provide the .inf file for this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Otherwise (LGPL) and through libusb :

https://github.com/dfu-programmer/dfu-programmer/blob/master/windows/atmel_usb_dfu.inf

...

"ATmega32U4" = LIBUSB_WIN32_DEV, USB\VID_03EB&PID_2FF4

...

"ATmega32U4" = LIBUSB_WIN32_DEV.NT, USB\VID_03EB&PID_2FF4

...

"ATmega32U4" = LIBUSB_WIN32_DEV.NTAMD64, USB\VID_03EB&PID_2FF4

...

"ATmega32U4" = LIBUSB_WIN32_DEV.NTIA64, USB\VID_03EB&PID_2FF4

...

 

Instead, there may be a way through WinUSB.

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Mon. Mar 20, 2017 - 10:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks gchapman.

 

I found atmel_usb-dfu.inf on my computer here:  C:\Program Files (x86)\Atmel\Flip 3.4.7\usb

(I'm using Atmel Studio 6.2)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So I need to add VID and PID definition lines for the 32u4 to atmel_usb-dfu.inf located at C:\Program Files (x86)\Atmel\Flip 3.4.7\usb? 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:

So I need to add VID and PID definition lines for the 32u4 to atmel_usb-dfu.inf located at C:\Program Files (x86)\Atmel\Flip 3.4.7\usb? 

 

No.  Use atmel_usb-dfu.inf as it is.

 

Edit:  PID & VID from the inf file:

"ATmega32U4"    = LIBUSB_WIN32_DEV, USB\VID_03EB&PID_2FF4

 

 

Last Edited: Tue. Mar 21, 2017 - 02:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you measure the xtal freq?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see those lines relating to the 32u4 in the .inf file so does this rule out the issue being on my PC?

 

I measured the Xtal frequency but I wasn't sure which via is C10 so i measured my two best guesses. The GND probe tip was on the white-circled via next to R7 (GND of the USB connection). I'm assuming I didn't measure the right places because the readings I got were really low frequencies (~60Hz). Where should I be measuring?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The crystal driving pin is XTAL2 (pin 16). Both of the vias circled in RED are (probably) GND. The end of the cap C10 opposite the via would be XTAL2.

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay thanks. So I should be probing negative to one of the GND vias and positive to the cap lead opposite the via on C10? 

 

I'll update you guys once I have a chance to make it back to the lab to test.

Last Edited: Tue. Mar 21, 2017 - 03:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:
positive to the cap lead opposite the via on C10?
Correct.

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:
I see those lines relating to the 32u4 in the .inf file so does this rule out the issue being on my PC?
No

Reason : Intermittent USB issues in Windows 10

What version of Windows are you operating? (the output of 'winver')

 


http://www.infoworld.com/article/3136336/microsoft-windows/woodys-win10tip-how-to-figure-out-your-windows-10-version.html

Microsoft

Microsoft

Hardware Dev Center

Universal Serial Bus (USB) - Windows 10 hardware dev

https://msdn.microsoft.com/en-us/library/windows/hardware/ff538930(v=vs.85).aspx

Microsoft

Microsoft

Hardware Dev Center

USBView - Windows 10 hardware dev

https://msdn.microsoft.com/en-us/library/windows/hardware/ff560019

USBView (Universal Serial Bus Viewer, Usbview.exe) is a Windows graphical user interface application that enables you to browse all USB controllers and connected USB devices on your computer.

https://github.com/Microsoft/Windows-driver-samples/tree/master/usb/usbview

 

Edit : what is USBView

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Tue. Mar 21, 2017 - 08:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Windows 7 Ultimate, Version 6.1 (build 7601:Service Pack 1)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the first picture in #1 it looks like AS7 is actually being installed in the background while you were looking at Device Manager?

 

I imagine that one of the things the installation will do is add the "Atmel" .inf files to Windows so I would just try again after the next reboot after you have finished the AS7 installation. I am guessing the USB DFU device will then be recognized.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That was a reinstall for troubleshooting, ive had AS7 on the machine since the first attempt at connecting the pcb. I've been testing with the installation complete pretty much the entire time.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see the .inf file on my computers regardless of whether I have AS6 or AS7 and whether I'm running Win10 or Win7.   My guess is your problem is hardware.  Maybe the ribbon cable attached with tape.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Meanwhile here's a Win7 machine that has never had any Atmel software installed:

C:\Windows\System32\DriverStore\FileRepository>dir at*
 Volume in drive C is OSDISK
 Volume Serial Number is 6A06-4A97

 Directory of C:\Windows\System32\DriverStore\FileRepository

21/11/2010  03:28    <DIR>          atiilhag.inf_amd64_neutral_0a660e899f5038a2
14/07/2009  05:31    <DIR>          atiriol6.inf_amd64_neutral_bde34ad5722cca75
               0 File(s)              0 bytes
               2 Dir(s)  32,946,696,192 bytes free

So I would take a look in this "filerepository" for any "atmel*" entries.

 

(and no it's probably not enough to just copy files here - there's almost certainly going to be registry entries cataloguing what's here so any such file will need to be properly "installed")

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This may be possible. I'm planning on removing the tape and soldering directly to rule the cable out. I'm curious though; when I see the device connected as an Unknown USB isn't the cable functioning properly to be able to complete the USB data handshake with my PC that allows it to be listed at all?

Last Edited: Tue. Mar 21, 2017 - 03:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I assume if you are developing USb you have USbdview.exe ? It will tell you if the VID/PID are being read correctly (actually even info in device manager can tell you this). If it is then you are right the problem is PC software, nothing to do with the electronics.

 

Still looks a lot like a not installed INF file to me!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

 

(and no it's probably not enough to just copy files here - there's almost certainly going to be registry entries cataloguing what's here so any such file will need to be properly "installed")

God only knows.  It's too damned complicated.  However you may be able to install the driver manually.  If you have the driver, I would try right clicking on the "unknown device".   From there, you may be able to "update driver software" >> Browse my computer for driver".  Then browse to the folder that contains the.inf file.

 

I think you will also need the libusb0.sys driver.  I have one here:

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17 wrote:
I think you will also need the libusb0.sys driver.  I have one here:
Zadig is another source though WinUSB does have some DFU.

[Zadig icon]

Zadig - USB driver installation made easy

http://zadig.akeo.ie/

Zadig is a Windows application that installs generic USB drivers, such as WinUSB, libusb-win32/libusb0.sys or libusbK, to help you access USB devices.

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm still using the ribbon cable & conductive tape but I was able to get a stable connection for long enough to do some digging. I'm not finding mention of the chip's VID or PID in any of the device manager->properties menu but I was able to try to manually load the atmel inf driver file. Unfortunately it didn't work and Windows still lists the device as having the most current driver installed. The properties menu does offer many details however, such as the driver key that i show in a below image. A sidenote: USBdeview didn't detect my device once during this whole process. I did all my work through the device manager.

 

I did verify that I have plenty of driver files installed on my machine in both the System 32 and Program Files(x86)-> Atmel directories. When I tried to manually point the chip to the .inf driver file in C:\Program Files (x86)\Atmel\Flip 3.4.7\usb I'm greeted with the message i mentioned.

 

A final note, I noticed i'm getting error code #43 in the General Tab of properties each time it's connected, not sure if that's part of the problem or merely a symptom.

Last Edited: Tue. Mar 21, 2017 - 10:59 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:
A sidenote: USBdeview didn't detect my device once during this whole process. I did all my work through the device manager.
Do you want to try Microsoft USBView?

http://www.avrfreaks.net/forum/custom-atmega32u4-pcb-connects-windows-unknown-usb-device#comment-2117821

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe you should use Zadig to install libusb0.sys, as Chapman mentioned 2 posts above.  I've used it but I don't remember the circumstances.

 

Here's my Xplained board that came from Atmel with a DFU boatloader.  The driver details shows libusb0.sys.  

 

 

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:

I'm still using the ribbon cable & conductive tape

Wouldn't conductive tape short out the wires?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No, the tape only conducts vertically (through the z axis), not across itself.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The device shows up as an Unknown USB device in Zadig. I've confirmed that I have the libusb0.sys driver after running the Zadig installer. Not sure what's going on with this chip that's making it unrecognizable.

 

Even after installing the Zadig drivers, Windows claims the driver is up to date when I point to the atmel dfu inf folder. Also, I noticed that the Driver Provider is listed as Microsoft for the chip. Don't we expect this to be atmel?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The High Septon wrote:

When I connect a different custom pcb that uses an atmega16u4 it shows up properly

 

With all this chatter about device drivers and such, I need to ask:  Is the same computer used to test both the 32U4 that doesn't connect and the 16U4 that does?

 

If so, why would the 32U4 require a different device driver?

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the details page in the device manager, could you find the 'Hardware Ids' part and show that? 

 

My best guess is that the device fails to set up correctly. I don't think drivers are the main issue... (The driver is bound based on the Hardware Ids, so show that so that we can see what is reported).

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meolsen wrote:
, could you find the 'Hardware Ids' part and show that?
+1

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I suspect there is something wrong with your board.  I plugged in my DFU Xplained board on another Win10 installation that apparently isn't ready for DFU.  I never installed AS on this Win10 installation.

 

Here's what device manager shows:

 

 

 

Here is what Zadig shows:

 

Pages