3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ArchLinuxでRaspberry Pi Picoの開発環境構築

Posted at

前置き

秋月でpicoをポチっちゃったがどうやって使えばいいか全く思いつかず、とりあえずLチカをやってみようと思ったが、メインPCはArchLinuxで驚くほどArchLinuxでpicoをいじっている人がいませんでした。

macOSでLチカをやってる記事を見つけたので、ArchLinuxでやってみると決め、そのまとめをここに書きます。

環境構築

arm-none-eabi-gccの導入

sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib

これで終わりです。arm-none-eabi-newlibをインストールしないとexampleのblinkのコンパイルができないのでインストールしましょう。

SDKの導入

gitで落としてパスを通すだけです。

cd ~
mkdir pico
cd pico
git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update –-init

.bashrc(僕はzshなので.zshrc)に次を追加して

export PICO_SDK_PATH = "~/pico/pico-sdk"

sourceで適用します。

source .zshrc

Lチカ(blink)のコンパイル

pico-exampleをclone

cd ~/pico
git clone -b master https://github.com/raspberrypi/pico-examples.git
cd pico-examples

pico-exampleをビルド

mkdir build
cd build
cmake ../

blinkをビルド

cd blink
make

ビルドが完了するとblink.uf2が生成されます。

書き込み

BOOTSELボタンを押しながら接続するとUSBメモリとして認識されるので、生成されたblink.uf2をドラッグ・アンド・ドロップすれば書き込みが終わり、Lチカ完成です。

参考文献

3
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
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?