4 This README is a bit long, just look at the sections you are interested in.
5 You only need to install avr-gcc if you want to build for the Teensy 2.0/2.0++.
6 Everything else needs an arm-none-eabi-gcc compiler (e.g. Infinity keyboard,
7 Teensy 3.0/3.1, McHCK).
9 Linux is the ideal build environment (preferably recent'ish). In the near
10 future I'll make available an Arch Linux VM for building/manufacturing tests.
12 Building on Mac should be ok for 99% of users with Macports or Homebrew. For
13 Homebrew, use `brew tap PX4/homebrew-px4` to get the arm-none-eabi-gcc installer.
14 The dfu Bootloader will not build correctly with the old version of
15 arm-none-eabi-gcc that Macports currently has (4.7.3). This is due to a bug
16 with lto (link time optimizations) which makes the resulting binary too big to
17 fit on the chip (must be less than 4096 Bytes).
19 Building on Windows should also be fine for 99% of users, but takes a bunch of
20 work to setup (because Windows is a crappy dev environment). Cygwin is
21 currently required along with some non-Cygwin compilers and utilities (because
22 they are not available for Cygwin). The dfu Bootloader will not build because
23 of a Make 3.81+ bug/feature that removed support for non-Unix (Windows)
24 filenames as dependencies of targets. If you [replace the version of Make in
25 Cygwin](http://stackoverflow.com/questions/601516/cygwin-make-error-target-pattern-contains-no)
26 it should work. However, make sure that the flash size is no larger than 4096
27 Bytes or the bootloader will not work. Things will likely break if there are
28 **SPACES IN YOUR PATHS**. I install cygwin to `C:\cygwin64`. If you are brave
29 and have programming knowledge, I will accept patches to fix any issues
30 regarding spaces in paths.
32 Please give authors credit for modules used if you use in a distributed
39 Below listed are the Arch Linux pacman names, AUR packages may be required.
41 These depend a bit on which targets you are trying to build, but the general
44 - cmake (2.8 and higher)
46 - ctags (recommended, not required)
48 - libusb1.0 (and -devel)
51 AVR Specific (Teensy 1.0/++,2.0/++) (try to use something recent, suggested
55 - avr-binutils (~2.23.2)
58 ARM Specific (Teensy 3.0/3.1, Infinity Keyboard, McHCK)
60 - Arch Linux / Mac Ports
62 - arm-none-eabi-binutils
64 - Windows (https://launchpad.net/gcc-arm-embedded/+download)
65 - gcc-arm-none-eabi (win32.zip)
71 Compiling on Windows does work, just it's a bunch more work.
73 First make sure Cygwin is installed - http://www.cygwin.com/ - 32bit or 64bit
74 is fine. Make sure the following are installed:
77 - git (needed for some compilation info)
84 - ctags (recommended, not required)
86 Please note, I use cygwin term exclusively for any command line options.
87 Unless mentioned otherwise, use it. Do NOT use CMD or Powershell.
89 Also install the [Windows version of CMake](http://cmake.org/cmake/resources/software.html)
90 (3+ is ideal) - Select "Do not add CMake to system PATH". This is in addition
91 to the Cygwin version. This is an easier alternative to installing another C
92 compiler. Add the following line to your .bashrc, making sure the CMake path
95 echo "alias wincmake=\"PATH='/cygdrive/c/Program Files (x86)/CMake'/bin:'${PATH}' cmake -G 'Unix Makefiles'\"" >> ~/.bashrc
97 Install the [PJRC Virtual Serial Port Driver](http://pjrc.com/teensy/serial_install.exe).
99 Next, install the compiler(s) you want.
105 [Atmel AVR 8-bit Toolchain](http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx).
106 The latest should be fine, as of writing it was 3.4.3.
108 Extract the files to a directory, say `C:\avr8-gnu-toolchain`. Then copy all
109 the folders in that directory to the Cygwin `/usr/local` directory. Mine is
110 `C:\cygwin64\usr\local`. (You can also just setup the paths, but this is
111 faster/simpler. Might screw up your Cygwin though).
117 [GNU Tools for Embedded Processors
118 gcc-arm-none-eabi](https://launchpad.net/gcc-arm-embedded/+download).
120 Download `gcc-arm-none-eabi*win32.zip`.
122 Then extract all the folders/files in the zip to the Cygwin `/usr/local`
123 directory. Mine is `C:\cygwin64\usr\local`. Or, you can setup paths using
124 the installer (you have to be more careful, avoid spaces in paths).
130 One of the big benefits of using CMake is the ability to build multiple
131 configurations (for different microcontrollers) at the same time. The
132 following sections explain in detail what each CMakeLists.txt configuration
133 option does and what you can change it to. However, it is possible to
134 configure each of these options using the `-D` command line flag.
136 For example, to build the Infinity Keyboard default configuration:
139 $ mkdir build_infinity
141 $ cmake -DCHIP=mk20dx128vlf5 -DScanModule=MD1 -DMacroModule=PartialMap \
142 -DOutputModule=pjrcUSB -DDebugModule=full -DBaseMap=defaultMap \
143 -DDefaultMap="md1Overlay stdFuncMap" -DPartialMaps="hhkbpro2" \
148 CMake defaults to the values specified in CMakeLists.txt if not overridden via
151 > NOTE: On Windows, you will have to use "wincmake" instead of "cmake".
154 Selecting Microcontroller
155 -------------------------
157 This is where you select the chip you want to compile for. The build system
158 will automatically select the compiler needed to compile for your chip.
160 Open up CMakeLists.txt in your favourite text editor. You are looking for:
167 #| You _MUST_ set this to match the microcontroller you are trying to compile for
168 #| You _MUST_ clean the build directory if you change this value
171 # "at90usb162" # Teensy 1.0 (avr)
172 # "atmega32u4" # Teensy 2.0 (avr)
173 # "at90usb646" # Teensy++ 1.0 (avr)
174 # "at90usb1286" # Teensy++ 2.0 (avr)
175 # "mk20dx128" # Teensy 3.0 (arm)
176 "mk20dx128vlf5" # McHCK mk20dx128vlf5
177 # "mk20dx256" # Teensy 3.1 (arm)
178 CACHE STRING "Microcontroller Chip" )
181 Just uncomment the chip you want, and comment out the old one.
183 > NOTE: If you change this option, you will *need* to delete the build
184 > directory that is created in the Building sections below.
190 > WARNING: Not all modules are compatible, and some modules may have
191 > dependencies on other modules.
193 This is where the options start getting interesting. The Kiibohd Controller
194 is designed around a set of 4 types of modules that correspond to different
202 The Scan Module is where the most interesting stuff happens. These modules
203 take in "keypress data". A converter Scan Module will interpret a protocol
204 into key press/releases. A matrix Scan Module may inherit from the matrix
205 module to scan keypress from a matrix This module just has to give
206 press/release codes, but does have some callback control to other modules
207 depending on the lifecycle for press/release codes (this can be very
208 complicated depending on the protocol). Each Scan Module has it's own default
209 keymap/modifier map. (TODO recommend keymap changing in the Macro Module).
211 Some scan modules have very specialized hardware requirements, each module
212 directory should have at least a link to the needed parts and/or schematics
215 The Macro Module takes care of the mapping of the key press/release code into
216 an Output (USB) scan code. Any layering, macros, keypress
217 intelligence/reaction is done here.
219 The Output Module is the module dealing with output from the microcontroller.
220 Currently USB is the only output protocol. Different USB output
221 implementations are available, pjrc being the safest/least featureful one.
222 Debug capabilities may depend on the module selected.
224 The Debug Module enables various things like the Teensy LED on errors, debug
225 terminal output. (TODO get true UART working in avr, not just arm)
227 Open up CMakeLists.txt in your favourite text editor. Look for:
234 #| Note: This is the only section you probably want to modify
235 #| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
236 #| All of the modules must be specified, as they generate the sources list of files to compile
237 #| Any modifications to this file will cause a complete rebuild of the project
239 #| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
241 ##| Deals with acquiring the keypress information and turning it into a key index
242 set( ScanModule "MD1"
243 CACHE STRING "Scan Module" )
245 ##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
246 set( MacroModule "PartialMap"
247 CACHE STRING "Macro Module" )
249 ##| Sends the current list of usb key codes through USB HID
250 set( OutputModule "pjrcUSB"
251 CACHE STRING "Output Module" )
253 ##| Debugging source to use, each module has it's own set of defines that it sets
254 set( DebugModule "full"
255 CACHE STRING "Debug Module" )
258 Look at each module individually for it's requirements. There is
259 chip/architecture dependency checking but some permutations of modules may not
262 There are also CMake options for temporarily selecting modules. But it's
263 easier to just edit the file. e.g. `cmake -DScanModuleOverride=<module name>`.
269 This is where you define the layout for your keyboard.
270 Currently, the only way to define kebyoard layouts is using [KLL](https://www.overleaf.com/read/zzqbdwqjfwwf).
272 KLL is built up of 3 different kinds of keymaps in total.
273 The BaseMap, DefaultMap and PartialMaps.
275 For each type of keymap, it is possible to combine multiple .kll files together to create new ones using
276 the compiler. The order of the files matter, as the right-most file will overwrite any setting in the
279 > NOTE: Each keymap is done after the entire file is processed. This means that within the file the order
280 > of assignment doesa *not* matter (if you assign the same thing twice, then yes the most recent one
284 BaseMap defines what the keyboard can do. This includes specific capabilities of the keyboard (such as USB),
285 the mapping of Scan Codes to USB Codes and any specific configurations for the keyboard.
286 In general, the BaseMap rarely needs to be changed. Usually only when adding a new keyboard to the firmware
287 does the Basemap need any modification.
288 The BaseMap is what both DefaultMap and PartialMaps are based upon. This allows for a common reference
289 when defining custom keymappings.
291 > NOTE: Don't use defaultMap.kll to change your layouts. This will work, but they will not be portable.
294 The DefaultMap is the normal state of the keyboard, i.e. your default layer.
295 Using the BaseMap as a base, the DefaultMap is a modification of the BaseMap to what the keyboard should do.
296 Since the DefaultMap uses USB Code to USB Code translations, this means that keymaps used for one keyboard
297 will work with another keyboard.
298 For example, I use Colemak, so this means I only have to define Colemak once for every keyboard that supports
299 the kiibohd firmware. This is possible because every BaseMap defines the keyboard as a US ANSI like keyboard
301 The DefaultMap can also be thought of as Layer 0.
304 PartialMaps are optional keymaps that can be "stacked" on top of the DefaultMap.
305 They can be dynamically swapped out using the layer control capabilities:
307 - layerLatch( `<layer number>` )
308 - layerLock( `<layer number>` )
309 - layerShift( `<layer number>` )
311 layerShift is usually what you want as it works just like a standard shift key.
312 layerLock is similar to the CapsLock key. While layerLatch is a latch, where only the next key you press
313 will use that layer (e.g. stickykeys).
315 A unique aspect of KLL layers is that it's a true stack of layers.
316 When a layer is activated, only the keys that are specified by the layer will change.
317 This means, if you define a layer that only sets `CapsLock -> LCtrl` and `LCtrl->Capslock` only those keys
318 will change when you active the layer. All the other keys will use the layer that is "underneath" to
319 lookup the keypress (usually the DefaultMap).
321 This means that you can combine .kll files statically using the compiler or dynamically using the firmware.
323 You can set the max number of layers by changing the `stateWordSize` define in one of your kll files.
324 By default it is set to 8 in Macro/PartialMap/capabilities.kll. This means you can have up to 256 layers
325 total (this includes the DefaultMap).
326 You can increase this number to either 16 or 32 (this will use more Flash and RAM btw) which will give you
327 2^16 and 2^32 possible layers respectively (65 535 and 4 294 967 295).
332 # Keymap Configuration (do not include the .kll extension)
335 #| Do not include the .kll extension
336 #| * BaseMap maps the native keyboard scan codes to USB Codes so the layout is compatible with all other layouts
337 #| * DefaultMap allows the default keymap to be modified from the BaseMap
338 #| * PartialMaps is a set of dynamically set layers (there is no limit, but too many may use up too much RAM...)
339 #| BaseMap generally does not need to be changed from "defaultMap"
343 #| * defines a single .kll layout file, double-quotes are needed to distinguish between layers
344 #| "myMap specialLayer"
345 #| * defines myMap to be the main layout, then replace specialLayers on top of it
347 #| - Only for PartialMaps -
348 #| "myMap specialLayer" "myMap colemak" dvorak
349 #| * As before, but also generates a second layer at index 2 and third at index 3
351 #| NOTE: Remember to add key(s) to enable each Partial Layer
352 #| NOTE2: Layers are always based up the BaseMap (which should be an ANSI-like mapping)
353 #| NOTE3: Compiler looks in kll/layouts and the build directory for layout files (precedence on build directory)
355 ##| Set the base keyboard .kll map, defaults to "defaultMap" if not found
356 ##| Looks in Scan/<Module Name> for the available BaseMaps
357 set( BaseMap "defaultMap"
358 CACHE STRING "KLL BaseMap/Scancode Keymapping" )
360 ##| Layer additonal .kll maps on the BaseMap, layers are in order from 1st to nth
362 set( DefaultMap "md1Overlay stdFuncMap"
363 CACHE STRING "KLL DefaultMap" )
365 ##| ParitalMaps available on top of the BaseMap. See above for syntax on specifying multiple layers vs. layering
367 set( PartialMaps "hhkbpro2"
368 CACHE STRING "KLL PartialMaps/Layer Definitions" )
396 -- Compiler Source Files:
397 Lib/mk20dx.c;Lib/delay.c
400 -- Detected Scan Module Source Files:
401 Scan/MD1/scan_loop.c;Scan/MD1/../MatrixARM/matrix_scan.c
402 -- Detected Macro Module Source Files:
403 Macro/PartialMap/macro.c
404 -- Detected Output Module Source Files:
405 Output/pjrcUSB/output_com.c;Output/pjrcUSB/arm/usb_desc.c;Output/pjrcUSB/arm/usb_dev.c;
406 Output/pjrcUSB/arm/usb_keyboard.c;Output/pjrcUSB/arm/usb_mem.c;Output/pjrcUSB/arm/usb_serial.c
407 -- Detected Debug Module Source Files:
408 Debug/full/../cli/cli.c;Debug/full/../led/led.c;Debug/full/../print/print.c
409 -- Found Git: /usr/bin/git (found version "2.2.1")
410 -- Found Ctags: /usr/bin/ctags (found version "5.8")
411 -- Checking for latest kll version:
412 Current branch master is up to date.
413 -- Detected Layout Files:
414 /home/hyatt/Source/controller/Macro/PartialMap/capabilities.kll
415 /home/hyatt/Source/controller/Output/pjrcUSB/capabilities.kll
416 /home/hyatt/Source/controller/Scan/MD1/defaultMap.kll
417 /home/hyatt/Source/controller/kll/layouts/md1Overlay.kll
418 /home/hyatt/Source/controller/kll/layouts/stdFuncMap.kll
419 /home/hyatt/Source/controller/kll/layouts/hhkbpro2.kll
422 -- Build files have been written to: /home/hyatt/Source/controller/build
423 [master]: make [~/Source/controller/build](hyatt@x230mas:pts/6)
424 [ 5%] Generating KLL Layout
425 Scanning dependencies of target kiibohd.elf
426 [ 11%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.o
427 [ 17%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/mk20dx.c.o
428 [ 23%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/delay.c.o
429 [ 29%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MD1/scan_loop.c.o
430 [ 35%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MatrixARM/matrix_scan.c.o
431 [ 41%] Building C object CMakeFiles/kiibohd.elf.dir/Macro/PartialMap/macro.c.o
432 [ 47%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/output_com.c.o
433 [ 52%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_desc.c.o
434 [ 58%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_dev.c.o
435 [ 64%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_keyboard.c.o
436 [ 70%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_mem.c.o
437 [ 76%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_serial.c.o
438 [ 82%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/cli/cli.c.o
439 [ 88%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/led/led.c.o
440 [ 94%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/print/print.c.o
441 Linking C executable kiibohd.elf
442 [ 94%] Built target kiibohd.elf
443 Scanning dependencies of target SizeAfter
444 [100%] Chip usage for mk20dx128vlf5
445 SRAM: 32% 5384/16384 bytes
446 Flash: 18% 23384/126976 bytes
447 [100%] Built target SizeAfter
450 Linux Loading Firmware
451 ----------------------
453 First place the keyboard into re-flash mode. This can be done either by
454 pressing the re-flash button on the PCB/Teensy. Or by entering the Kiibohd
455 Virtual Serial Port and using the 'reload' command.
457 The `load` script that is created during the build can load the firmware over
458 USB. Either run it with sudo, or install the `98-kiibohd.rules` to
459 `/etc/udev/rules.d` and run: `udevadm control --reload-rules`.
461 To load the newly built firmware: `./load`.
464 Linux Building Bootloader
465 -------------------------
467 > NOTE: Does not apply to Teensy based builds.
491 -- Compiler Source Files:
492 Lib/mk20dx.c;Lib/delay.c
495 -- Bootloader Source Files:
496 main.c;dfu.c;dfu.desc.c;flash.c;kinetis.c;usb.c
497 -- Found Git: /usr/bin/git (found version "2.2.1")
498 -- Found Ctags: /usr/bin/ctags (found version "5.8")
501 -- Build files have been written to: /home/hyatt/Source/controller/Bootloader/build
502 [master]: make [~/Source/controller/Bootloader/build](hyatt@x230mas:pts/6)
503 Scanning dependencies of target kiibohd_bootloader.elf
504 [ 11%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/main.c.o
505 [ 22%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/dfu.c.o
506 [ 33%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/dfu.desc.c.o
507 [ 44%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/flash.c.o
508 [ 55%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/kinetis.c.o
509 [ 66%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/usb.c.o
510 [ 77%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/home/hyatt/Source/controller/Lib/mk20dx.c.o
511 [ 88%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/home/hyatt/Source/controller/Lib/delay.c.o
512 Linking C executable kiibohd_bootloader.elf
513 [ 88%] Built target kiibohd_bootloader.elf
514 Scanning dependencies of target SizeAfter
515 [100%] Chip usage for mk20dx128vlf5
516 SRAM: 19% 3176/16384 bytes
517 Flash: 2% 3736/126976 bytes
518 [100%] Built target SizeAfter
522 Linux Loading Bootloader
523 ------------------------
525 > NOTE: Does not apply to Teensy based builds.
527 It's recommended to use an SWD-type flasher like a Bus Pirate. There is a
528 convenience script for loading the firmware once the system is setup.
531 $ cd Bootloader/Scripts
535 The above script requires Ruby, Ruby serial port module, git, and a
536 `/dev/buspirate` udev rule.
540 * https://github.com/mchck/mchck/wiki/Getting-Started (See Bus-Pirate section)
541 * https://wiki.archlinux.org/index.php/Bus_pirate
568 -- Compiler Source Files:
569 Lib/mk20dx.c;Lib/delay.c
572 -- Detected Scan Module Source Files:
573 Scan/MD1/scan_loop.c;Scan/MD1/../MatrixARM/matrix_scan.c
574 -- Detected Macro Module Source Files:
575 Macro/PartialMap/macro.c
576 -- Detected Output Module Source Files:
577 Output/pjrcUSB/output_com.c;Output/pjrcUSB/arm/usb_desc.c;Output/pjrcUSB/arm/usb_dev.c;Output/pjrcUSB/arm/usb_keyboard.c;Output/pjrcUSB/arm/usb_mem.c;Output/pjrcUSB/arm/usb_serial.c
578 -- Detected Debug Module Source Files:
579 Debug/full/../cli/cli.c;Debug/full/../led/led.c;Debug/full/../print/print.c
580 -- Found Git: C:/cygwin64/bin/git.exe (found version "2.1.1")
581 -- Found Ctags: C:/cygwin64/bin/ctags.exe (found version "5.8")
582 -- Checking for latest kll version:
583 Current branch master is up to date.
584 -- Detected Layout Files:
585 C:/cygwin64/home/Jacob/controller/Macro/PartialMap/capabilities.kll
586 C:/cygwin64/home/Jacob/controller/Output/pjrcUSB/capabilities.kll
587 C:/cygwin64/home/Jacob/controller/Scan/MD1/defaultMap.kll
588 C:/cygwin64/home/Jacob/controller/kll/layouts/md1Overlay.kll
589 C:/cygwin64/home/Jacob/controller/kll/layouts/stdFuncMap.kll
590 C:/cygwin64/home/Jacob/controller/kll/layouts/hhkbpro2.kll
593 -- Build files have been written to: C:/cygwin64/home/Jacob/controller/build
596 [ 5%] Generating KLL Layout
597 Scanning dependencies of target kiibohd.elf
598 [ 11%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.obj
599 [ 17%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/mk20dx.c.obj
600 [ 23%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/delay.c.obj
601 [ 29%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MD1/scan_loop.c.obj
602 [ 35%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MatrixARM/matrix_scan.c.obj
603 [ 41%] Building C object CMakeFiles/kiibohd.elf.dir/Macro/PartialMap/macro.c.obj
604 [ 47%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/output_com.c.obj
605 [ 52%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_desc.c.obj
606 [ 58%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_dev.c.obj
607 [ 64%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_keyboard.c.obj
608 [ 70%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_mem.c.obj
609 [ 76%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_serial.c.obj
610 [ 82%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/cli/cli.c.obj
611 [ 88%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/led/led.c.obj
612 [ 94%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/print/print.c.obj
613 Linking C executable kiibohd.elf
614 [ 94%] Built target kiibohd.elf
615 Scanning dependencies of target SizeAfter
616 [100%] Chip usage for mk20dx128vlf5
617 SRAM: 32% 5384/16384 bytes
618 Flash: 18% 23296/126976 bytes
619 [100%] Built target SizeAfter
624 If you get the following error, you have not setup wincmake correctly:
628 [ 5%] Generating KLL Layout
629 Scanning dependencies of target kiibohd.elf
630 [ 11%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.o
631 ../main.c:28:19: fatal error: macro.h: No such file or directory
634 compilation terminated.
635 CMakeFiles/kiibohd.elf.dir/build.make:67: recipe for target 'CMakeFiles/kiibohd.elf.dir/main.c.o' failed
636 make[2]: *** [CMakeFiles/kiibohd.elf.dir/main.c.o] Error 1
637 CMakeFiles/Makefile2:98: recipe for target 'CMakeFiles/kiibohd.elf.dir/all' failed
638 make[1]: *** [CMakeFiles/kiibohd.elf.dir/all] Error 2
639 Makefile:75: recipe for target 'all' failed
640 make: *** [all] Error 2
643 If you have already added the line to your `~/.bashrc` try restarting your
647 Windows Loading Firmware
648 ------------------------
650 First place the keyboard into re-flash mode. This can be done either by
651 pressing the re-flash button on the PCB/Teensy. Or by entering the Kiibohd
652 Virtual Serial Interface and using the `reload` command.
654 The `load` script that is created during the build can load the firmware over
657 To load the newly built firmware: `./load`
659 Be patient the couple of times, Windows is slow at installing drivers...
679 Mac OS X Loading Firmware
680 -------------------------
682 First place the keyboard into re-flash mode. This can be done either by
683 pressing the re-flash button on the PCB/Teensy. Or by entering the Kiibohd
684 Virtual Serial Port and using the `reload` command.
686 The `load` script that is created during the build can load the firmware over
689 To load the newly built firmware: `./load`.
692 Virtual Serial Port - CLI
693 -------------------------
695 Rather than use a special program that can interpret Raw HID, this controller exposes a USB Serial CDC endpoint.
696 This allows for you to use a generic serial terminal to debug/control the keyboard firmware (e.g. Tera Term, minicom, screen)
701 I generally use screen. You will need sudo/root priviledges if you haven't
702 installed the `98-kiibohd.rules` file to `/etc/udev/rules.d`.
705 $ screen /dev/ttyACM0
706 # (Might be ACM1, ACM2, etc.)
711 Make sure the Teensy Virtual Serial Port driver is installed. If possible use
712 screen (as part of Cygwin). Check which COM port the virtual serial port has
713 been assigned to: `Device Manager->Ports (COM & LPT)->Teensy USB Serial`. In
714 brackets it will say which COM port (e.g. COM3)
716 putty works well when using DTR/DSR or RTS/CTS flow control.
719 | --------------- | ------------------------------------- |
720 | Connection type | Serial |
721 | Serial line | Your COM port, e.g. COM3 |
722 | Speed | doesn't matter, it's auto-negotiated |
724 Under `Category->Connections->Serial`: `Flow control: DTR/DSR`.
726 If stuff is hard to read (you have a dumb colour scheme):
727 `Category->Window->Colours->Use system color`. That seems to make text at
730 > I use a custom colour scheme that makes each colour easy to see.
733 Unfortunately, screen for Cygwin seems to be broken for serial ports, but you
738 # Might be a different file, ttyS0, ttyACM0, ttyUSB0, etc.
741 Gnu screen doesn't seem to echo all the characters (it works though).
742 I believe it's a problem with stty, but I don't know how to fix it...
746 I recommend screen (can be installed via Macports).
749 $ screen /dev/tty.<usb something>