aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2020-07-10 13:15:37 +1000
committerfauxpark <fauxpark@gmail.com>2020-09-19 05:21:29 +1000
commita21e487fbc8bf81d66f32224477f0db52b34a3f3 (patch)
treea5a3e0dca35344e279bc556d399cc4507000423e
parentf079dd90ed88fd29b7e5bbdd3496742f3afeff4e (diff)
downloadqmk_firmware-a21e487fbc8bf81d66f32224477f0db52b34a3f3.tar.gz
qmk_firmware-a21e487fbc8bf81d66f32224477f0db52b34a3f3.zip
Consolidate udev rules into a single file
-rw-r--r--docs/faq_build.md123
1 files changed, 43 insertions, 80 deletions
diff --git a/docs/faq_build.md b/docs/faq_build.md
index e2d0f9b27..990ebe3af 100644
--- a/docs/faq_build.md
+++ b/docs/faq_build.md
@@ -13,63 +13,66 @@ An example of using `sudo`, when your controller is ATMega32u4:
13 13
14or just: 14or just:
15 15
16 $ sudo make <keyboard>:<keymap>:dfu 16 $ sudo make <keyboard>:<keymap>:flash
17 17
18Note that running `make` with `sudo` is generally ***not*** a good idea, and you should use one of the former methods, if possible. 18Note 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
21On 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
24sudo udevadm control --reload-rules
25sudo udevadm trigger
26```
27 21
28**/etc/udev/rules.d/50-atmel-dfu.rules:** 22On 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:**
31SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess", RUN{builtin}+="uaccess"
32# Atmel USBKEY AT90USB1287
33SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess", RUN{builtin}+="uaccess"
34# Atmel ATMega32U2
35SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess", RUN{builtin}+="uaccess"
36``` 25```
26# Atmel DFU
27# ATmega16U2
28SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FEF", TAG+="uaccess", RUN{builtin}+="uaccess"
29# ATmega32U2
30SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF0", TAG+="uaccess", RUN{builtin}+="uaccess"
31# ATmega16U4
32SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF3", TAG+="uaccess", RUN{builtin}+="uaccess"
33# ATmega32U4
34SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF4", TAG+="uaccess", RUN{builtin}+="uaccess"
35# AT90USB128
36SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF9", TAG+="uaccess", RUN{builtin}+="uaccess"
37# AT90USB128
38SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FFB", TAG+="uaccess", RUN{builtin}+="uaccess"
37 39
38**/etc/udev/rules.d/54-input-club-keyboard.rules:** 40# Input Club
41SUBSYSTEMS=="usb", ATTRS{idVendor}=="1C11", ATTRS{idProduct}=="B007", TAG+="uaccess", RUN{builtin}+="uaccess"
39 42
40``` 43# STM32duino
41# Input Club keyboard bootloader 44SUBSYSTEMS=="usb", ATTRS{idVendor}=="1EAF", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess"
42SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess", RUN{builtin}+="uaccess" 45# STM32 DFU
43``` 46SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="DF11", TAG+="uaccess", RUN{builtin}+="uaccess"
47
48# BootloadHID
49SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DF", TAG+="uaccess", RUN{builtin}+="uaccess"
50
51# USBAspLoader
52SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DC", TAG+="uaccess", RUN{builtin}+="uaccess"
44 53
45**/etc/udev/rules.d/55-caterina.rules:**
46```
47# ModemManager should ignore the following devices 54# ModemManager should ignore the following devices
48SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" 55# Atmel SAM-BA (Massdrop)
49SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" 56SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB" ATTRS{idProduct}=="6124" TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
50SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" 57# Caterina
51SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" 58SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03" TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
59SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341" TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
60SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F" TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
52``` 61```
53 62
54**Note:** With older (before 1.12) ModemManager, filtering only works when not in strict mode, the following commands can update that settings: 63Once added, run the following:
55```console
56printf '[Service]\nExecStart=\nExecStart=/usr/sbin/ModemManager --filter-policy=default' | sudo tee /etc/systemd/system/ModemManager.service.d/policy.conf
57sudo systemctl daemon-reload
58sudo systemctl restart ModemManager
59```
60 64
61**/etc/udev/rules.d/56-dfu-util.rules:**
62``` 65```
63# stm32duino 66sudo udevadm control --reload-rules
64SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess" 67sudo udevadm trigger
65# Generic stm32
66SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess", RUN{builtin}+="uaccess"
67``` 68```
68 69
69**/etc/udev/rules.d/57-bootloadhid.rules:** 70**Note:** With older versions of ModemManager (< 1.12), filtering only works when not in strict mode. The following commands can update that setting:
71
70``` 72```
71# bootloadHID 73printf '[Service]\nExecStart=\nExecStart=/usr/sbin/ModemManager --filter-policy=default' | sudo tee /etc/systemd/system/ModemManager.service.d/policy.conf
72SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess", RUN{builtin}+="uaccess" 74sudo systemctl daemon-reload
75sudo systemctl restart ModemManager
73``` 76```
74 77
75### Serial device is not detected in bootloader mode on Linux 78### Serial device is not detected in bootloader mode on Linux
@@ -96,46 +99,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 99- 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 100- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
98 101
99## BOOTLOADER_SIZE for AVR
100Note 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
109OPT_DEFS += -DBOOTLOADER_SIZE=2048
110```
111
112## `avr-gcc: internal compiler error: Abort trap: 6 (program cc1)` on MacOS
113
114This is an issue with updating on brew, causing symlinks that avr-gcc depend on getting mangled.
115
116The solution is to remove and reinstall all affected modules.
117
118```
119brew rm avr-gcc avr-gcc@8 dfu-programmer dfu-util gcc-arm-none-eabi arm-gcc-bin@8 avrdude qmk
120brew install qmk/qmk/qmk
121brew link --force avr-gcc@8
122brew link --force arm-gcc-bin@8
123```
124
125### `avr-gcc` and LUFA
126
127If 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
131For now, you need to rollback `avr-gcc` to 8 in Homebrew.
132
133```
134brew uninstall --force avr-gcc
135brew install avr-gcc@8
136brew 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) 102### 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)
140Due 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. 103Due 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 104