R2P2 (Ruby on Raspberry Pi Pico) is a shell system written in picoruby/picoruby.
(TODO)
- Download a release binary
- Drag and drop it into the RPI-RP2 drive of Pi Pico
- Connect the shell through a serial port with a terminal emulator
gtkterm --port /dev/ttyACM0
GTKTerm is strongly recommended. Traditional CUI/TUI emulator such as cu, screen, and minicom don't work well.
If you use Windows or macOS, try TeraTerm or PuTTY though the author didn't confirm them. You may need to look for a fine configuration.
Anyway, it seems almost problems on the terminal emulator come from CR/LF handling.
- Install R2P2 into Raspberry Pi Pico.
- Open R2P2 in a terminal emulator.
- Use some shell commands to see a filesystem working on R2P2.
- Run some small Ruby scripts in IRB.
- Blink the on-board LED of Raspberry Pi Pico using the GPIO class of PicoRuby.
- Measure the temperature using Pi Pico's on-chip ADC with the ADC class of PicoRuby.
- Use the multi-line editor feature of IRB.
- Set the current time in the RTC of Pi Pico.
- Confirm the
date
command in the shell is implemented with the Time class of PicoRuby.
- Create a Ruby script with the Vim-like text editor and execute it.
- Drag and drop a Ruby script that is written outside R2P2 and execute it.
- Make Pi Pico an autostart device by writing /home/app.rb file.
The presentation video (JA) from RubyWorld Conference 2022: Link
- git
- pico-sdk including tinyusb
- pico-sdk including btstack (for pico_w)
- env PICO_SDK_PATH
- env PICO_EXTRAS_PATH
- ruby (CRuby)
- cmake
- arm-none-eabi-gcc
- arm-linux-gnueabihf-gcc
- qemu-arm-static
The author is working on WSL2-Ubuntu (x86-64 Windows host) and Ubuntu (x86-64 native)
If you are building on macOS, please use gcc-arm-embedded
.
brew install --cask gcc-arm-embedded
git clone https://github.com/picoruby/R2P2.git
cd R2P2
rake setup
rake
You'll find an executable in build
directory.
rake debug
The elf file can be debugged with Picoprobe and gdb-multiarch.
See the gist: https://gist.github.com/hasumikin/f508c092ced0b5d51779d472fbaf81e8
(TODO)
- Fix many bugs, and
- PicoRuby and Shell
- More functionality of vim
- UTF-8 support
- Multi-task controll on the fly
- Redirect and pipeline
- Peripherals
- FAT filesystem with SD card (SPI)
- Real-time clock (RTC)
- WiFi and TCP/IP on Raspberry Pi Pico W