Created
May 5, 2023 00:51
-
-
Save nezuppo/708664972455724523167c80a8a91269 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QT Py RP2040 に CircuitPython をインストール | |
参考にしたサイト | |
http://7th-chord.jp/sara_tsukiyono/index.php?cl=rp&rp=210607 | |
https://qiita.com/baggio/items/3db759da67c0123e993e | |
CircuitPython のサイトから UF2 ファイルをダウンロード | |
https://circuitpython.org/ | |
'Dornloads' - 'QT Py RP2040' | |
the latest stable release の CircuitPython 8.0.5 をダウンロード | |
言語は「ENGLISH (US)」を選択 | |
'DOWNLOAD .UF2 NOW' を押してダウンロード | |
ダウンロードした以下のファイルをラズパイに scp 等で転送 | |
adafruit-circuitpython-adafruit_qtpy_rp2040-en_US-8.0.5.uf2 | |
QT Py の BOOT ボタンを押しながらラズパイに USB 接続 | |
/var/log/messages を確認すると /dev/sdb として認識したと思われる | |
fdisk で確認 | |
$ sudo fdisk -l | |
... snip ... | |
Disk /dev/sdb: 128 MiB, 134217728 bytes, 262144 sectors | |
Disk model: RP2 | |
Units: sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 512 bytes | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Disklabel type: dos | |
Disk identifier: 0x000b9a62 | |
Device Boot Start End Sectors Size Id Type | |
/dev/sdb1 1 262143 262143 128M e W95 FAT16 (LBA) | |
/dev/sdb の Disk model が RP2 とのこと | |
QT Py RP2040 をマウント | |
$ mkdir qtpy | |
$ sudo mount /dev/sdb1 qtpy/ | |
$ df -h | grep sdb | |
/dev/sdb1 128M 8.0K 128M 1% /some/where/qtpy | |
ファイルが二つ置いてあった | |
$ ls -la qtpy/ | |
total 28 | |
drwxr-xr-x 2 root root 16384 Jan 1 1970 . | |
drwxr-xr-x 3 pi pi 4096 May 5 09:29 .. | |
-r-xr-xr-x 1 root root 241 Sep 6 2008 INDEX.HTM | |
-r-xr-xr-x 1 root root 62 Sep 6 2008 INFO_UF2.TXT | |
$ cat qtpy/INFO_UF2.TXT | |
UF2 Bootloader v2.0 | |
Model: Raspberry Pi RP2 | |
Board-ID: RPI-RP2 | |
$ cat qtpy/INDEX.HTM | |
<html><head><meta http-equiv="refresh" content="0;URL='https://raspberrypi.com/device/RP2?version=E0C912952D54'"/></head><body>Redirecting to <a href='https://raspberrypi.com/device/RP2?version=E0C912952D54'>raspberrypi.com</a></body></html> | |
ブラウザで開いてみたら、ラズパイ RP2040 のサイトだった | |
$ sudo cp adafruit-circuitpython-adafruit_qtpy_rp2040-en_US-8.0.5.uf2 qtpy/ | |
$ sudo umount qtpy/ | |
BOOT ボタンを押さずに QT Py RP2040 の USB を抜き差し | |
/var/log/messages を確認すると再度 /dev/sdb として認識したと思われる | |
fdisk で確認 | |
$ sudo fdisk -l | |
... snip ... | |
Disk /dev/sdb: 7 MiB, 7340544 bytes, 14337 sectors | |
Disk model: QT Py RP2040 | |
Units: sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 512 bytes | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Disklabel type: dos | |
Disk identifier: 0x00000000 | |
Device Boot Start End Sectors Size Id Type | |
/dev/sdb1 1 14336 14336 7M 1 FAT12 | |
先ほどは Disk model が RP2 だったが、今回は QT Py RP2040 | |
$ sudo mount /dev/sdb1 qtpy/ | |
$ ls -la qtpy/ | |
total 24 | |
drwxr-xr-x 4 root root 16384 Jan 1 1970 . | |
drwxr-xr-x 3 pi pi 4096 May 5 09:29 .. | |
-rwxr-xr-x 1 root root 132 Jan 1 2020 boot_out.txt | |
-rwxr-xr-x 1 root root 22 May 5 09:43 code.py | |
drwxr-xr-x 2 root root 1024 Jan 1 2020 .fseventsd | |
drwxr-xr-x 2 root root 1024 Jan 1 2020 lib | |
-rwxr-xr-x 1 root root 0 Jan 1 2020 .metadata_never_index | |
-rwxr-xr-x 1 root root 0 Jan 1 2020 settings.toml | |
-rwxr-xr-x 1 root root 0 Jan 1 2020 .Trashes | |
minicom を使えるようにする | |
$ sudo apt install minicom | |
$ echo $USER | |
pi | |
これやらなくてもはじめから dialout グループに入っている可能性もあり | |
$ sudo usermod -a -G dialout $USER | |
$ id | |
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),105(input),109(netdev),997(gpio),998(i2c),999(spi) | |
dialout グループに入っていることを確認 | |
(反映されていない場合は、とりあえずラズパイを再起動してみて再度確認) | |
$ minicom -b 115200 -o -D /dev/ttyACM0 | |
リターンキーを押すと Circuit Python と思われるコンソールに接続 | |
minicom の終了 | |
Ctrl + a -> z -> x | |
(byobu から minicom を動かしている場合は Ctrl + a -> a -> z -> x) | |
QT Py RP2040 の USB ケーブルをラズパイから抜く前に unmount | |
$ sudo umount qtpy/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment