Skip to content

Instantly share code, notes, and snippets.

@da99
Last active October 2, 2021 06:46
Show Gist options
  • Save da99/0e34438df52d32e24fc6e60638ce1e87 to your computer and use it in GitHub Desktop.
Save da99/0e34438df52d32e24fc6e60638ce1e87 to your computer and use it in GitHub Desktop.

[The following useful is old. I haven't been able to update it. It may or may not work. And read all comments below before executing commands.]

Linux and flashing your xd75re keyboard

Here is a photo of the default layout: https://github.com/c4software/xd75re/blob/master/layout/default/default_layout_all_layer.jpg

Create you keyboard layout here: https://config.qmk.fm/#/xd75/LAYOUT_ortho_5x15 Click "Load Default" to bring up the default layout. Edit it or use your own layout. Download the layout to a file because you will want to edit it later again. The layout file will have a .json extension.

Compile the layout. Download the firmware file. It will have a .hex extension. Remember the path to it.

  1. Install dfu-programmer. This package might be named differently depending on your distribution. Don't use dfu-util because that is something else that is not needed here.

  2. Enter keyboard into bootloader mode. If you don't know how, try this: https://www.reddit.com/r/MechanicalKeyboards/comments/70jewt/xd75re_trouble_flashing_pcb/dn3lbro/

For the paperclip method: Connect the holes for a second. Then let go. Don't keep the paperclip connected. The paperclip does not have to go all the way inside the hole. Just connect the metal surrounding the hole to the other one.

  1. Once the keyboard is in bootloader mode, it will show up among the list of USB devices by a different name. Type lsusb to get a usb device list. It should have a line that says:
Bus 00? Device 0??: ID 03eb:2ff4 Atmel Corp. atmega32u4 DFU bootloader

The Bus and Device id will differ on different PCs. These are only important if you are flashing different devices. The most important part is the name before "DFU bootloader". You will need that to tell the dfu-programmer utility how to flash the device. The dfu-programmer manual calls this the "target". In this case it is atmega32u4.

  1. On the command line:
sudo dfu-programmer atmega32u4 erase [--force]
sudo dfu-programmer atmega32u4 flash path/to/hex/file.hex
sudo dfu-programmer atmega32u4 reset

If you have any trouble, do a man dfu-programmer and check the sections for the above commands (erase, flash, reset, etc.) to make sure you're using the command properly for your dfu-programmer version.

  1. Type lsusb. The Atmel Corp.... DFU entry will have disappeared. You might see a line that says, cdcd:7575. That should be the keyboard.

Your keyboard should work now. Control the lighting by assigning buttons. Go back to https://config.qmk.fm and look under the Keycodes section. It should say: Keyboard settings. Then another section called: RGB Lighting settings. Assign them to keys and experiment to get lighting you can tolerate.

@NotACoin
Copy link

NotACoin commented Oct 2, 2021

Hi,

I just flashed a recent xd75re. First, thanks a lot for the information, I think it is the most straightforward way to configure the keyboard ! But on the command line, there is some bug and I did the following commands:
sudo dfu-programmer atmega32u4 erase
sudo dfu-programmer atmega32u4 flash path/to/hex/file.hex
sudo dfu-programmer atmega32u4 reset

So, always specified the target, and --force seems to not be an option anymore. Also, suggesting a man dfu-programmer for more info would be usefull ! I didn't know why the name would work.

Thanks for the step-by-step guide.

@da99
Copy link
Author

da99 commented Oct 2, 2021

Thanks, NotACoin. I updated the gist according to your suggestions. Let me know if you have any more thoughts/suggestions. My dfu-programmer is 0.7.2 on Arch Linux. The docs say erase [--force] is still allowed, but I have no way of testing it out. I had to give up on mechanical keyboards because of my need for the lowest profile keyboard within my small budget.

(I switched over to the Logitech K380. It's a bluetooth keyboard. I hate bluetooth for keyboards. Re-connecting from the K380's sleep mode is slow, but you can speed it up if you put FastConnectable = true using sudoedit /etc/bluetooth/main.conf.)

Thanks again for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment