Posts: 8
Joined: Sun May 21, 2023 12:19 am

How to Use the OLED Debugger on an Raspberry Pi

Mon Jun 05, 2023 2:12 pm

I've been working on making a Rpi based computer with a bunch of tiny screens and a tiny keyboard. It's a stupid idea I had that I wanted to make a computer small enough for a rat to use (not that any of my rats would be interested c:).

One of the components I came across was a ready-made serial debugger from Tindie. It has an onboard microcontroller for reading print commands from the serial tx pin of other microcontrollers like Arduino. Although the listing mentions usage cases for the Raspberry Pi, I could not find corresponding documentation for how to do it. I thought I'd share an example for how to do that here. Note that I have no idea how this might interfere with other peripherals attached to your Rpi. I also don't know if this is a stupid way to do this, but here we go:

Attach the serial debugger to the physical pins on the Rpi as follows:
VCC - Pin 1
RX - Pin 8
GND - Pin 6

Using the latest Rpi OS, go to raspi-config

Code: Select all

sudo raspi-config
In Interface Options, enable serial communications by selecting Yes in the Serial Port option. Serial Console will now be enabled.

Next, open config.txt

Code: Select all

sudo nano /boot/config.txt
Append the following line to the end of the file:

Code: Select all

Next, edit cmdline.txt to tell the machine what to send to the serial port. Here is what mine looks like:

Code: Select all

console=serial0,9600 root=PARTUUID=b3d58338-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash
Note that the baudrate for the debugger is 9600; the default baudrate of 115200 will result in gibberish. To make my screen especially verbose, I removed the plymouth.ignore-serial-consoles flag.

Once you reset, the debugger should come to life with tons of text scrolling across it. My example is basically blinkenlights, but someone else may be able to use it for something more useful.

Return to “Beginners”