qmk / qmk_toolbox

A Toolbox companion for QMK Firmware
https://qmk.fm/toolbox
MIT License
2.55k stars 504 forks source link

Bad Atmel Behaviour #433

Open Muirium opened 7 months ago

Muirium commented 7 months ago

An annoying barrier to entry for new users is QMK Toolbox's behaviour with Atmel chips. I know unlike other MCUs they must be selected manually, but this is quite a typical event when dealing with IBM Model F controllers:

[!](https://deskthority.net/download/file.php?id=79431)

Note:

The user is left baffled.

May I suggest two ideas:

Sure, a failure like the screenshot above is no surprise to an experienced user, but it's a poor experience and in this common case an easily avoided failure.

Muirium commented 7 months ago

Another idea:

I've run QMK Toolbox to flash keyboard controllers and converters about a hundred times, myself. I really like the app, and recommend it to everyone over the dfu-programmer commandline utility / HID listen we had to use before. Every single use of mine was an AVR: a mix of 32u2 and 32u4. So I don't actually know what QMK Toolbox is like when it doesn't rely on that little menu! 8-bit AVR stuff is where most vintage keyboard work is done, like Pandrew's capacitative sensing QMK port in this example. Many of us are still flashing AVR.

Muirium commented 7 months ago

Here's another pair of Atmel MCUs which QMK Toolbox ID's correctly: 32u4 in this case.

Screenshot 2023-12-05 at 8 43 30 am

That's my pair of Hasu's TMK powered HHKBs. The controllers look like this:

I’m going through all my QMK Toolbox compatible keyboards at the moment, anyway, so let's see if any of them don't report their MCU.

tzarc commented 7 months ago

I'd say your best bet at this point is to make a PR -- I'd imagine most of the team would view this as low priority as it's a nice-to-have rather than a necessity, and there are lots of other things in flight, mostly on qmk_firmware.

I agree that it'd simplify the workflow -- I'm sure there's even a way to get avrdude and the like to query which chip is present, given the ID field.

fauxpark commented 7 months ago

I already have some thoughts on how to improve detection. In terms of Atmel DFU, this is much easier (and actually feasible, for Windows reasons) than parsing the device name - the USB PID directly corresponds to the MCU. For certain other bootloaders, we can reasonably assume a particular MCU (Caterina is basically always 32U4). Everything else will require you either know what you're doing, or will not need an MCU input at all.

The other problem is that multiple bootloaders can be connected at once, to allow for flashing en masse, and the MCU dropdown will apply to all of them, so we cannot just lock it to a particular value unless all of the bootloaders are the same. Most likely I will simply rip this functionality out since most of the flashing tools assume only one device is connected anyway, and of the ones that don't, getting the Toolbox to automatically identify a specific device is more trouble than it's worth.

Muirium commented 7 months ago

Any time I've had the wrong MCU selected in the drop down menu, the firmware has refused to flash anyway. I've never corrupted a keyboard or converter with the wrong selection.

Wouldn't an automatic try-fail, try-fail, try-succeed through the MCU list work? They're very quick to fail, and I could see this working well even for a mass flashing scenario.

fauxpark commented 7 months ago

Any time I've had the wrong MCU selected in the drop down menu, the firmware has refused to flash anyway.

And this is part of what confuses users.

Wouldn't an automatic try-fail, try-fail, try-succeed through the MCU list work?

It would work, yes, but if you can't see why that's a gross solution I don't know what to tell you.

Muirium commented 7 months ago

Gross is better than downright failing. ;)

I get slapped by that mistake quite often enough myself—ohhh… this board isn't 32u4!—and I know exactly how to fix it. The experience for everyone new at this is as cryptic as running dfu-programmer directly and pasting their resulting errors on a forum. Clean perhaps but awful.