LoginSignup
0
0

キーボード自作キット (Lily58 Pro)

Posted at

Lily58 Proとは

ビルドガイド:https://kata0510.github.io/Lily58-Document/Lily58_Pro_BG/
ファームウェアとしてQMKを使用している。

raspiでファームウェアを書き込む

必要なもの

  • raspberry pi
  • ジャンパー線
  • ブレッドボード

avrdudeをインストールする

% sudo vi /etc/avrdude.conf

GPIOを結線する

Ground, Reset, SCK, MISO, MOSI, VCCを繋ぎます。

ProMicroと繋ぐテスト

% avrdude -c linuxgpio -p atmega32u4 -v

ファームウェアを書き込む

% avrdude -c linuxgpio -p atmega32u4 -U flash:w:<hex>

Caterina-Leonardo.hexを書き込みました。

remapでファームウェアを書き込む

トラブル: デバイスを認識しない

Raspberry PIのGPIO経由でhexを書き込んだところ、2台のProMicroのうち1台はHIDデバイスとして認識されるようになりました。

正常ログ

/var/log/kern.log
Jul  5 21:25:05 raspberrypi kernel: [ 9031.081979] usb 1-1.1.3: new full-speed USB device number 93 using dwc_otg
Jul  5 21:25:05 raspberrypi kernel: [ 9031.195228] usb 1-1.1.3: New USB device found, idVendor=04d8, idProduct=eb2d, bcdDevice= 1.00
Jul  5 21:25:05 raspberrypi kernel: [ 9031.195294] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jul  5 21:25:05 raspberrypi kernel: [ 9031.195317] usb 1-1.1.3: Product: Lily58
Jul  5 21:25:05 raspberrypi kernel: [ 9031.195336] usb 1-1.1.3: Manufacturer: liliums
Jul  5 21:25:05 raspberrypi kernel: [ 9031.208342] input: liliums Lily58 as /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0/0003:04D8:EB2D.0011/input/input37
Jul  5 21:25:05 raspberrypi kernel: [ 9031.272813] hid-generic 0003:04D8:EB2D.0011: input,hidraw2: USB HID v1.11 Keyboard [liliums Lily58] on usb-3f980000.usb-1.1.3/input0
Jul  5 21:25:14 raspberrypi kernel: [ 9040.914392] usb 1-1.1.3: USB disconnect, device number 93

エラーログ

/var/log/kern.log
Jul  5 21:25:33 raspberrypi kernel: [ 9059.246235] usb 1-1.1.3: new full-speed USB device number 94 using dwc_otg
Jul  5 21:25:33 raspberrypi kernel: [ 9059.352662] usb 1-1.1.3: unable to read config index 0 descriptor/all
Jul  5 21:25:33 raspberrypi kernel: [ 9059.352694] usb 1-1.1.3: can't read configurations, error -32
Jul  5 21:25:33 raspberrypi kernel: [ 9059.430212] usb 1-1.1.3: new full-speed USB device number 95 using dwc_otg
Jul  5 21:25:33 raspberrypi kernel: [ 9059.531408] usb 1-1.1.3: device descriptor read/all, error -32
Jul  5 21:25:33 raspberrypi kernel: [ 9059.531508] usb 1-1.1-port3: attempt power cycle
Jul  5 21:25:34 raspberrypi kernel: [ 9060.134140] usb 1-1.1.3: new full-speed USB device number 96 using dwc_otg
Jul  5 21:25:44 raspberrypi kernel: [ 9070.818218] usb 1-1.1.3: device not accepting address 96, error -110
Jul  5 21:25:44 raspberrypi kernel: [ 9070.898293] usb 1-1.1.3: new full-speed USB device number 97 using dwc_otg
Jul  5 21:25:44 raspberrypi kernel: [ 9070.932917] usb 1-1.1.3: New USB device found, idVendor=04d8, idProduct=eb2d, bcdDevice= 1.00
Jul  5 21:25:44 raspberrypi kernel: [ 9070.932943] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Jul  5 21:25:44 raspberrypi kernel: [ 9070.932953] usb 1-1.1.3: Product: Lily58
Jul  5 21:25:44 raspberrypi kernel: [ 9070.932962] usb 1-1.1.3: Manufacturer: liliums
Jul  5 21:25:44 raspberrypi kernel: [ 9070.936091] usbhid 1-1.1.3:1.0: can't add hid device: -32
Jul  5 21:25:44 raspberrypi kernel: [ 9070.936175] usbhid: probe of 1-1.1.3:1.0 failed with error -32
Jul  5 21:25:55 raspberrypi kernel: [ 9081.044318] usb 1-1.1.3: USB disconnect, device number 97

結局この一台は不良品ということで購入元に交換の対応をしていただき、問題は解決しました。

キットとはいえ、自作なのでこういったリスクはあるということだと思います。何か起きたときのために自分で問題を調査するスキルや覚悟はある程度必要だと思います。

QMKとは何か

QMK = Quantum Mechanical Keyboard
入力装置に関するオープンソースのコミュニティである。
QMK Firmware, QMK Configurator, QMK Toolboxをメンテしている。

ProMicro

プロセッサとしてATmega32U4を搭載するボード。
元々はArduino Leonardoの互換機としてSparkFunが開発したものらしい (https://www.sparkfun.com/products/12640)

Bootloader

オリジナルのArduino Leonardoのブートローダーは、Caterinaと呼ばれるもので、リセットをすると直後の8秒間はブートローダーモードとなり、その8秒後にユーザーコードの実行に遷移する。

しかし、これではユーザーコードの開発に支障があることから、SparkFunのCaterinaは、リセットスイッチをダブルタップしたときだけ、ブートローダーモード(その8秒後にユーザーコードの実行)となる。リセットスイッチのシングルタップはブートローダーモードをスキップし(正確には750ms程度走り)、ユーザーコードの実行となる。(Firmware Note)

参考

ATmega16U4,ATmega32U4:https://avr.jp/user/DS/PDF/mega16U4.pdf

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0