BeastFiler: network storage for the MicroBeast
I've had my MicroBeast for just over a year now, and have accrued a loaner NanoBeast and VideoBeast along the way. Writing code for them has been huge fun, but the challenge of getting software from my modern, comfy development system (Linux, natch) onto the Beast hardware itself remains.
I created SLIDE and BeasTTY to help: they enable me to drag and drop files in my browser window and have them transferred to the Beasts without too much fuss. But it can still be a bit on the slow side thanks to the limited serial port speed.
I added in support for VideoBeast assets, but VideoBeast has 1 MByte of video memory, so these files can be huge, and loading them with SLIDE is akin to waiting for a Spectrum to load from tape. Also a single VideoBeast asset can easily be greater than the maximum disk size (240 KBytes) of the Beast's RAM disk, which means that SLIDE is the only way to get these files on there, you can't cache them locally to quickly repeat the loading operation later.
Andy's recently announced SD card support for the VideoBeast, which will help no end: it can stream assets directly from the SD card into video RAM, or transfer them CPU-side. I've not tried it (my VideoBeast is currently at the menders, and lacks an SD interface anyway) but I suspect it will be enormously useful, particularly as a fast "cartridge" format for released games. For development though, I think the "put card in machine A, copy files, unmount card, put card in machine B, copy files, repeat" workflow is still going to prove a bit irksome.
What I want is to be able to create a file on my development PC, and it magically appears on the Beast. And vice versa, ideally. A form of "Network Attached Storage" for the Beast.
Kicking around some design ideas
Only problem is, the Beast has no networking at all. We'll have to provide it. Building a peripheral to add WiFi using something like an ESP32 module ought to be relatively simple and cheap.
The only problem with the ESP32 approach is that these devices are 3.3 V, and the MicroBeast, operates at 5 V. These means a tonne of bidirectional level-shifting, and that's exactly the sort of drag that puts me right off a project.
Then I stumbled across the Piers Rocks YouTube channel, and watched many hours of his excellent videos, particularly those about OneROM - a small board that replaces ROMs in legacy computers using an RP2350.
The OneROM work gives us three good signals:
- it's possible to do Z80-side I/O purely with GPIO and DMA, no CPU involved
- the 5v tolerance (assuming you get the right version of the chip) is reliable, and he's soak-tested the contentious power-up timing issues that might shoot the whole proposition down
- it's possible for a software engineer to pull off the moderately complex layout of the RP2350 PCB!
Copy all the things
Furthermore, the PCB schematics and layouts for OneROM are all open source, which means that I can copy a bunch of stuff from the schematics, and use the layout as a reference.
I also need to add a radio module (unlike the ESP32 the RP2350 has no built-in WiFi or Bluetooth, but it does have a companion module, the "RM2"), some external PSRAM, an external IO connector, some LEDs, and the classic RC2014 bus interface.
Fortunately I'm not constrained to the footprint of old ROM/EEPROM chips, and can use the full width of the RC2014 card.
In the end I ended up cribbing from the OneROM Fire40b design, the PicoMite, the pico-stretch, the Raspberry Pi Pico 2W (for radio stuff), the excellent official Hardware Design with RP2350 and the datasheet. The RC2014 module template was also useful.
Here's the schematic I ended up with in Kicad:

