Author Topic: Front Panel USB issues on custom PCB  (Read 1353 times)

0 Members and 1 Guest are viewing this topic.

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Front Panel USB issues on custom PCB
« on: Sun, 19 February 2017, 10:55:10 »
Hi all,

I've recently managed to get my own custom PCB (atmega32u4) up and running. Runs QMK great it works no problem over most of my USB ports. However when I try plugging it into the front panel usb 2.0 ports on my pc it just doesn't get detected. I've tried uninstalling the 'generic USB hub' driver and uninstalling the keyboard driver but it still doesn't get detected on the front panel...

My Filco has no problem being detected over that same front panel USB - now i'm wondering is this likely more to do with QMK or is it a weird driver issue?

I'm running win 10 btw.

Cheers  :cool:
« Last Edit: Sun, 19 February 2017, 11:03:08 by FerretBuster »

Offline Findecanor

  • Posts: 3893
  • Location: Stockholm, Sweden
  • Does not take bull****
Re: Front Panel USB issues on custom PCB
« Reply #1 on: Sun, 19 February 2017, 12:40:07 »
Does your front panel have a card reader? If that is the case then it is likely that there is actually a USB hub in there, making the hub, card reader and the keyboard have to share the 500 mA power limit on the port from motherboard to the hub.
When the keyboard is plugged in/computer resets, every USB device tells the host how much power it would draw - and if it would draw too much then the device will not be enabled ("enumerated").
The value is "bMaxPower" in the configuration descriptor. The number is in 2mA units. If the value is higher than the actual power consumption, change it!
Well... that's one theory anyway. Probably something else. Stock QMK with PJRC's USB routines asks for only 100 mA.
Smoking is assault. I defend myself.
Daily driver: Phantom (Lubed Cherry MX Clear, Lasered Cherry PBT keycaps with Row A. Plastic "Frankencase". Custom firmware, Swedish layout)

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #2 on: Sun, 19 February 2017, 13:34:03 »
The thing is my filco works no problem in the same usb port, then I plug my PCB in (after removing my filco) and no device detected... It's not even listed in device manager.

Oh and there is no card reader.

Offline a-c

  • Posts: 196
  • Location: USA
Re: Front Panel USB issues on custom PCB
« Reply #3 on: Sun, 19 February 2017, 15:59:08 »
Does your front panel have a card reader? If that is the case then it is likely that there is actually a USB hub in there, making the hub, card reader and the keyboard have to share the 500 mA power limit on the port from motherboard to the hub.
When the keyboard is plugged in/computer resets, every USB device tells the host how much power it would draw - and if it would draw too much then the device will not be enabled ("enumerated").
The value is "bMaxPower" in the configuration descriptor. The number is in 2mA units. If the value is higher than the actual power consumption, change it!
Well... that's one theory anyway. Probably something else. Stock QMK with PJRC's USB routines asks for only 100 mA.

QMK is using LUFA which is set to 500mA, so you are probably right.

https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/descriptor.c#L44

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #4 on: Sun, 19 February 2017, 16:00:20 »
Does your front panel have a card reader? If that is the case then it is likely that there is actually a USB hub in there, making the hub, card reader and the keyboard have to share the 500 mA power limit on the port from motherboard to the hub.
When the keyboard is plugged in/computer resets, every USB device tells the host how much power it would draw - and if it would draw too much then the device will not be enabled ("enumerated").
The value is "bMaxPower" in the configuration descriptor. The number is in 2mA units. If the value is higher than the actual power consumption, change it!
Well... that's one theory anyway. Probably something else. Stock QMK with PJRC's USB routines asks for only 100 mA.

QMK is using LUFA which is set to 500mA, so you are probably right.

https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/descriptor.c#L44

I've set my max power to 100mA in my makefile/config

Offline happylacquer

  • Posts: 400
  • Location: USA
  • BS Apologist
    • BHOBuds
Re: Front Panel USB issues on custom PCB
« Reply #5 on: Sun, 19 February 2017, 16:11:13 »
Front panel USB has been notoriously terrible since its inception. It's on a thin crappy extender wire that can easily screw up the transfer of data itself.
If you board works fine on rear panel usb, i won't worry about it. The front panel probably can't give it the juice it needs.

My front panel USB I would only ever use for something like a mouse or USB game controller. Never do anything important with the front panel USB no matter what your machine is.

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #6 on: Sun, 19 February 2017, 16:19:46 »
Front panel USB has been notoriously terrible since its inception. It's on a thin crappy extender wire that can easily screw up the transfer of data itself.
If you board works fine on rear panel usb, i won't worry about it. The front panel probably can't give it the juice it needs.

My front panel USB I would only ever use for something like a mouse or USB game controller. Never do anything important with the front panel USB no matter what your machine is.

I know what you're saying, but it's so frustrating that my filco works and my PCB doesn't... Perhaps it's the juice the atmega needs?


Offline Leslieann

  • * Elevated Elder
  • Posts: 2122
Re: Front Panel USB issues on custom PCB
« Reply #7 on: Sun, 19 February 2017, 17:43:11 »
Front ports have low power and are often improperly shielded, they rarely conform to USB spec, I don't recommend plugging anything delicate into a front port that you value. I've seen them destroy USB sticks, make wifi flakey, and even crash systems.

