diff options
Diffstat (limited to 'docs/faq_build.md')
| -rw-r--r-- | docs/faq_build.md | 135 |
1 files changed, 53 insertions, 82 deletions
diff --git a/docs/faq_build.md b/docs/faq_build.md index e2d0f9b27..131844a2b 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md | |||
| @@ -13,63 +13,74 @@ An example of using `sudo`, when your controller is ATMega32u4: | |||
| 13 | 13 | ||
| 14 | or just: | 14 | or just: |
| 15 | 15 | ||
| 16 | $ sudo make <keyboard>:<keymap>:dfu | 16 | $ sudo make <keyboard>:<keymap>:flash |
| 17 | 17 | ||
| 18 | Note that running `make` with `sudo` is generally ***not*** a good idea, and you should use one of the former methods, if possible. | 18 | Note that running `make` with `sudo` is generally ***not*** a good idea, and you should use one of the former methods, if possible. |
| 19 | 19 | ||
| 20 | ### Linux `udev` Rules | 20 | ### Linux `udev` Rules |
| 21 | On Linux, you'll need proper privileges to access the MCU. You can either use | ||
| 22 | `sudo` when flashing firmware, or place these files in `/etc/udev/rules.d/`. Once added run the following: | ||
| 23 | ```console | ||
| 24 | sudo udevadm control --reload-rules | ||
| 25 | sudo udevadm trigger | ||
| 26 | ``` | ||
| 27 | 21 | ||
| 28 | **/etc/udev/rules.d/50-atmel-dfu.rules:** | 22 | On Linux, you'll need proper privileges to communicate with the bootloader device. You can either use `sudo` when flashing firmware, or place this file in `/etc/udev/rules.d/`: |
| 29 | ``` | 23 | |
| 30 | # Atmel ATMega32U4 | 24 | **/etc/udev/rules.d/50-qmk.rules:** |
| 31 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess", RUN{builtin}+="uaccess" | ||
| 32 | # Atmel USBKEY AT90USB1287 | ||
| 33 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess", RUN{builtin}+="uaccess" | ||
| 34 | # Atmel ATMega32U2 | ||
| 35 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess", RUN{builtin}+="uaccess" | ||
| 36 | ``` | 25 | ``` |
| 26 | # Atmel DFU | ||
| 27 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FEF", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega16U2 | ||
| 28 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF0", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega32U2 | ||
| 29 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF3", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega16U4 | ||
| 30 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF4", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega32U4 | ||
| 31 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF9", TAG+="uaccess", RUN{builtin}+="uaccess" # AT90USB64 | ||
| 32 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FFB", TAG+="uaccess", RUN{builtin}+="uaccess" # AT90USB128 | ||
| 37 | 33 | ||
| 38 | **/etc/udev/rules.d/54-input-club-keyboard.rules:** | 34 | # Input Club |
| 35 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1C11", ATTRS{idProduct}=="B007", TAG+="uaccess", RUN{builtin}+="uaccess" | ||
| 39 | 36 | ||
| 40 | ``` | 37 | # STM32duino |
| 41 | # Input Club keyboard bootloader | 38 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1EAF", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess" |
| 42 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess", RUN{builtin}+="uaccess" | 39 | # STM32 DFU |
| 43 | ``` | 40 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="DF11", TAG+="uaccess", RUN{builtin}+="uaccess" |
| 44 | 41 | ||
| 45 | **/etc/udev/rules.d/55-caterina.rules:** | 42 | # BootloadHID |
| 46 | ``` | 43 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DF", TAG+="uaccess", RUN{builtin}+="uaccess" |
| 47 | # ModemManager should ignore the following devices | ||
| 48 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" | ||
| 49 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" | ||
| 50 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" | ||
| 51 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" | ||
| 52 | ``` | ||
| 53 | 44 | ||
| 54 | **Note:** With older (before 1.12) ModemManager, filtering only works when not in strict mode, the following commands can update that settings: | 45 | # USBAspLoader |
| 55 | ```console | 46 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DC", TAG+="uaccess", RUN{builtin}+="uaccess" |
| 56 | printf '[Service]\nExecStart=\nExecStart=/usr/sbin/ModemManager --filter-policy=default' | sudo tee /etc/systemd/system/ModemManager.service.d/policy.conf | 47 | |
| 57 | sudo systemctl daemon-reload | 48 | # ModemManager should ignore the following devices |
| 58 | sudo systemctl restart ModemManager | 49 | # Atmel SAM-BA (Massdrop) |
| 59 | ``` | 50 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="6124", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" |
| 51 | |||
| 52 | # Caterina (Pro Micro) | ||
| 53 | # Spark Fun Electronics | ||
| 54 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9203", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Pro Micro 3V3/8MHz | ||
| 55 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9205", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Pro Micro 5V/16MHz | ||
| 56 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9207", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # LilyPad 3V3/8MHz (and some Pro Micro clones) | ||
| 57 | # Pololu Electronics | ||
| 58 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1FFB", ATTRS{idProduct}=="0101", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # A-Star 32U4 | ||
| 59 | # Arduino SA | ||
| 60 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Leonardo | ||
| 61 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Micro | ||
| 62 | # Adafruit Industries LLC | ||
| 63 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000C", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Feather 32U4 | ||
| 64 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000D", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # ItsyBitsy 32U4 3V3/8MHz | ||
| 65 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000E", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # ItsyBitsy 32U4 5V/16MHz | ||
| 66 | # dog hunter AG | ||
| 67 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Leonardo | ||
| 68 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03", ATTRS{idProduct}=="0037", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Micro | ||
| 69 | ``` | ||
| 70 | |||
| 71 | Once added, run the following: | ||
| 60 | 72 | ||
| 61 | **/etc/udev/rules.d/56-dfu-util.rules:** | ||
| 62 | ``` | 73 | ``` |
| 63 | # stm32duino | 74 | sudo udevadm control --reload-rules |
| 64 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess" | 75 | sudo udevadm trigger |
| 65 | # Generic stm32 | ||
| 66 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess", RUN{builtin}+="uaccess" | ||
| 67 | ``` | 76 | ``` |
| 68 | 77 | ||
| 69 | **/etc/udev/rules.d/57-bootloadhid.rules:** | 78 | **Note:** With older versions of ModemManager (< 1.12), filtering only works when not in strict mode. The following commands can update that setting: |
| 79 | |||
| 70 | ``` | 80 | ``` |
| 71 | # bootloadHID | 81 | printf '[Service]\nExecStart=\nExecStart=/usr/sbin/ModemManager --filter-policy=default' | sudo tee /etc/systemd/system/ModemManager.service.d/policy.conf |
| 72 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess", RUN{builtin}+="uaccess" | 82 | sudo systemctl daemon-reload |
| 83 | sudo systemctl restart ModemManager | ||
| 73 | ``` | 84 | ``` |
| 74 | 85 | ||
| 75 | ### Serial device is not detected in bootloader mode on Linux | 86 | ### Serial device is not detected in bootloader mode on Linux |
| @@ -96,46 +107,6 @@ You can buy a really unique VID:PID here. I don't think you need this for person | |||
| 96 | - http://www.obdev.at/products/vusb/license.html | 107 | - http://www.obdev.at/products/vusb/license.html |
| 97 | - http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1 | 108 | - http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1 |
| 98 | 109 | ||
| 99 | ## BOOTLOADER_SIZE for AVR | ||
| 100 | Note that Teensy2.0++ bootloader size is 2048byte. Some Makefiles may have wrong comment. | ||
| 101 | |||
| 102 | ``` | ||
| 103 | # Boot Section Size in *bytes* | ||
| 104 | # Teensy halfKay 512 | ||
| 105 | # Teensy++ halfKay 2048 | ||
| 106 | # Atmel DFU loader 4096 (TMK Alt Controller) | ||
| 107 | # LUFA bootloader 4096 | ||
| 108 | # USBaspLoader 2048 | ||
| 109 | OPT_DEFS += -DBOOTLOADER_SIZE=2048 | ||
| 110 | ``` | ||
| 111 | |||
| 112 | ## `avr-gcc: internal compiler error: Abort trap: 6 (program cc1)` on MacOS | ||
| 113 | |||
| 114 | This is an issue with updating on brew, causing symlinks that avr-gcc depend on getting mangled. | ||
| 115 | |||
| 116 | The solution is to remove and reinstall all affected modules. | ||
| 117 | |||
| 118 | ``` | ||
| 119 | brew rm avr-gcc avr-gcc@8 dfu-programmer dfu-util gcc-arm-none-eabi arm-gcc-bin@8 avrdude qmk | ||
| 120 | brew install qmk/qmk/qmk | ||
| 121 | brew link --force avr-gcc@8 | ||
| 122 | brew link --force arm-gcc-bin@8 | ||
| 123 | ``` | ||
| 124 | |||
| 125 | ### `avr-gcc` and LUFA | ||
| 126 | |||
| 127 | If you updated your `avr-gcc` and you see errors involving LUFA, for example: | ||
| 128 | |||
| 129 | `lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h:380:5: error: 'const' attribute on function returning 'void'` | ||
| 130 | |||
| 131 | For now, you need to rollback `avr-gcc` to 8 in Homebrew. | ||
| 132 | |||
| 133 | ``` | ||
| 134 | brew uninstall --force avr-gcc | ||
| 135 | brew install avr-gcc@8 | ||
| 136 | brew link --force avr-gcc@8 | ||
| 137 | ``` | ||
| 138 | |||
| 139 | ### I just flashed my keyboard and it does nothing/keypresses don't register - it's also ARM (rev6 planck, clueboard 60, hs60v2, etc...) (Feb 2019) | 110 | ### I just flashed my keyboard and it does nothing/keypresses don't register - it's also ARM (rev6 planck, clueboard 60, hs60v2, etc...) (Feb 2019) |
| 140 | Due to how EEPROM works on ARM based chips, saved settings may no longer be valid. This affects the default layers, and *may*, under certain circumstances we are still figuring out, make the keyboard unusable. Resetting the EEPROM will correct this. | 111 | Due to how EEPROM works on ARM based chips, saved settings may no longer be valid. This affects the default layers, and *may*, under certain circumstances we are still figuring out, make the keyboard unusable. Resetting the EEPROM will correct this. |
| 141 | 112 | ||