I had to move a few GPIOs around to make the PCB layout easier, but nothing too drastic. The schematic is the easy part: it's the layout that's a bitch with the RP2350, as its supporting regulator and oscillator circuitry (and to some extent the flash and RAM) has to be laid out "just so".
Layout
piers.rocks has an excellent, very long video entirely on how he laid his out on his extremely constrained footprint, which was a source of much inspiration for me. I laid out my components manually, did most of the critical traces by hand, and used Kicad Routing Tools (an autorouter) to do the rest.
My constraints were:
- two-layer board (coz it's cheaper)
- components on top side only (coz it's cheaper)
- manufacturable by JLCPCB (coz I don't want to solder the RP2350 by hand)
Both myself and the autorouter did a merely adequate job. I was fortunate to have the layout reviewed by a professional, which gave me some great pointers.
Unfortunately, re-laying out a PCB is even more of a ball-ache than laying the thing out from fresh. At this point the project stalled for quite a while.
A couple of months later I came across a YouTube video of driving Kicad 10 via its cli command, and another that mentioned that MCP interfaces exist for it. Inspired, I upgraded to Kicad10, installed the Konnect-EDA MCP, and fired the project up anew in Claude code.
The LLM rejigged my component placement, but only slightly, which I'm counting as a win for meatware. Konnect isn't able to use Kicad Routing Tools unfortunately, but it can use the older FreeRouting, and the results were... not good. Considerably worse than my manual efforts, with some traces not routed at all. Claude is able to route "by hand" however: it's a sort of semi-automatic process, some things it can do automatically, others it can only achieve by making instructions for an ape (me) to follow. This was good fun, and I actually learned quite a lot in the process, so I can heartily recommend this technique of you're not a PCB ninja.
Here's the result:

Claude was also able to do all the tedious cross-referencing with the JLCLCB parts database, and even made some 3d models for the board visualisation:

I think it also picked up that I'd missed a couple of resistors in the USB interface, and that the L1 inductor (polarized, no less) was the wrong way round. Claude also swapped out my 3v3 regulator for something beefier, after considering the on-air power draw of the radio.
Manufacture
I sent the manufacturing files off to JLCPCB, opting to use their assembly service, and taking a $3 hit on each "extended" part (of which there are 8 in the above design). It worked out at about £25 per board, which is a Goldilocks sort of price. Unfortunately the minimum order quantity is 5 boards, so that ate all my pocket money.
Eventually though, this:

and these:

I snapped off the little extended bits that they put on for the pick-and-place machine (finials? is that the right word?) and gave it some thorough magnified scrutiny, checking for solder bridges and correct pin 1 orientation for anything that's polarised. I didn't find any issues.
Next I buzzed out all the combinations of power rails to check for shorts. Then I hooked it up in isolation to a USB power meter and got ready to pull the plug sharpish:

Hmm, no current. Maybe it's the crappy meter. Let's try another:

There we go, 7mA. I'd expect an RP2350B in its bootloader to be pulling about 10mA, but that's probably a limitation of my el-cheapo "USB Safety Tester".
Suitably re-assured, only one step remained: plugging it into real hardware, risking life and Beast!

The three LEDs came on dimly (as expected), no magic smoke came out, and the Beast functioned as normal. So far so good!
Bringup
I plugged it into its own USB power and was pleased to see the RP2350B enumerate in my development PC and show up in the filer:

picotool was able to communicate with the chip:
❯ ✦ ❯ sudo ~/.pico-sdk/picotool/2.3.1/picotool/picotool info -a
Program Information
none
Fixed Pin Information
none
Build Information
none
Device Information
type: RP2350
revision: A4
package: QFN80
chipid: 0xf6da0be4d15d22fe
flash devinfo: 0x0c00
current cpu: ARM
available cpus: ARM, RISC-V
default cpu: ARM
secure boot: 0
debug enable: 1
secure debug enable: 1
boot_random: b77c1441:a25d8afd:fd402ca0:a801e0bd
boot type: normal
last booted partition: none
diagnostic source: slot 0
last boot diagnostics: 0x00010041
rom gitrev: 0xa8bfe860
Metadata Blocks
noneI ran a small test program to check for major functionality:

Then I built another test program to validate the z80 side of things, logging out bus interactions:
Strobes/s: /M1 958996 /RD 1755759 /WR 213156 /IORQ 3667 /WAIT 0
I/O cycles: 3667
IN 00 -> 7f x642
IN 20 -> 0d x1
OUT 20 <- 0a x7
IN 25 -> 60 x2946
OUT 71 <- 21 x6
OUT fa <- aa x1
INTACK vector 02 x64I am of course driving that from AntForth on the Beast side like this:

and like this:

In the example above you can see the z80 bus signalling counts, and you can see the INs and OUTs that I'm making from Forth. You can also see the Beast's BIOS scanning the keyboard, getting interrupted by the RTC chip, and reading the RTC.
In short, the hardware works first time. As far as I can tell, without fault. It's early days admittedly, I'm sure something will come up. I already wish I'd put the RESET line on there: maybe in Rev2.
Next steps
All that remains then, is software. The easy bit, as any product manager will tell you. I think this is going to break down into 3 areas:
- firmware for the BeastFiler board. Core 0 is going to handle z80 communication, and Core 1 is going to handle USB, the radio, and converting between the CP/M view of the filing system and the remote filing system itself. Core 0 is also going to handle keeping a disk image in flash, so that the Beast will boot in the absence of WiFi or remote computer.
- daemon software for the remote computer: the thing that serves files over the WiFi to the BeastFiler. I'm going to use the 9P protocol for this (from the venerable Plan9 operating system). I've used this before, in legacy-ish hardware, for a never-released next-gen operating system from a major British computer manufacturer (shout out to the Galileo massiv!) so I know it works well.
- custom BIOS for the Beast. No way around this, I'm going to have to roll my own BIOS in order to replace the incumbent Flash and RAM disks with 8x CP/M "hard discs" that I can map to disk images on the fly. [Unless Andy makes good on his idle promise of making the BIOS extensible].
I'm hoping to be able to use the same board for various other projects on the drawing board, and have baked in some extra secret sauce to allow this to happen.
Be sure to check back for BeastFiler updates!
Comments