Author Topic: Front Panel USB issues on custom PCB  (Read 4013 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: 5035
  • Location: Koriko
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.

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: 4513
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.
Novelkeys NK65AE w/62g Zilents/39g springs
More
62g Zilents/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 magnetic cable, pic
| Filco MJ2 L.E. Vortex Case, Jailhouse Blues, heavily customized
More
Vortex case squared up/blasted finish removed/custom feet/paint/winkey blockoff plate, HID Liberator, stainless steel universal plate, 3d printed adapters, Type C, Netdot Gen10 magnetic cable, foam sound dampened, HK Gaming Thick PBT caps (o-ringed), Cherry Jailhouse Blues w/lubed/clipped Cherry light springs, 40g actuation
| GMMK TKL
More
w/ Kailh Purple Pros/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 Magnetic cable
| PF65 3d printed 65% w/LCD and hot swap
More
Box Jades, Interchangeable trim, mini lcd, QMK, underglow, HK Gaming Thick PBT caps, O-rings, Netdot Gen10 magnetic cable, in progress link
| Magicforce 68
More
MF68 pcb, Outemu Blues, in progress
| YMDK75 Jail Housed Gateron Blues
More
J-spacers, YMDK Thick PBT, O-rings, SIP sockets
| KBT Race S L.E.
More
Ergo Clears, custom WASD caps
| Das Pro
More
Costar model with browns
| GH60
More
Cherry Blacks, custom 3d printed case
| Logitech Illumininated | IBM Model M (x2)
Definitive Omron Guide. | 3d printed Keyboard FAQ/Discussion

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: 2452
  • 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, TOAD, XMMX. Classified: stuff

Offline Findecanor

  • Posts: 5035
  • Location: Koriko
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.

Offline Leslieann

  • * Elevated Elder
  • Posts: 4513
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.
Novelkeys NK65AE w/62g Zilents/39g springs
More
62g Zilents/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 magnetic cable, pic
| Filco MJ2 L.E. Vortex Case, Jailhouse Blues, heavily customized
More
Vortex case squared up/blasted finish removed/custom feet/paint/winkey blockoff plate, HID Liberator, stainless steel universal plate, 3d printed adapters, Type C, Netdot Gen10 magnetic cable, foam sound dampened, HK Gaming Thick PBT caps (o-ringed), Cherry Jailhouse Blues w/lubed/clipped Cherry light springs, 40g actuation
| GMMK TKL
More
w/ Kailh Purple Pros/lubed/Novelkeys 39g springs, HK Gaming Thick PBT caps, Netdot Gen10 Magnetic cable
| PF65 3d printed 65% w/LCD and hot swap
More
Box Jades, Interchangeable trim, mini lcd, QMK, underglow, HK Gaming Thick PBT caps, O-rings, Netdot Gen10 magnetic cable, in progress link
| Magicforce 68
More
MF68 pcb, Outemu Blues, in progress
| YMDK75 Jail Housed Gateron Blues
More
J-spacers, YMDK Thick PBT, O-rings, SIP sockets
| KBT Race S L.E.
More
Ergo Clears, custom WASD caps
| Das Pro
More
Costar model with browns
| GH60
More
Cherry Blacks, custom 3d printed case
| Logitech Illumininated | IBM Model M (x2)
Definitive Omron Guide. | 3d printed Keyboard FAQ/Discussion

Offline TalkingTree

  • Posts: 2452
  • 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, TOAD, XMMX. Classified: stuff

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: 2452
  • 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, TOAD, XMMX. Classified: stuff

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.