QMK Firmware Tutorial: Compiling & Flashing (Part 4)


Part 4 of our journey through the basics of
QMK and we’re ready to start flashing. If you’re still struggling to get QMK set
up, then check out the other videos in the playlist. If you’ve been tweaking your layout and
have it to a point where you’re ready to try it out, then this is the episode you’ve been waiting
for. Make sure you’ve got a key that will send
the reset code so your keyboard can be flashed without you having to push the little button
on the pcb. The file that you flash needs to be compiled
before you can send it over to your keyboard. You can do the compiling and flashing separately
or in one go. I’ll show you how to do both. First, let’s assume you’re not ready to
flash your firmware to your keyboard, maybe you don’t actually have it yet, and
you’re just killing time until it arrives. Open up your MSYS2 terminal and navigate to
your qmk firmware folder. Note that you must be in this folder for things
to work as they should. The command for compiling your .hex file is
as follows. make:Make and then a space followed by the directory
name for your keyboard, then a colon followed by your keymap directory name. For the Satan GH60 and my layout it would
look like this: make satan:chokkan Which I’m really uncomfortable about typing
into a computer and even less so about saying out loud. If all goes well, you’ll find a .hex file
in the qmk_firmware directory. If it doesn’t, then you’ll need to take
a look at the error report for a hint as to how it messed up. I’d love to give tech support to everyone
that watches this video, but you’ll probably have better luck if you take a good look at
the error, which should include a line number and a message
telling you what the error was. If you want to compile the firmware and flash
your keyboard with one command, all you need to do is add one of the following
to the end of the previous command. If your keyboard is running ChibiOS on a Teensy
3 or a Teensy LC or something with an ARM processor, you need the :dfu-util command. If you’re using a Teensy 2, which many hand
wired keyboards do, then you type :teensy. If you’re using something with a Pro Micro
or one of it’s clones, you need :avrdude. If you’re not sure which option you need,
take a look in the readme for the keyboard and it should tell you. In most cases, and in the case of my Satan
GH60, :dfu is what you’ll use. Once you execute the command, you’ll need
to put your keyboard into flashing mode by pressing the button or hitting the key combination
you set up in your keymap. After that, the firmware will compile and
will be flashed to your device. It’s really a smooth process, and it’s
getting smoother all the time, but errors will crop up. Most of the time It’ll be your fault. Make sure brackets and braces are properly
closed. Watch out for typos in your keycodes. Use the find function in your text editor
to track them down. Next episode, we’ll dig into the rules and
config files and see what they do. See you then.

Leave a Reply

Your email address will not be published. Required fields are marked *