2013-10-05 20:53:06 +00:00
The Kiibohd Controller
----------------------
2014-09-16 01:45:01 +00:00
This README is a bit long, just look at the sections you are interested in.
2014-12-31 21:42:21 +00:00
You only need to install avr-gcc if you want to build for the Teensy 2.0/2.0++.
Everything else needs an arm-none-eabi-gcc compiler (e.g. Infinity keyboard, Teensy 3.0/3.1, McHCK).
2014-09-16 01:45:01 +00:00
Linux is the ideal build environment (preferably recent'ish).
2014-12-31 21:42:21 +00:00
In the near future I'll make available an Arch Linux VM for building/manufacturing tests.
2014-09-16 01:45:01 +00:00
Building on Mac should be ok for 99% of users with Macports (haven't tried Brew).
The dfu Bootloader will not build correctly with the old version of arm-none-eabi-gcc that Macports currently has (4.7.3).
This is due to a bug with lto (link time optimizations) which makes the resulting binary too big to fit on the chip (must be less than 4096 Bytes).
2014-12-31 23:58:28 +00:00
2014-09-16 01:45:01 +00:00
Building on Windows should also be fine for 99% of users, but takes a bunch of work to setup (because Windows is a crappy dev environment).
Cygwin is currently required along with some non-Cygwin compilers and utilities (because they are not available for Cygwin).
The dfu Bootloader will not build because of a Make 3.81+ bug/feature that removed support for non-Unix (Windows) filenames as dependencies of targets.
If you replace the version of Make in Cygwin it should work (e.g. http://stackoverflow.com/questions/601516/cygwin-make-error-target-pattern-contains-no).
However, make sure that the flash size is no larger than 4096 Bytes or the bootloader will not work.
2014-12-31 21:42:21 +00:00
Things will likely break if there are *SPACES IN YOUR PATHS*. I install cygwin to C:\cygwin64.
If you are brave and have programming knowledge, I will accept patches to fix any issues regarding spaces in paths.
2014-09-16 01:45:01 +00:00
2013-10-05 20:53:06 +00:00
Please give authors credit for modules used if you use in a distributed product :D
----------------------
2014-12-31 21:42:21 +00:00
General Dependencies
2013-10-05 20:53:06 +00:00
----------------------
Below listed are the Arch Linux pacman names, AUR packages may be required.
These depend a bit on which targets you are trying to build, but the general one:
- cmake (2.8 and higher)
2014-09-16 01:45:01 +00:00
- git
- ctags (recommended, not required)
- python3
- libusb1.0 (and -devel)
- make
2013-10-05 20:53:06 +00:00
AVR Specific (Teensy 1.0/++,2.0/++) (try to use something recent, suggested versions below)
2014-04-18 20:16:47 +00:00
- avr-gcc (~4.8.0)
- avr-binutils (~2.23.2)
- avr-libc (~1.8.0)
2013-10-05 20:53:06 +00:00
2014-12-31 21:42:21 +00:00
ARM Specific (Teensy 3.0/3.1, Infinity Keyboard, McHCK)
Arch Linux / Mac Ports
2014-03-31 08:07:48 +00:00
- arm-none-eabi-gcc
- arm-none-eaby-binutils
2014-12-31 21:42:21 +00:00
Windows
(https://launchpad.net/gcc-arm-embedded/+download)
- gcc-arm-none-eabi (win32.zip)
2014-04-10 04:06:57 +00:00
----------------------
Windows Setup
----------------------
Compiling on Windows does work, just it's a bunch more work.
First make sure Cygwin is installed - http://www.cygwin.com/ - 32bit or 64bit is fine. Make sure the following are installed:
- make
- git (needed for some compilation info)
2014-04-18 01:49:40 +00:00
- cmake
- gcc-core
2014-05-27 05:46:03 +00:00
- gcc-g++
2014-04-18 20:16:47 +00:00
- libusb1.0
- libusb1.0-devel
2014-09-16 01:45:01 +00:00
- python3
- ctags (recommended, not required)
2014-04-10 04:06:57 +00:00
2014-12-31 21:42:21 +00:00
Please note, I use cygwin term exclusively for any command line options. Unless mentioned otherwise, use it.
2014-06-07 16:13:57 +00:00
Do NOT use CMD or Powershell.
2014-09-16 01:45:01 +00:00
Also install the Windows version of CMake (3+ is ideal) - http://cmake.org/cmake/resources/software.html
2014-12-31 21:42:21 +00:00
Select "Do not add CMake to system PATH".
2014-04-18 01:49:40 +00:00
This is in addition to the Cygwin version. This is an easier alternative to installing another C compiler.
Add the following line to your .bashrc, making sure the CMake path is correct:
2014-09-16 01:45:01 +00:00
echo "alias wincmake=\"PATH='/cygdrive/c/Program Files (x86)/CMake'/bin:'${PATH}' cmake -G 'Unix Makefiles'\"" >> ~/.bashrc
2014-04-10 04:06:57 +00:00
2014-05-27 05:46:03 +00:00
Install the PJRC Virtual Serial Port Driver:
(http://pjrc.com/teensy/serial_install.exe)
2014-04-10 04:06:57 +00:00
Next, install the compiler(s) you want.
2014-04-18 20:16:47 +00:00
2014-09-16 01:45:01 +00:00
2014-04-10 04:06:57 +00:00
---------
| AVR GCC |
---------
You just need the Atmel AVR 8-bit Toolchain. The latest should be fine, as of writing it was 3.4.3.
http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx
2014-04-20 08:08:02 +00:00
(Atmel AVR 8-bit Toolchain 3.4.3 - Windows)
2014-04-10 04:06:57 +00:00
2014-09-16 01:45:01 +00:00
Extract the files to a directory, say C:\avr8-gnu-toolchain. Then copy all the folders in that directory to the Cygwin /usr/local directory.
Mine is C:\cygwin64\usr\local.
2014-04-10 04:06:57 +00:00
(You can also just setup the paths, but this is faster/simpler. Might screw up your Cygwin though).
----------
| ARM EABI |
----------
2014-12-31 21:42:21 +00:00
Download the latest GNU Tools for Embedded Processors gcc-arm-none-eabi.
2014-04-10 04:06:57 +00:00
2014-12-31 21:42:21 +00:00
https://launchpad.net/gcc-arm-embedded/+download
2014-04-10 04:06:57 +00:00
2014-12-31 21:42:21 +00:00
Download "gcc-arm-none-eabi*win32.zip".
2014-05-27 05:46:03 +00:00
2014-12-31 21:42:21 +00:00
Then extract all the folders/files in the zip to the Cygwin /usr/local directory.
2014-09-16 01:45:01 +00:00
Mine is C:\cygwin64\usr\local.
2014-12-31 21:42:21 +00:00
Or, you can setup paths using the installer (you have to be more careful, avoid spaces in paths).
----------------------
CMake Info
----------------------
One of the big benefits of using CMake is the ability to build multiple configurations (for different microcontrollers) at the same time.
The following sections explain in detail what each CMakeLists.txt configuration option does and what you can change it to.
However, it is possible to configure each of these options using the -D command line flag.
For example, to build the Infinity Keyboard default configuration:
mkdir build_infinity
cd build_infinity
cmake -DCHIP=mk20dx128vlf5 -DScanModule=MD1 -DMacroModule=PartialMap -DOutputModule=pjrcUSB -DDebugModule=full -DBaseMap=defaultMap -DDefaultMap="md1Overlay stdFuncMap" -DPartialMaps="hhkbpro2" ..
make
CMake defaults to the values specified in CMakeLists.txt if not overridden via the command line.
NOTE: On Windows, you will have to use "wincmake" instead of "cmake".
2013-10-05 20:53:06 +00:00
----------------------
Selecting Microcontroller
----------------------
2014-04-19 05:57:14 +00:00
This is where you select the chip you want to compile for.
The build system will automatically select the compiler needed to compile for your chip.
2013-10-05 20:53:06 +00:00
2014-04-19 05:57:14 +00:00
Open up CMakeLists.txt in your favourite text editor.
2013-10-05 20:53:06 +00:00
You are looking for:
###
2014-04-19 05:57:14 +00:00
# Chip Selection
2013-10-05 20:53:06 +00:00
#
2014-04-19 05:57:14 +00:00
#| You _MUST_ set this to match the microcontroller you are trying to compile for
#| You _MUST_ clean the build directory if you change this value
2013-10-05 20:53:06 +00:00
#|
2014-04-19 05:57:14 +00:00
set( CHIP
# "at90usb162" # Teensy 1.0 (avr)
# "atmega32u4" # Teensy 2.0 (avr)
# "at90usb646" # Teensy++ 1.0 (avr)
2014-12-31 21:42:21 +00:00
# "at90usb1286" # Teensy++ 2.0 (avr)
2014-04-19 05:57:14 +00:00
# "mk20dx128" # Teensy 3.0 (arm)
2014-12-31 21:42:21 +00:00
"mk20dx128vlf5" # McHCK mk20dx128vlf5
2014-04-19 05:57:14 +00:00
# "mk20dx256" # Teensy 3.1 (arm)
2014-12-31 21:42:21 +00:00
CACHE STRING "Microcontroller Chip" )
2013-10-05 20:53:06 +00:00
2014-04-19 05:57:14 +00:00
Just uncomment the chip you want, and comment out the old one.
2013-10-05 20:53:06 +00:00
NOTE: If you change this option, you will *need* to delete the build directory that is created in the Building sections below.
----------------------
Selecting Modules
----------------------
WARNING: Not all modules are compatible, and some modules may have dependencies on other modules.
This is where the options start getting interesting.
The Kiibohd Controller is designed around a set of 4 types of modules that correspond to different functionality:
- Scan Module
- Macro Module
2014-03-31 08:07:48 +00:00
- Output Module
2013-10-05 20:53:06 +00:00
- Debug Module
The Scan Module is where the most interesting stuff happens. These modules take in "keypress data".
A converter Scan Module will interpret a protocol into key press/releases.
A matrix Scan Module may inherit from the matrix module to scan keypress from a matrix
This module just has to give press/release codes, but does have some callback control to other modules depending on the lifecycle for press/release codes (this can be very complicated depending on the protocol).
Each Scan Module has it's own default keymap/modifier map. (TODO recommend keymap changing in the Macro Module).
2013-11-17 00:40:59 +00:00
Some scan modules have very specialized hardware requirements, each module directory should have at least a link to the needed parts and/or schematics (TODO!).
2013-10-05 20:53:06 +00:00
2014-03-31 08:07:48 +00:00
The Macro Module takes care of the mapping of the key press/release code into an Output (USB) scan code.
2013-10-05 20:53:06 +00:00
Any layering, macros, keypress intelligence/reaction is done here.
2014-03-31 08:07:48 +00:00
The Output Module is the module dealing with output from the microcontroller. Currently USB is the only output protocol.
2013-10-05 20:53:06 +00:00
Different USB output implementations are available, pjrc being the safest/least featureful one.
Debug capabilities may depend on the module selected.
The Debug Module enables various things like the Teensy LED on errors, debug terminal output.
(TODO get true UART working in avr, not just arm)
2014-04-19 05:57:14 +00:00
Open up CMakeLists.txt in your favourite text editor.
2013-10-05 20:53:06 +00:00
Look for:
###
# Project Modules
#
#| Note: This is the only section you probably want to modify
#| Each module is defined by it's own folder (e.g. Scan/Matrix represents the "Matrix" module)
#| All of the modules must be specified, as they generate the sources list of files to compile
#| Any modifications to this file will cause a complete rebuild of the project
2014-12-31 21:42:21 +00:00
#| Please look at the {Scan,Macro,Output,Debug} for information on the modules and how to create new ones
2013-10-05 20:53:06 +00:00
##| Deals with acquiring the keypress information and turning it into a key index
2014-12-31 21:42:21 +00:00
set( ScanModule "MD1"
CACHE STRING "Scan Module" )
2013-10-05 20:53:06 +00:00
2014-12-31 21:42:21 +00:00
##| Provides the mapping functions for DefaultMap and handles any macro processing before sending to the OutputModule
set( MacroModule "PartialMap"
CACHE STRING "Macro Module" )
2013-10-05 20:53:06 +00:00
##| Sends the current list of usb key codes through USB HID
2014-12-31 21:42:21 +00:00
set( OutputModule "pjrcUSB"
CACHE STRING "Output Module" )
2013-10-05 20:53:06 +00:00
##| Debugging source to use, each module has it's own set of defines that it sets
2014-12-31 21:42:21 +00:00
set( DebugModule "full"
CACHE STRING "Debug Module" )
2013-10-05 20:53:06 +00:00
Look at each module individually for it's requirements. There is chip/architecture dependency checking but some permutations of modules may not be tested/compile.
There are also CMake options for temporarily selecting modules. But it's easier to just edit the file.
e.g. cmake -DScanModuleOverride=<module name>
----------------------
Linux Building
----------------------
From this directory.
mkdir build
cd build
cmake ..
make
Example output:
2014-12-31 23:58:28 +00:00
[master]: cmake .. [~/Source/controller/build](hyatt@x230mas:pts/6)
2013-10-05 20:53:06 +00:00
-- Compiler Family:
2014-12-31 23:58:28 +00:00
arm
-- Chip Selected:
mk20dx128vlf5
-- Chip Family:
mk20dx
-- CPU Selected:
cortex-m4
-- Compiler Source Files:
Lib/mk20dx.c;Lib/delay.c
-- Bootloader Type:
dfu
2013-10-05 20:53:06 +00:00
-- Detected Scan Module Source Files:
2014-12-31 23:58:28 +00:00
Scan/MD1/scan_loop.c;Scan/MD1/../MatrixARM/matrix_scan.c
2013-10-05 20:53:06 +00:00
-- Detected Macro Module Source Files:
2014-12-31 23:58:28 +00:00
Macro/PartialMap/macro.c
2014-03-31 08:07:48 +00:00
-- Detected Output Module Source Files:
2014-12-31 23:58:28 +00:00
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
2013-10-05 20:53:06 +00:00
-- Detected Debug Module Source Files:
2014-12-31 23:58:28 +00:00
Debug/full/../cli/cli.c;Debug/full/../led/led.c;Debug/full/../print/print.c
-- Found Git: /usr/bin/git (found version "2.2.1")
-- Found Ctags: /usr/bin/ctags (found version "5.8")
-- Checking for latest kll version:
Current branch master is up to date.
-- Detected Layout Files:
/home/hyatt/Source/controller/Macro/PartialMap/capabilities.kll
/home/hyatt/Source/controller/Output/pjrcUSB/capabilities.kll
/home/hyatt/Source/controller/Scan/MD1/defaultMap.kll
/home/hyatt/Source/controller/kll/layouts/md1Overlay.kll
/home/hyatt/Source/controller/kll/layouts/stdFuncMap.kll
/home/hyatt/Source/controller/kll/layouts/hhkbpro2.kll
2013-10-05 20:53:06 +00:00
-- Configuring done
-- Generating done
2014-12-31 23:58:28 +00:00
-- Build files have been written to: /home/hyatt/Source/controller/build
[master]: make [~/Source/controller/build](hyatt@x230mas:pts/6)
[ 5%] Generating KLL Layout
2013-10-05 20:53:06 +00:00
Scanning dependencies of target kiibohd.elf
2014-12-31 23:58:28 +00:00
[ 11%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.o
[ 17%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/mk20dx.c.o
[ 23%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/delay.c.o
[ 29%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MD1/scan_loop.c.o
[ 35%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MatrixARM/matrix_scan.c.o
[ 41%] Building C object CMakeFiles/kiibohd.elf.dir/Macro/PartialMap/macro.c.o
[ 47%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/output_com.c.o
[ 52%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_desc.c.o
[ 58%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_dev.c.o
[ 64%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_keyboard.c.o
[ 70%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_mem.c.o
[ 76%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_serial.c.o
[ 82%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/cli/cli.c.o
[ 88%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/led/led.c.o
[ 94%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/print/print.c.o
2013-10-05 20:53:06 +00:00
Linking C executable kiibohd.elf
2014-12-31 23:58:28 +00:00
[ 94%] Built target kiibohd.elf
2013-10-05 20:53:06 +00:00
Scanning dependencies of target SizeAfter
2014-12-31 23:58:28 +00:00
[100%] Chip usage for mk20dx128vlf5
SRAM: 32% 5384/16384 bytes
Flash: 18% 23384/126976 bytes
2013-10-05 20:53:06 +00:00
[100%] Built target SizeAfter
----------------------
Linux Loading Firmware
----------------------
2014-05-27 05:46:03 +00:00
First place the keyboard into re-flash mode.
This can be done either by pressing the re-flash button on the PCB/Teensy.
Or by entering the Kiibohd Virtual Serial Port and using the 'reload' command.
2013-10-05 20:53:06 +00:00
The 'load' script that is created during the build can load the firmware over USB.
2014-05-27 05:46:03 +00:00
Either run it with sudo, or install the 98-kiibohd.rules to /etc/udev/rules.d
and run: udevadm control --reload-rules
2013-10-05 20:53:06 +00:00
2014-05-27 05:46:03 +00:00
To load the newly built firmware:
2013-10-05 20:53:06 +00:00
./load
2014-09-16 03:19:40 +00:00
----------------------
Linux Building Bootloader
----------------------
*NOTE* Does not apply to Teensy based builds.
From this directory.
cd Bootloader
mkdir build
cd build
cmake ..
make
Example output:
2014-12-31 23:58:28 +00:00
[master]: cmake .. [~/Source/controller/Bootloader/build](hyatt@x230mas:pts/6)
-- Compiler Family:
arm
-- Chip Selected:
mk20dx128vlf5
-- Chip Family:
mk20dx
-- CPU Selected:
cortex-m4
-- Compiler Source Files:
Lib/mk20dx.c;Lib/delay.c
-- Bootloader Type:
dfu
-- Bootloader Source Files:
main.c;dfu.c;dfu.desc.c;flash.c;kinetis.c;usb.c
-- Found Git: /usr/bin/git (found version "2.2.1")
-- Found Ctags: /usr/bin/ctags (found version "5.8")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hyatt/Source/controller/Bootloader/build
[master]: make [~/Source/controller/Bootloader/build](hyatt@x230mas:pts/6)
Scanning dependencies of target kiibohd_bootloader.elf
[ 11%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/main.c.o
[ 22%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/dfu.c.o
[ 33%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/dfu.desc.c.o
[ 44%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/flash.c.o
[ 55%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/kinetis.c.o
[ 66%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/usb.c.o
[ 77%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/home/hyatt/Source/controller/Lib/mk20dx.c.o
[ 88%] Building C object CMakeFiles/kiibohd_bootloader.elf.dir/home/hyatt/Source/controller/Lib/delay.c.o
Linking C executable kiibohd_bootloader.elf
[ 88%] Built target kiibohd_bootloader.elf
Scanning dependencies of target SizeAfter
[100%] Chip usage for mk20dx128vlf5
SRAM: 19% 3176/16384 bytes
Flash: 2% 3736/126976 bytes
[100%] Built target SizeAfter
2014-09-16 03:19:40 +00:00
----------------------
Linux Loading Bootloader
----------------------
*NOTE* Does not apply to Teensy based builds.
It's recommended to use an SWD-type flasher like a Bus Pirate.
2014-12-31 21:42:21 +00:00
There is a convenience script for loading the firmware once the system is setup.
cd Bootloader/Scripts
./swdLoad.bash
The above script requires Ruby, Ruby serial port module, git, and a /dev/buspirate udev rule.
Additional Notes:
2014-12-31 23:58:28 +00:00
https://github.com/mchck/mchck/wiki/Getting-Started (See Bus-Pirate section)
2014-12-31 21:42:21 +00:00
https://wiki.archlinux.org/index.php/Bus_pirate
2014-09-16 03:19:40 +00:00
2013-10-05 20:53:06 +00:00
----------------------
Windows Building
----------------------
2014-04-10 04:06:57 +00:00
From this directory.
mkdir build
cd build
2014-09-16 03:19:40 +00:00
wincmake ..
2014-06-07 16:13:57 +00:00
make
2014-04-10 04:06:57 +00:00
Example output:
2014-12-31 21:42:21 +00:00
$ wincmake ..
2014-04-10 04:06:57 +00:00
-- Compiler Family:
2014-12-31 21:42:21 +00:00
arm
-- Chip Selected:
mk20dx128vlf5
-- Chip Family:
mk20dx
2014-04-10 04:06:57 +00:00
-- CPU Selected:
2014-12-31 21:42:21 +00:00
cortex-m4
-- Compiler Source Files:
Lib/mk20dx.c;Lib/delay.c
-- Bootloader Type:
dfu
2014-04-10 04:06:57 +00:00
-- Detected Scan Module Source Files:
2014-12-31 21:42:21 +00:00
Scan/MD1/scan_loop.c;Scan/MD1/../MatrixARM/matrix_scan.c
2014-04-10 04:06:57 +00:00
-- Detected Macro Module Source Files:
Macro/PartialMap/macro.c
-- Detected Output Module Source Files:
2014-12-31 21:42:21 +00:00
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
2014-04-10 04:06:57 +00:00
-- Detected Debug Module Source Files:
Debug/full/../cli/cli.c;Debug/full/../led/led.c;Debug/full/../print/print.c
2014-12-31 21:42:21 +00:00
-- Found Git: C:/cygwin64/bin/git.exe (found version "2.1.1")
-- Found Ctags: C:/cygwin64/bin/ctags.exe (found version "5.8")
-- Checking for latest kll version:
Current branch master is up to date.
-- Detected Layout Files:
C:/cygwin64/home/Jacob/controller/Macro/PartialMap/capabilities.kll
C:/cygwin64/home/Jacob/controller/Output/pjrcUSB/capabilities.kll
C:/cygwin64/home/Jacob/controller/Scan/MD1/defaultMap.kll
C:/cygwin64/home/Jacob/controller/kll/layouts/md1Overlay.kll
C:/cygwin64/home/Jacob/controller/kll/layouts/stdFuncMap.kll
C:/cygwin64/home/Jacob/controller/kll/layouts/hhkbpro2.kll
2014-04-10 04:06:57 +00:00
-- Configuring done
-- Generating done
2014-12-31 21:42:21 +00:00
-- Build files have been written to: C:/cygwin64/home/Jacob/controller/build
2014-04-10 04:06:57 +00:00
2014-12-31 21:42:21 +00:00
Jacob@DenPC ~/controller/build
2014-04-10 04:06:57 +00:00
$ make
2014-12-31 21:42:21 +00:00
[ 5%] Generating KLL Layout
2014-04-10 04:06:57 +00:00
Scanning dependencies of target kiibohd.elf
2014-12-31 21:42:21 +00:00
[ 11%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.obj
[ 17%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/mk20dx.c.obj
[ 23%] Building C object CMakeFiles/kiibohd.elf.dir/Lib/delay.c.obj
[ 29%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MD1/scan_loop.c.obj
[ 35%] Building C object CMakeFiles/kiibohd.elf.dir/Scan/MatrixARM/matrix_scan.c.obj
[ 41%] Building C object CMakeFiles/kiibohd.elf.dir/Macro/PartialMap/macro.c.obj
[ 47%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/output_com.c.obj
[ 52%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_desc.c.obj
[ 58%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_dev.c.obj
[ 64%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_keyboard.c.obj
[ 70%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_mem.c.obj
[ 76%] Building C object CMakeFiles/kiibohd.elf.dir/Output/pjrcUSB/arm/usb_serial.c.obj
[ 82%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/cli/cli.c.obj
[ 88%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/led/led.c.obj
[ 94%] Building C object CMakeFiles/kiibohd.elf.dir/Debug/print/print.c.obj
2014-04-10 04:06:57 +00:00
Linking C executable kiibohd.elf
2014-12-31 21:42:21 +00:00
[ 94%] Built target kiibohd.elf
2014-04-10 04:06:57 +00:00
Scanning dependencies of target SizeAfter
2014-12-31 21:42:21 +00:00
[100%] Chip usage for mk20dx128vlf5
SRAM: 32% 5384/16384 bytes
Flash: 18% 23296/126976 bytes
2014-04-10 04:06:57 +00:00
[100%] Built target SizeAfter
2014-12-31 23:58:28 +00:00
2014-12-31 21:42:21 +00:00
NOTES:
If you get the following error, you have not setup wincmake correctly:
$ make
[ 5%] Generating KLL Layout
Scanning dependencies of target kiibohd.elf
[ 11%] Building C object CMakeFiles/kiibohd.elf.dir/main.c.o
../main.c:28:19: fatal error: macro.h: No such file or directory
#include <macro.h>
^
compilation terminated.
CMakeFiles/kiibohd.elf.dir/build.make:67: recipe for target 'CMakeFiles/kiibohd.elf.dir/main.c.o' failed
make[2]: *** [CMakeFiles/kiibohd.elf.dir/main.c.o] Error 1
CMakeFiles/Makefile2:98: recipe for target 'CMakeFiles/kiibohd.elf.dir/all' failed
make[1]: *** [CMakeFiles/kiibohd.elf.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2
If you have already added the line to your ~/.bashrc try restarting your cygwin shell.
2014-04-10 04:06:57 +00:00
2013-10-05 20:53:06 +00:00
----------------------
Windows Loading Firmware
----------------------
2014-05-27 05:46:03 +00:00
First place the keyboard into re-flash mode.
This can be done either by pressing the re-flash button on the PCB/Teensy.
Or by entering the Kiibohd Virtual Serial Interface and using the 'reload' command.
The 'load' script that is created during the build can load the firmware over USB.
To load the newly built firmware:
./load
Be patient the couple of times, Windows is slow at installing drivers...
2013-10-05 20:53:06 +00:00
----------------------
Mac OS X Building
----------------------
2014-09-16 03:19:40 +00:00
From this directory.
mkdir build
cd build
cmake ..
make
Example output:
2013-10-05 20:53:06 +00:00
TODO
2014-05-27 05:46:03 +00:00
2013-10-05 20:53:06 +00:00
----------------------
Mac OS X Loading Firmware
----------------------
2014-09-16 03:19:40 +00:00
First place the keyboard into re-flash mode.
This can be done either by pressing the re-flash button on the PCB/Teensy.
Or by entering the Kiibohd Virtual Serial Port and using the 'reload' command.
The 'load' script that is created during the build can load the firmware over USB.
To load the newly built firmware:
./load
2013-10-05 20:53:06 +00:00
2014-05-27 05:46:03 +00:00
2013-10-05 20:53:06 +00:00
----------------------
2014-04-10 04:06:57 +00:00
Virtual Serial Port - CLI
2013-10-05 20:53:06 +00:00
----------------------
2014-04-10 04:06:57 +00:00
Rather than use a special program that can interpret Raw HID, this controller exposes a USB Serial CDC endpoint.
This allows for you to use a generic serial terminal to debug/control the keyboard firmware (e.g. Tera Term, minicom, screen)
2014-05-27 05:46:03 +00:00
2014-04-10 04:06:57 +00:00
-------
| Linux |
-------
I generally use screen.
2014-06-07 16:13:57 +00:00
You will need sudo/root priviledges if you haven't installed the 98-kiibohd.rules file to /etc/udev/rules.d
2014-04-10 04:06:57 +00:00
2014-05-27 05:46:03 +00:00
screen /dev/ttyACM0
(Might be ACM1, ACM2, etc.)
2014-04-10 04:06:57 +00:00
---------
| Windows |
---------
2014-05-27 05:46:03 +00:00
Make sure the Teensy Virtual Serial Port driver is installed.
If possible use screen (as part of Cygwin).
2014-09-16 03:19:40 +00:00
Check which COM port the virtual serial port has been assigned to:
Device Manager->Ports (COM & LPT)->Teensy USB Serial
In brackets it will say which COM port (e.g. COM3)
putty works well when using DTR/DSR or RTS/CTS flow control.
Connection type: Serial
Serial line: <Your COM port, e.g. COM3>
Speed: (doesn't matter, it's auto-negotiated)
2014-05-27 05:46:03 +00:00
2014-09-16 03:19:40 +00:00
Under Category->Connections->Serial
Flow control: DTR/DSR
If stuff is hard to read (you have a dumb colour scheme):
Category->Window->Colours->Use system colur
That seems to make text at least readable (I use a custom colour scheme that makes each colour easy to see -HaaTa).
Unfortunately, screen for Cygwin seems to be broken for serial ports, but you can try it...
screen /dev/ttyS2
2014-05-27 05:46:03 +00:00
(Might be a different file, ttyS0, ttyACM0, ttyUSB0, etc.)
2014-04-10 04:06:57 +00:00
2014-05-27 06:06:51 +00:00
Gnu screen doesn't seem to echo all the characters (it works though).
I believe it's a problem with stty, but I don't know how to fix it...
2014-04-10 04:06:57 +00:00
----------
| Mac OS X |
----------
2013-10-05 20:53:06 +00:00
2014-09-16 03:19:40 +00:00
I recommend screen (can be installed via Macports).
screen /dev/tty.<usb something>
2014-12-31 21:42:21 +00:00