Arduinoのブートローダを書き込む

前置き

Arduinoブートローダを書き換えてしまって、PCのシリアルポートに表示されなくなってしまった。

ブートローダについてはこの記事を読んだ。

環境

手順

1. Arduino UnoにArduinoISPを書き込む

「ファイル」→「スケッチ例」→「11. ArduinoISP」→「ArduinoISP」を書き込む

2. Arduino UnoとPro Microを配線する

これを参考にさせていただきました。

Arduino Uno <-> Pro Micro
    GND     <->    GND
    13      <->    15
    12      <->    14
    11      <->    16
    10      <->    RST
    5V      <->    VCC

Arduino Uno側のRESETとGND間にキャパシタを付けたほうが良いらしいけどなくでも大丈夫だった。

3. ブートローダを書き込む

Arduino UnoをPCに接続した状態で以下を実行

  1. 「ツール」→「書込装置」→「Arduino as ISP」を選択
  2. 「ツール」→「ボード」→「Arduino Leonardo」を選択
  3. 「ツール」→「ブートローダを書き込む」を実行

はまった点

使っていたUSBハブの相性が悪かったようで、書き込み途中に以下のようなエラーが出てはまった。

# (略)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.10.0_x86__mdqgnx93n4wtt\hardware\arduino\avr/bootloaders/caterina/Caterina-Leonardo.hex"
avrdude: writing flash (32730 bytes):

Writing | #######avrdude: ser_send(): write error: sorry no info avail
avrdude: stk500_recv(): programmer is not responding

参考

AVR910: In-System Programming p.g.3 より引用