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

PicoCalcでMachiKania phyllosomaを使用する手順

Posted at

はじめに

PicoCalcでMachiKaniaが動作することをXの@katu_meさんの投稿で知り、使用しているRaspberry Pi Pico 2 Wを載せているPicoCalcで動作を確認したのでその内容を示します。

実行環境

下記の環境で実行しました。

pico-sdkの存在するディレクトリを環境変数PICO_SDK_PATHに、Arm GNU Toolchainのコマンドディレクトリを環境変数$PATHに保存されている必要があります。

MachiKania phyllosomaのビルド

次の手順でPicoCalcで実行できるファームウェアを作成します。なお、事前にPicoSDKとArm GNU Toolchainが導入されている必要があります。

  1. Github(https://github.com/machikania/phyllosoma/tree/production)からソースコードのZIPファイル(phyllosoma-production.zip)をダウンロードし、展開する。
  2. 展開したディレクトリに移動する
$ cd /path/to/phyllosoma-production
  1. https://github.com/machikania/phyllosoma/tree/production/PicoCalc に記されているとおりにphyllosoma-production.zipを展開したディレクトリのファイルconfig.cmakeの17行目をコメント、20行目のコメントを外します。
 15 # Raspberry Pi Pico + Waveshare Pico-ResTouch
 16 # YD-RP2040 + ILI9341 LCD
 17 # set(MACHIKANIA_BUILD ws_pico_restouch)
 18
 19 # Raspberry Pi Pico + PicoCalc
 20 set(MACHIKANIA_BUILD pico_picocalc)
  1. ビルド用のディレクトリbuildを作成し、そこに移動します。
$ mkdir build
$ cd build
  1. cmakeコマンドを実行し、ファームウェアビルドに必要なファイルを生成します。Raspberry Pi Picoの種類によりcmakeのパラメータが異なります。
    1. Raspberry Pi Picoの場合:cmake ..
    2. Raspberry Pi Pico Wの場合:cmake -DPICO_BOARD=pico_w -DPICO_PLATFORM=rp2040 ..
    3. Raspberry Pi Pico 2の場合:cmake -DPICO_BOARD=pico2 -DPICO_PLATFORM=rp2350-arm-s ..
    4. Raspberry Pi Pico 2 Wの場合:cmake -DPICO_BOARD=pico2_w -DPICO_PLATFORM=rp2350-arm-s ..
  2. makeでファームウェアをビルドする
$ make -j4

以上の操作でファームウェアファイルが2つ作成される。

$ ls -1 *.uf2
phyllosoma_kb.uf2
phyllosoma.uf2

MachiKania phyllosomaのライブラリ等のコピー

ファームウェアのビルドが完了したのでMachiKaniaを実行するために必要な下記のファイルをSDカードのルートディレクトリにコピーします。

  1. phyllosoma-production.zipを展開したフォルダにあるPicoCalcフォルダ内のMACHIKAP.INI
  2. https://github.com/machikania/phyllosoma/releases/tag/Ver1.5.2 からmachikania-p-152.zipをダウンロードし、展開したフォルダ内にあるフォルダLIBsamples

MachiKania phyllosomaファームウェアの書き込み

ビルドされた2つのファームウェアのうち、phyllosoma_kb.uf2をPicoCalcに書き込みます。他のファームウェアの場合と同様にRaspberry Pi PicoのBOOTSELボタンを押しながらUSBケーブルを接続して表示されるドライブに上記のファームウェアファイルをドラッグ&ドロップするだけです。

MachiKania phyllosomaの実行

ファイルMACHIKAP.INI、フォルダLIBとsamplesをコピーしたSDカードをPicoCalcに挿入し、電源ボタンを長押しするとMachiKania phyllosomaのエディタが起動します。(SDカードが挿入されていなくても起動しますが、画面表示の向きが右に90度回転した状態になります)

下記のプログラムを入力し、F4キーを押すとテンポラリファイルに保存後コンパイル、実行されます。

PRINT "Hello MachiKania!"

実行結果を下記に示します。

MachiKania BASIC System
 Ver Phyllosoma 1.5.2.0
 BASIC Compiler KM-1509 by Katsumi
 LCD, File, & Keyboard system by KENKEN

Compiling ~TEMO.BAS
12242 micro seconds spent for compiling

Hello MachiKania

Hit Any Key

MachiKania phyllosomaのBASICについては入門MachiKaniaを参照してください。

最後に

MachiKaniaは日本語表示で、MMBasicで利用できないHTTPSが利用可能、BASICのプログラムはコンパイルして実行するので実行速度が速い点などが魅力的です。今後もいろいろと試してみようと思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?