If the case is an OEM such as Dell or HP, or a high end aftermarket case, it's probably going to be okay, but if it's a cheap aftermarket case, don't plug anything of value into them.
Filco MJ2 L.E. w/Vortex case, hand milled case, custom feet, custom paint, Klaxxon key caps, lubed and o-ringed Jailhouse Blues made from vintage Cherry MX Blues, HID Liberator, stainless steel universal plate, 3d printed adapters, removable cord, sound dampened. Winkey blockoff plate | Magicforce 68 w/Outemu Blues |KBT Race S L.E. w/Ergo-Clears, custom WASD keyset | Das Pro w/browns (Costar model) | IBM Model M (x2)

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #8 on: Sun, 19 February 2017, 17:47:32 »
It's a fractal r5

Offline TalkingTree

  • Posts: 2342
  • Location: Italy (142)
    • My projects
Re: Front Panel USB issues on custom PCB
« Reply #9 on: Mon, 20 February 2017, 05:35:52 »
Inspect your motherboard, some have two USB headers (either two 2.0 headers and two 3.0), try and connect the front panel ports' cable to the other header if available.
My opensource projects: GH80-3000, Skipad, TOAD (KotM Sept '17), TOAD v2 (KotM April '18), XMMX.

Offline Findecanor

  • Posts: 3893
  • Location: Stockholm, Sweden
  • Does not take bull****
Re: Front Panel USB issues on custom PCB
« Reply #10 on: Mon, 20 February 2017, 08:53:20 »
Hmm.. I have heard of many people having problems with USB 3.0 ports and Windows 7. I'm not sure what it was but supposedly the problems were fixed in Windows 8. There shouldn't be an issue under Linux.
Smoking is assault. I defend myself.
Daily driver: Phantom (Lubed Cherry MX Clear, Lasered Cherry PBT keycaps with Row A. Plastic "Frankencase". Custom firmware, Swedish layout)

Offline Leslieann

  • * Elevated Elder
  • Posts: 2122
Re: Front Panel USB issues on custom PCB
« Reply #11 on: Tue, 21 February 2017, 03:04:18 »
Another issue could be that your front ports are running off a hub.
That may not seem like a big deal, but like I said, a lot of crappy USB devices don't conform to usb spec (since it's pretty lose), it wouldn't be the first device to not function through a hub.
Filco MJ2 L.E. w/Vortex case, hand milled case, custom feet, custom paint, Klaxxon key caps, lubed and o-ringed Jailhouse Blues made from vintage Cherry MX Blues, HID Liberator, stainless steel universal plate, 3d printed adapters, removable cord, sound dampened. Winkey blockoff plate | Magicforce 68 w/Outemu Blues |KBT Race S L.E. w/Ergo-Clears, custom WASD keyset | Das Pro w/browns (Costar model) | IBM Model M (x2)

Offline TalkingTree

  • Posts: 2342
  • Location: Italy (142)
    • My projects
Re: Front Panel USB issues on custom PCB
« Reply #12 on: Tue, 21 February 2017, 04:04:06 »
Another issue could be that your front ports are running off a hub.
This shouldn't be the case in this specific situation for the Fractal Design Define R5 uses a header cord for the front panel.
My opensource projects: GH80-3000, Skipad, TOAD (KotM Sept '17), TOAD v2 (KotM April '18), XMMX.

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #13 on: Tue, 21 February 2017, 06:01:25 »
Unfortunately I don't have linux installed on my main pc (the fractal), so I can't test whether it works on linux on that specific pc. I did briefly check whether my board is actually receiving power, it seems that each vcc pin measure 0v when it's connected to the front panel usb 2. Then I connect it to front panel usb 3, and each pin meaures 0.1v. I have never used a multimeter so I may have done it wrong, but it seems the chip just refuses to power itself.

Offline TalkingTree

  • Posts: 2342
  • Location: Italy (142)
    • My projects
Re: Front Panel USB issues on custom PCB
« Reply #14 on: Tue, 21 February 2017, 06:02:40 »
What's your motherboard?
My opensource projects: GH80-3000, Skipad, TOAD (KotM Sept '17), TOAD v2 (KotM April '18), XMMX.

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #15 on: Tue, 21 February 2017, 06:08:20 »
Just checked my data lines as well, seems they are 3v like they should be on usb 3 front panel. usb 2 nada, no power. Obviously chip just isn't getting juice... Is it possible for that to be a driver issue?

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #16 on: Tue, 21 February 2017, 06:08:41 »
What's your motherboard?
Asrock extreme 4 z77, latest bios I believe

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #17 on: Tue, 21 February 2017, 06:13:48 »
Filco also appears on the usb 2 port, as 100ma max power draw. My PCB has no leds, and just the atmega so I can't imagine my board is sucking any more juice than the filco. I've even set it's max power draw to like 100ma in QMK.

Offline FerretBuster

  • Thread Starter
  • Posts: 104
Re: Front Panel USB issues on custom PCB
« Reply #18 on: Tue, 21 February 2017, 06:51:12 »
I just found out what it is, I accidentally bridged the gnd USB connection on my port when using my multi-meter - which told me my solder joint was bad. I'm not quite sure why the board even worked over the other usb ports, but I re soldered the ground pin on my USB connector and everything works now. Could anyone explain to me why this happened? Is it possibly that the board managed to ground itself through the other ports, but not through my front panel usb 2?

Offline a-c

  • Posts: 196
  • Location: USA
Re: Front Panel USB issues on custom PCB
« Reply #19 on: Tue, 21 February 2017, 17:50:47 »
I just found out what it is, I accidentally bridged the gnd USB connection on my port when using my multi-meter - which told me my solder joint was bad. I'm not quite sure why the board even worked over the other usb ports, but I re soldered the ground pin on my USB connector and everything works now. Could anyone explain to me why this happened? Is it possibly that the board managed to ground itself through the other ports, but not through my front panel usb 2?

The working ports may have shield tied to ground and the front port not. Your board may have been using the shield connection for ground.