Blogfive-port gigabit switch OLED firmware

See a network switch come alive before it exists

See a five-port gigabit switch's OLED firmware run on its 3D board in the browser, with buttons and a serial console, before it is made.

A close-up of the 3D board shows the OLED on port 1 detail beside an RP2040, switches and a USB connector.

What if you could press a button on a board before the board exists?

You press it, a screen lights up, and something you imagined answers back. It feels like tasting something you cooked yourself: simple, but yours.

We want everyone to get that feeling with hardware: idea, schematic, PCB, CAD and firmware, and seeing it work before anything is made.

Here, Inky wrote the OLED firmware for a five-port gigabit switch we designed, and we ran it on the board's 3D model in the browser. The screen shows ports, port detail, traffic and system info.

The port numbers are simulated: the RP2040 isn't wired to the switch chip yet.

The firmware

Inky's chat sits beside firmware/src/main.cpp, whose build reads Compiled OK, 71.9 KB for an RP2040.

On the left is Inky's chat: it worked for 7 m 24 s and updated firmware/src/main.cpp to v1.0.1.

In the middle is that file in the Code tab. Under it, the Build panel shows Compiled OK, 71.9 KB, for an RP2040 (pico, Arduino) with the Adafruit SSD1306 and GFX libraries.

It fits comfortably on the chip:

  • 3.5 % of the chip's 2 MB flash
  • 3.8 % of its 256 KB RAM

The board beside the code

Code stays on the left while the board's 3D model on the right shows the OLED, buttons and serial log.

Simulate runs that build in the browser.

The code stays on the left. On the right is the board's own 3D model, with its OLED (U7) drawing what the firmware draws.

Under the code are the simulator's controls:

  • Two buttons: SW2 and SW3
  • A flat copy of the OLED
  • A USB serial console printing the boot log as ports 1, 2 and 3 come up

Pressing a button on the model

A cursor holds SW3 on the 3D model, and the OLED opens port 1 detail on screen 2 of 4.

Hover a button on the 3D board and hold it to press it, like a physical button.

Here, the cursor holds SW3 and the OLED opens port 1's detail, screen 2 of 4.

The bottom line of every screen says what the buttons do. Here, SW2 moves to the next port and SW3 goes back.

One port in detail

With SW2 pressed, the OLED shows port 3 at 1000M full duplex, packet counts and 54 errors.

Two presses of SW2 step to port 3:

  • Link up at 100 Mb/s full duplex
  • Up for 1 min 33 s
  • 7,849 packets received, 4,195 sent
  • 54 errors

Every port screen says SIM: the firmware makes these numbers up. Once the RP2040 is wired to the switch chip, this screen is where the real counters would go.

Driving it from the serial console

Typing down 2 in the serial console sets port 2 down on the flat OLED and on the 3D board.

The console under the code is the board's USB serial port.

You type down 2 and press Enter. The log answers “SIM command: P2 DOWN”, and both the flat OLED and the one on the 3D board now list P2 DOWN.

“up 2 1000” brings it back at 1000 Mb/s.

The system screen

The OLED system screen lists uptime, 3 of 5 ports up, firmware 1.0.1 and USB at 115200.

The last of the four screens shows:

  • Uptime 1 min 45 s
  • 3 of 5 ports up (ports 2 and 4 are down)
  • Firmware 1.0.1
  • USB serial port at 115,200 baud

Before it comes a traffic screen with a bar and packets per second for each port. Four screens, two buttons: SW2 moves on, SW3 goes back to the ports.

This is only the beginning

This is one small example of what we are building toward.

Hardware should feel understandable and possible to make, not like a locked room that only a few people can enter.

We love people who build, and we want to support more of them, from the first idea to the moment a design comes alive in simulation.

What would you build if you could understand the whole path from schematic to firmware?

Build with us at heypcb.ai.

Topics

  • five-port gigabit switch OLED firmware
  • RP2040 firmware on 3D board in browser
  • simulate network switch before it exists
  • Adafruit SSD1306 RP2040 Arduino
  • press buttons on 3D PCB model
  • USB serial console switch simulator
  • Inky OLED firmware heypcb

Share

First published on X

More posts

HeyPCB Code title beside a black handheld whose screen shows a pixel space shooter.HeyPCB Code

From Prompt to Working Firmware

HeyPCB brings firmware into the browser: design a handheld, then write, simulate, and flash six games for the same board.

HeyPCB1 min
Exploded HeyPCB Memo with an anodised aluminium shell, an all-in-one PCB, battery space, and a five-screw back plate.HeyPCB Memo

We Built Pocket, but Better.

HeyPCB Memo rethinks Pocket as one 52 × 28 mm board in an editable aluminum shell, with open-source PCB, CAD, and firmware to build on.

HeyPCB2 min
HeyPCB banner for Image to PCB, with Build without Limits and five boards shown beside small reference photos.Joule Thief Cat PCB from photos

The Freedom to Build Without Limits.

Give Inky a photo and describe what you want. It drafts a schematic, selects components, and generates a PCB layout you can inspect and change.

HeyPCB1 min