Browse Source

Fix READEM of hhkb and doc/build.md

core
tmk 10 years ago
parent
commit
d4e92b43e0
1 changed files with 15 additions and 9 deletions
  1. 15
    9
      doc/build.md

+ 15
- 9
doc/build.md View File

Download and Install Download and Install
-------------------- --------------------
### 1. Install Tools ### 1. Install Tools
First, you need tools to build firmware and program your controller. I assume you are on Windows here.


1. **Toolchain** Install [WinAVR][winavr]. This is old but works well for this purpose. `WinAVR` is a tool set to build firmware including C compiler(gcc) and make commands. You can use [CrossPack][crosspack] instead if you are on Mac.
1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC with your favorite package manager.


2. **Programmer** Install [Atmel FLIP][flip]. `FLIP` is a tool to program(load) firmware into AVR controller via DFU bootloader. AVR USB chips including ATmega32U4 has DFU bootloader by factory default. You can also use [dfu-programmer][dfu-prog] instead if you are on Mac or Linux.
2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog].


3. **Driver** At first time you start DFU bootloader on Chip 'Found New Hardware Wizard' will come up on Windows. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. If you use `dfu-programmer` install its driver.
3. **Driver** On Windows you start DFU bootloader on the chip first time you will see 'Found New Hardware Wizard' to install driver. If you install device driver properly you can find chip name like 'ATmega32U4' under 'LibUSB-Win32 Devices' tree on 'Device Manager'. If not you shall need to update its driver on 'Device Manager'. You will find the driver in `FLIP` install directory like: C:\Program Files (x86)\Atmel\Flip 3.4.5\usb\. In case of `dfu-programmer` use its driver.


If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader]. If you use PJRC Teensy you don't need step 2 and 3 above, just get [Teensy loader][teensy-loader].




### 2. Download source ### 2. Download source
You can find firmware source at github:
You can find firmware source at github:


- <https://github.com/tmk/tmk_keyboard> - <https://github.com/tmk/tmk_keyboard>


If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:
If you are familiar with `Git` tools you are recommended to use it but you can also download zip archive from:


- <https://github.com/tmk/tmk_keyboard/archive/master.zip> - <https://github.com/tmk/tmk_keyboard/archive/master.zip>


Build firmware Build firmware
-------------- --------------
### 1. Open terminal ### 1. Open terminal
Open terminal window to get access to commands. You can use `cmd` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.
Open terminal window to get access to commands. Use Cygwin(or MingGW) `shell terminal` in Windows or `Terminal.app` on Mac OSX. In Windows press `Windows` key and `R` then enter `cmd` in 'Run command' dialog showing up.


### 2. Change directory ### 2. Change directory
Move to project directory in the firmware source. Move to project directory in the firmware source.
$ make -f Makefile.<variant> program $ make -f Makefile.<variant> program




[cygwin]: https://www.cygwin.com/
[mingw]: http://www.mingw.org/
[mhv]: https://infernoembedded.com/products/avr-tools
[winavr]: http://winavr.sourceforge.net/ [winavr]: http://winavr.sourceforge.net/
[crosspack]: http://www.obdev.at/products/crosspack/index.html [crosspack]: http://www.obdev.at/products/crosspack/index.html
[flip]: http://www.atmel.com/tools/FLIP.aspx [flip]: http://www.atmel.com/tools/FLIP.aspx
#MCU = at90usb1286 # Teensy++ 2.0 #MCU = at90usb1286 # Teensy++ 2.0
F_CPU = 16000000 F_CPU = 16000000


Set your MCU and its clock in Hz.

# Boot Section Size in *bytes* # Boot Section Size in *bytes*
# Teensy halfKay 512 # Teensy halfKay 512
# Atmel DFU loader 4096 # Atmel DFU loader 4096
# LUFA bootloader 4096 # LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096


If you are using PJRC Teensy use `512` for `BOOTLOADER_SIZE`, otherwise use `4096` unless you are sure.

### 2. Features ### 2. Features
Optional. Note that ***comment out*** to disable them.
Optional. Note that ***comment out*** with `#` to disable them.


BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
---------------- ----------------
### 1. Magic command key combination ### 1. Magic command key combination


#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)))
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KB_LSHIFT) | MOD_BIT(KB_RSHIFT)))


### 2. Mechanical Locking Support for CapsLock ### 2. Mechanical Locking Support for CapsLock