Browse Source

core: Fix doc/build.md

tags/v2.9
tmk 8 years ago
parent
commit
0851cf926f
1 changed files with 18 additions and 18 deletions
  1. 18
    18
      tmk_core/doc/build.md

+ 18
- 18
tmk_core/doc/build.md View File



2. **Programmer** Install [dfu-programmer][dfu-prog]. GUI tool [Atmel FLIP][flip] also can be used on Windows. 2. **Programmer** Install [dfu-programmer][dfu-prog]. GUI tool [Atmel FLIP][flip] also can be used on Windows.


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.
3. **Driver** On Windows when 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 will 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` install driver distributed with it.


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].




- <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. 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.
Open terminal window to get access to commands. Use Cygwin(or MingGW) shell terminal in Windows or `Terminal.app` on Mac OSX.


### 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> dfu $ make -f Makefile.<variant> dfu


#### FLIP GUI tutorial #### FLIP GUI tutorial
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.
1. On menu bar click **Device** -> **Select**, then choose your chip name. (In most case **ATmega32U2** or **ATmega32U4**)
2. On menu bar click **Settings** -> **Communication** -> **USB**, then click **Open** button on **USB Port Connection** dialog. At this point you'll have to plug into USB and start bootloader.


3. On menu bar click File -> Load HEX File, then select your firmware hex file on File Selector dialog.
4. On 'Operations Flow' panel click 'Run' button to load the firmware binary to the chip. Note that you should keep 'Erase', 'Blank Check', 'Program' and 'Verify' check boxes selected.
5. Re-plug USB cord or click 'Start Application' button to restart your controller.
3. On menu bar click **File** -> **Load HEX File**, then select your firmware hex file on File Selector dialog.
4. On **Operations Flow** panel click **Run** button to load the firmware binary to the chip. Note that you should keep **Erase**, **Blank Check**, **Program** and **Verify** check boxes selected.
5. Re-plug USB cord or click **Start Application** button to restart your controller.
Done. Done.


See also these instructions if you need.
See also these instructions if needed.


- <http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP> - <http://code.google.com/p/micropendous/wiki/LoadingFirmwareWithFLIP>
- <http://www.atmel.com/Images/doc7769.pdf> - <http://www.atmel.com/Images/doc7769.pdf>




### 3. Program with Teensy Loader
If you have PJRC Teensy see instruction of `Teensy Loader`.
##### Troubleshoot
* **FLIP: AtLibUsbDfu.dll not found**
Remove current driver and re-install one FLIP provides from DeviceManager of WIndows. See <http://imgur.com/a/bnwzy>


- <http://www.pjrc.com/teensy/loader.html>


Or use this command if you have command line version of Teensy Loader installed.
### 3. Program with Other programmer
If you are using PJRC Teensy consult with instruction of [Teensy Loader][teensy-loader]. Or run this target with `make` after you install command line version of it.


$ make -f Makefile.<variant> teensy $ make -f Makefile.<variant> teensy



### 4. Program with Other programmer
You may want to use other programmer like `avrdude` with AVRISPmkII, Arduino or USBasp. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile.
You may want to use other programmer like [`avrdude`][avrdude]. In that case you can still use make target `program` for build with configuring `PROGRAM_CMD` in Makefile. See below.


$ make -f Makefile.<variant> program $ make -f Makefile.<variant> program


[flip]: http://www.atmel.com/tools/FLIP.aspx [flip]: http://www.atmel.com/tools/FLIP.aspx
[dfu-prog]: http://dfu-programmer.sourceforge.net/ [dfu-prog]: http://dfu-programmer.sourceforge.net/
[teensy-loader]:http://www.pjrc.com/teensy/loader.html [teensy-loader]:http://www.pjrc.com/teensy/loader.html
[avrdude]: http://savannah.nongnu.org/projects/avrdude/








# Boot Section Size in *bytes* # Boot Section Size in *bytes*
# Teensy halfKay 512 # Teensy halfKay 512
# Teensy++ halfKay 2048
# Atmel DFU loader 4096 # Atmel DFU loader 4096
# LUFA bootloader 4096 # LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096 OPT_DEFS += -DBOOTLOADER_SIZE=4096
#BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality #BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality


### 3. Programmer ### 3. Programmer
Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`. Not needed if you use `FLIP`, `dfu-programmer` or `Teensy Loader`.
Optional. Set proper command for your controller, bootloader and programmer. This command can be used with `make program`.


# avrdude with AVRISPmkII # avrdude with AVRISPmkII
PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex PROGRAM_CMD = avrdude -p $(MCU) -c avrispmkII -P USB -U flash:w:$(TARGET).hex

Loading…
Cancel
Save