]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - doc/build.md
core: Update doc/build.md and remove other_projects.md
[max/tmk_keyboard.git] / doc / build.md
index bfe5de9fd487928afb10aefd962cb92c7232efa2..beff191b8c62bec6ad409790b55aca649260c97a 100644 (file)
@@ -5,23 +5,22 @@ Build Firmware and Program Controller
 Download and Install
 --------------------
 ### 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 [Atmel AVR Toolchain][atmelgcc] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack] or your favorite package manager. 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** Install [dfu-programmer][dfu-prog]. GUI tool [Atmel FLIP][flip] also can be used on Windows.
 
-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].
 
 
 ### 2. Download source
-You can find firmware source at github: 
+You can find firmware source at github:
 
 - <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>
 
@@ -29,7 +28,7 @@ If you are familiar with `Git` tools you are recommended to use it but you can a
 Build firmware
 --------------
 ### 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
 Move to project directory in the firmware source.
@@ -54,7 +53,7 @@ Now you have **hex** file to program on current directory. This **hex** is only
 How to program controller depends on controller chip and its board design. To program AVR USB chips you'll need to start it up in bootloader mode. Most of boards with the chip have a push button to let bootloader come up. Consult with your controller board manual.
 
 ### 2. Program with DFU bootloader
-Stock AVR USB chip including ATmega32U4 has DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. Open source command line tool `dfu-programmer` also supports AVR chips, it runs on Linux, Mac OSX and even Windows.
+Stock AVR USB chips have DFU bootloader by factory default. `FLIP` is a DFU programmer on Windows offered by Atmel. Open source command line tool `dfu-programmer` also supports AVR chips, it runs on Linux, Mac OSX and even Windows.
 
 To program AVR chip with DFU bootloader use `FLIP` or `dfu-programmer`.
 If you have a proper program command in `Makefile` just type this.
@@ -69,7 +68,7 @@ Or to program with `dfu-programmer` run:
     $ make -f Makefile.<variant> dfu
 
 #### FLIP GUI tutorial
-1. On menu bar click Device -> Select, then. `ATmega32u4`.
+1. On menu bar click Device -> Select, then choose your chip name.
 2. On menu bar click Settings -> Communication -> USB, then click 'Open' button on 'USB Port Connection' dialog.
 At this point you'll see grey-outed widgets on the app get colored and ready.
 
@@ -100,7 +99,9 @@ You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or
     $ make -f Makefile.<variant> program
 
 
-[winavr]:       http://winavr.sourceforge.net/
+[atmelgcc]:     http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx
+[cygwin]:       https://www.cygwin.com/
+[mingw]:        http://www.mingw.org/
 [crosspack]:    http://www.obdev.at/products/crosspack/index.html
 [flip]:         http://www.atmel.com/tools/FLIP.aspx
 [dfu-prog]:     http://dfu-programmer.sourceforge.net/
@@ -116,14 +117,18 @@ Makefile Options
     #MCU = at90usb1286      # Teensy++ 2.0
     F_CPU = 16000000
 
+Set your MCU and its clock in Hz.
+
     # Boot Section Size in *bytes*
     #   Teensy halfKay   512
     #   Atmel DFU loader 4096
     #   LUFA bootloader  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
-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)
     MOUSEKEY_ENABLE = yes       # Mouse keys(+4700)
@@ -152,7 +157,7 @@ Config.h Options
 ----------------
 ### 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