mimaki / pico-mruby

mruby for Raspberry Pi Pico

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raspberry Pi Pico用のmruby

ソースコードの取得

$ git clone https://github.com/k-mana/pico-mruby.git --recursive

または

$ git clone https://github.com/k-mana/pico-mruby.git
$ cd pico-mruby
$ git submodule update --init --recursive

ビルドツールのインストール

$ sudo apt install cmake build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib rake

ビルド

$ cd pico-mruby
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

注記

pico-sdkのissue#623が発生すると動作しません。 その場合は、このパッチを適用してください。

アプリケーション

デフォルトはUSBシリアル

hello_world

  • build/src/hello_world/hello_world.uf2
  • スクリプトまたはバイトコードを埋め込んだサンプル。

pico_mirb

  • build/src/pico_mirb/pico_mirb.uf2
  • REPL(Read-Eval-Print Loop)

pico_mruby

  • build/src/pico_mruby/pico_mruby.uf2
  • USBマスストレージにcode.rbまたはcode.mrbが存在する場合、自動的に実行する。
  • 実行する優先順位は以下です。
    1. code.mrb
    2. code.rb
    3. REPL
  • USBマスストレージに書き込むと自動的に再起動します。
  • code.rbまたはcode.mrbの実行中にシリアル入力をするとREPLモードになります。

mruby for Raspberry Pi Pico

Get the source code

$ git clone https://github.com/k-mana/pico-mruby.git --recursive

or

$ git clone https://github.com/k-mana/pico-mruby.git
$ cd pico-mruby
$ git submodule update --init --recursive

Install the build tool

$ sudo apt install cmake build-essential gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib rake

Build

$ cd pico-mruby
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

Note

It does not work when issue #623 of pico-sdk occurs. In that case, please apply this patch.

Application

Default is USB Serial.

hello_world

  • build/src/hello_world/hello_world.uf2
  • Sample with embedded script or bytecode

pico_mirb

  • build/src/pico_mirb/pico_mirb.uf2
  • REPL(Read-Eval-Print Loop)

pico_mruby

  • build/src/pico_mruby/pico_mruby.uf2
  • If code.rb or code.mrb exists in the USB mass storage, it will be executed automatically.
  • The priorities to execute are as follows:
    1. code.mrb
    2. code.rb
    3. REPL
  • Writing to USB mass storage will automatically reboot the system.
  • If you make a serial input while code.rb or code.mrb is running, it will enter REPL mode.

About

mruby for Raspberry Pi Pico

License:Other


Languages

Language:C 89.5%Language:HTML 10.1%Language:CSS 0.1%Language:CMake 0.1%Language:Ruby 0.1%