Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdloader cannot find drop CTRL #24

Open
thel1979 opened this issue Jul 2, 2020 · 20 comments
Open

mdloader cannot find drop CTRL #24

thel1979 opened this issue Jul 2, 2020 · 20 comments

Comments

@thel1979
Copy link

thel1979 commented Jul 2, 2020

I suspect I have an issue with my keyboard not mdloader but figure doesn't hurt to see if anyone has any idea. mdloader cannot seem to talk to my drop CTRL. I've used it to flash my ALT without issue. Which makes me wonder if the two devices need different drivers or something? I posted on drops discussions as well but I'm trying all places i can think of at this point.

When i try and flash using "mdloader_windows.exe --first --download massdrop_ctrl_thel1979.bin --restart" MDloader does the search for device for 60 seconds then times out with "Error: Could not find a valid device port!" if i try and force it to port 5 which is what i'm seeing it on as windows i get "Opening port '5'... Failed! (The system cannot find the file specified.)"

using the --list switch with the keyboard in RDU mode it returns "No devices found!"

if i use --verbose i see:
.Opening port 'COM1'... Success!
Configuring port...
Get config... Success!
Set config... Success!
Set timeouts... Success!
Setting normal mode... Error reading 2 bytes! [0]0000
Closing port... Success!
Opening port 'COM2'... Failed!
Opening port 'COM3'... Failed!
Opening port 'COM4'... Failed!
Opening port 'COM5'... Success!
Configuring port...
Get config... Success!
Set config... Success!
Set timeouts... Success!
Setting normal mode... Success!
Write: [w41002018,#]
Closing port... Success!
Opening port 'COM6'... Failed!
Opening port 'COM7'... Failed!
Opening port 'COM8'... Failed!
Opening port 'COM9'... Failed!
and so on through to COM255

If anyone has any advice I'd love to try it out.

@thel1979
Copy link
Author

thel1979 commented Jul 2, 2020

the badasses fauxpark and sigprof in the QMK discord figured this one out. it seems this new CTRL has a different chip ID than previous ones. We updated line 38 in mdloader_common.c to change the Chip ID to 0x60060306 and then i was able to flash. I'm guessing the program is going to need to be updated for this. Not sure exactly how seeing as this new compiled version no longer recognizes my ALT since it of course sill has the Chip ID 0x60060006. for now I'll keep two mdloaders to play with my two keyboards

@fauxpark
Copy link

fauxpark commented Jul 2, 2020

The following change to this line should allow both revisions to be flashed:
https://github.com/Massdrop/mdloader/blob/master/mdloader_common.c#L339

if ((deviceid & 0xFFFFF0FF) == mcu->cidr)

@thel1979
Copy link
Author

thel1979 commented Jul 2, 2020

just tested out the if ((deviceid & 0xFFFFF0FF) == mcu->cidr) on line 339 and it does indeed flash both my "old" ALT and "new" CTRL without issue

@ealsandor
Copy link

Hey brah can i get an edited version of the one your using to flash, Im having the same issue MDloader doesnt see the keyboard. Id go in there and alter the code myself if I had the tools. like a dropbox link or something would really help me out brother.

@thel1979
Copy link
Author

thel1979 commented Jul 9, 2020

it doesn't take any special tools besides a text editor to add the line. I don't have a dropbox account but if you have some place free i can upload to or an email address i can send to I can do so the zip is only 131KB. That said I know i'm cool and wouldn't mess with you but you really shouldn't just run exe's from some rando off the internet :)

@ealsandor
Copy link

ealsandor commented Jul 9, 2020 via email

@trent-boyd
Copy link

FWIW, there's a fix here: #25

@just-another-jxliu
Copy link

Fix has been applied and new binaries are here: https://github.com/Massdrop/mdloader/releases

Thanks, all.

@samtut
Copy link

samtut commented Aug 2, 2020

Hey guys i am having the same issue with my Drop Alt high profile keyboard. I am getting the same "Error: Could not find a valid device port!" when i try to use mdloader_windows.exe. The mdloader does the search for device for 60 seconds then it times out with the error. When i run mdloader_windows.exe --list --verbose it basically shows me that it is not able to find the keyboard on any of the COM Ports. I am running Win10 Pro and the keyboard out of the box is working fine on it. When looking under the device manager though the keyboard is not listed under any of the COM Ports but instead it is listed under "Keyboards" as an HID device. I have tried the link to the new binaries you provided above but that didn't work either. Any ideas or update to the binary to address this issue would very much appreciated.

