qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
17.97k stars 38.64k forks source link

QMK Configurator causes Drop (formerly Massdrop) ALT keyboard USB Hub issue #10786

Open zizhenc opened 3 years ago

zizhenc commented 3 years ago

QMK Configurator (https://config.qmk.fm) will cause Drop ALT keyboard USB hub not working.

Describe the Bug

I am using the Drop (formerly Massdrop) high-profile ALT keyboard which has 2 usb-c ports as a USB 2.0 hub. I found that if I use the online QMK Configurator (https://config.qmk.fm) to compile a firmware (bin file) and use QMK Toolbox to flash the firmware to my keyboard, my keyboard USB hub will be totally dead (not working). If I use the Drop online keyboard configurator (https://drop.com/mechanical-keyboards/configurator) to compile the firmware and use the QMK toolbox to flash the firmware to my keyboard, nothing wrong.

Furthermore, if you once used the QMK Configurator and QMK toolbox to flash the compiled firmware to the ALT keyboard, then the issue will not be resolved by reflashing the firmware compiled by Drop configurator through QMK toolbox. What happened is the QMK toolbox will show the success of flashing, but actually the firmware is not flashed into the keyboard. I have to use the mdloader provided by Drop (https://github.com/Massdrop/mdloader/releases) to reflash the Drop configurator compiled firmware to resolve the issue. Once the issue resolved, then using QMK Toolbox to flash the Drop Configurator compiled firmware will work well. By the way, if use the mdloader to flash the QMK Configurator compiled firmware, it will also cause the USB hub problem. Therefore, I believe something wrong in the QMK configurator compiled firmware.

System Information

zizhenc commented 3 years ago

I found that the usb hub is not totally dead, it seems using QMK configurator compiled firmware will make the USB hub only support pure USB 2.0 USB-c cable (Thunderbolt 3 cable and display port purpose cable also works). Any usb 3.0 usb-c cable would have no power. But using Drop configurator compiled firmware has no such problem. It must have some difference between the two compiled firmware.

drashna commented 3 years ago

This is likely because the code that massdrop is using is more up to date than the QMK repo.

Basically, it needs to be updated on our end... however, the only ones really familiar with the code is Massdrop or whomever is maintaining their code this week.

zizhenc commented 3 years ago

This is likely because the code that massdrop is using is more up to date than the QMK repo.

Basically, it needs to be updated on our end... however, the only ones really familiar with the code is Massdrop or whomever is maintaining their code this week.

I thought Drop is also using QMK firmware to compile the keymap. The point is if I use Drop provided mdloader to flash the QMK configurator compiled firmware, the issue will still happen.

tzarc commented 3 years ago

They do use QMK, but their copy has diverged from master, and configurator builds master. Massdrop has a... poor record of keeping things up to date in QMK and regularly ignores requests for cleanup before integration.

Their rocketeer PR has been sitting around for a year now, with seemingly zero interest in bringing it up to standards -- I'd envisage a similar issue in this case with the ALT's hub, should they eventually decide to submit their changes.

tzarc commented 3 years ago

For the record, they changed their own MCU without updating mdloader for a significant length of time, so even with their own tools they seem to struggle to keep things current.

cmerrill commented 3 years ago

@zizhenc It's likely that the needed fixes are unfortunately in the previously mentioned rocketeer PR. It looks like the USB handling code was also updated in that PR (#6568). I'm going to try to look into grabbing the specific changes and integrating them.

zizhenc commented 3 years ago

@zizhenc It's likely that the needed fixes are unfortunately in the previously mentioned rocketeer PR. It looks like the USB handling code was also updated in that PR (#6568). I'm going to try to look into grabbing the specific changes and integrating them.

Thanks, hope we would have a solution.

cmerrill commented 3 years ago

Hi @zizhenc, digging through that PR I managed to figure out the issue on my ALT -- it looks like Drop made a component stuffing mistake on the USB-C CC lines on the ALT hardware design. (See here)

I fixed it on my board/keyboard branch here (cmerrill/qmk_firmware@d799876fc35acb527c86701a95f89353278d70c7) -- I don't think it should be merged back into the mainline because it is an ALT-only fix. You should be able to cherry-pick that specific commit if you are able to compile from source, or I could help you do that if you have any trouble.

dialtone commented 3 years ago

Implemented your patch above in my qmk local firmware but sadly it doesn't really fix it, nor it makes my external usb dac work either when plugged through the keyboard.