~$ dmesg | tail
[20457.063661] usb 3-4.1: new full-speed USB device number 8 using xhci_hcd
[20457.187659] usb 3-4.1: New USB device found, idVendor=2e8a, idProduct=000a, bcdDevice= 1.00
[20457.187661] usb 3-4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[20457.187663] usb 3-4.1: Product: Pico
[20457.187664] usb 3-4.1: Manufacturer: Raspberry Pi
[20457.187665] usb 3-4.1: SerialNumber: 000000000000
[20457.239178] FAT-fs (sdb1): unable to read boot sector to mark fs as dirty
[20457.293371] cdc_acm 3-4.1:1.0: ttyACM0: USB ACM device
[20457.295851] usbcore: registered new interface driver cdc_acm
[20457.295851] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
~$
~/pico$ cd pico-examples/
~/pico/pico-examples$ mkdir build
~/pico/pico-examples$ cd build
~/pico/pico-examples/build$ export PICO_SDK_PATH=../../pico-sdk
~/pico/pico-examples/build$ cmake ..
Using PICO_SDK_PATH from environment ('../../pico-sdk')
PICO_SDK_PATH is /home/xxx/pico/pico-sdk
Defaulting PICO_PLATFORM to rp2040 since not specified.
Defaulting PICO platform compiler to pico_arm_gcc since not specified.
-- Defaulting build type to 'Release' since not specified.
PICO compiler is pico_arm_gcc
PICO_GCC_TRIPLE defaulted to arm-none-eabi
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc
Defaulting PICO target board to pico since not specified.
Using board configuration from /home/xxx/pico/pico-sdk/src/boards/include/boards/pico.h
-- Found Python3: /usr/bin/python3.8 (found version "3.8.5") found components: Interpreter
TinyUSB available at /home/xxx/pico/pico-sdk/lib/tinyusb/src/portable/raspberrypi/rp2040; adding USB support.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
ELF2UF2 will need to be built
PIOASM will need to be built
-- Configuring done
-- Generating done
-- Build files have been written to: /home/xxx/pico/pico-examples/build
~/pico/pico-examples/build$
Lチカをコンパイルします。これもすぐに終わります。
~/pico/pico-examples/build$ cd blink
~/pico/pico-examples/build/blink$ make -j4
Scanning dependencies of target ELF2UF2Build
Scanning dependencies of target bs2_default
[ 0%] Creating directories for 'ELF2UF2Build'
(中略)
[100%] Building C object blink/CMakeFiles/blink.dir/home/xxx/pico/pico-sdk/src/rp2_common/pico_stdio_uart/stdio_uart.c.obj
[100%] Linking CXX executable blink.elf
[100%] Built target blink
~/pico/pico-examples/build/blink$
このディレクトリに生成された blink.uf2 がRaspberry Pi Picoに書き込むファイルです。
これをRaspberry Pi Picoを接続すると開くRPI-RP2ディレクトリにドラッグアンドドロップをすると、Lチカが始まります。2回目以降は、基板上のBOOTSELスイッチを押しながら接続すると、RPI-RP2ディレクトリが開きます。
ライブラリはGitHubのESP32 BLE Keyboard libraryのページで、右上の「Code」のところから「Download ZIP」でライブラリをZIP形式でダウンロードしてきます。ダウンロードしたら「スケッチ」⇒「ライブラリのインクルード」でダウンロードしたライブラリを取り込みます。