Here is how the log look like from COM1 all the way to COM255:
Opening port 'COM1'... Failed!
Opening port 'COM2'... Failed!
Opening port 'COM3'... Failed!
Opening port 'COM4'... Failed!
Opening port 'COM5'... Failed!

@fauxpark
Copy link

fauxpark commented Aug 2, 2020

@samtut you need to reset the board into bootloader mode first. There should be a button on the back of the PCB, just below the End key, that will presumably reset it, or you can hold Fn+B for at least 500ms (Fn should be between Right Alt and the context menu key on the default keymap).

@samtut
Copy link

samtut commented Aug 2, 2020

@fauxpark That did it! Thank you so much. So the extra step i did here that i was not doing before was to reset the board and reconnected to my windows machine before i run the command. Thanks again!

@carlosbelardi
Copy link

Hey all hopping in here after opening a similar issue. Just got a new Drop Alt and running into the same issues described in this thread. I'm using mloader 1.0.4 and resetting the board properly after it begins the search. From what I understand in this thread this new version of mloader should address the chip ID issue so not sure what's going on. I'm also kind of a noob and not sure how I go about editing files and compiling a new Mac version so any help would be appreciated

@fauxpark
Copy link

According to #32, the part being used is now the ATSAMD51J19A, which is basically the same part but has 512kB of flash space vs. the 18A's 256kB. Thus it has a different chip ID altogether (not just revision), so it should be added to the MCU array. Possibly another applet file is needed, too.

@carlosbelardi
Copy link

I see, is there anything I could do on my end to try and resolve the problem or should I just sit tight and wait for an update to the modloader files?

@JasonYuanLiu
Copy link

According to #32, the part being used is now the ATSAMD51J19A, which is basically the same part but has 512kB of flash space vs. the 18A's 256kB. Thus it has a different chip ID altogether (not just revision), so it should be added to the MCU array. Possibly another applet file is needed, too.

Hi fauxpark, I'm the author of #32 . Could you please share some insight on how you found out about the micro controller information? I only stumbled across the CHIP ID because a binary that @thel1979 released on Drop, built for 60060306, prints out the ID.

@fauxpark
Copy link

fauxpark commented Sep 9, 2020

The IDs for SAM D5x/E5x devices are listed on page 2 of the "Errata and Data Sheet Clarification" document found here: https://www.microchip.com/wwwproducts/en/ATSAMD51J18A

@JasonYuanLiu
Copy link

JasonYuanLiu commented Sep 9, 2020

The IDs for SAM D5x/E5x devices are listed on page 2 of the "Errata and Data Sheet Clarification" document found here: https://www.microchip.com/wwwproducts/en/ATSAMD51J18A

Thank you. Is there a way to programatically find out about the Chip ID? (Or what led you to identify changing Chip ID as the problem, and find out the new ID, assuming that you didn't open the keyboard and looked at the micro-controller itself, which also works.)

@fauxpark
Copy link

fauxpark commented Sep 9, 2020

I don't actually have one of these boards - I simply looked up the chip IDs you mentioned (and I think there was someone else corroborating) in the table.
These chip IDs make sense, as I mentioned above the 19A is exactly the same MCU, but with more flash, so it's reasonable to assume Drop thought they would "just work" if they subbed them in. However, this is not the case as with these SAM devices each flash size has a different ID.

@szski
Copy link

szski commented Sep 15, 2020

I have a recently purchased CTRL keyboard and Im getting no devices found running mdloader_mac -l -v. Holding Fn+b until the CTRL goes into bootloader mode produces the same results.

Any ideas on how I can begin to troubleshoot this?

@tinptb
Copy link

tinptb commented Sep 10, 2021

Please looks #44 (comment)

Just write step by step here (for Mac OS):

  1. sleep 5; ./mdloader_mac -l
  2. Hold Fn + b for three seconds.
  3. The Drop Keyboard led will be turned off
  4. Now, You cannot use the Drop keyboard, please use the internal keyboard instead
  5. Use the internal keyboard to type ./mdloader_mac -l
  6. The keyboard list will be shown here.
  7. Use the internal keyboard to load a new configuration if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants