Close

Coding a bare-metal readline() function.

A project log for Raspberry Pi Bare Metal Guitar Effect Processor

A Guitar MultiFX Processor running on a Raspberry Pi 3B with no operating system.

rebecca-buckinghamRebecca Buckingham 02/10/2019 at 02:580 Comments

One of my goals is to have some sort of console-like connection to the processor so I can run commands or even code interactively.  

To do this, however, I need code running on the pi that can listen over serial for commands and respond to them.

I decided to write a bare-metal compatible readline() function.  Basically, it is to allow editing of  typed-in commands before processing them.  Additionally, GNU readline adds history to the command line, so you can press CTRL+P and get the previous line.

I first prototyped this in Ruby, and then today, I've translated the Ruby code into C++.  I've had to restart the code over and over, so instead of testing on the pi, I'm running against a Teensy 3.6.

Moving the code from the Teensy to the Pi will be pretty easy.

Next step: write a simple command shell.

Discussions