Zgnano - My first microcontroller board

December 12, 2022

After a long learning process I finally made my first microcontroller board!

Zgnano Cortext M4 microcontroller

Here's the specs:

  • Arm cortex-M4 running at 192Mhz
  • 128k flash and 64k ram
  • SWD debugging
  • 26 GPIO pins
  • 1 user LED, 1 power LED
  • 1 reset button, 1 user button (not in picture)
  • On board 3.3v regulator can supply 500mA
  • Very small footprint of about 0.75 inch by 1.5 inches.

There's two micros on the board. The one is running a custom build of free-dap so you can just plug it into usb and flash using pyocd. It also supports full debugging over swd with gdb.

When you plug in the board the programming chip shows up:

$ pyocd list
0000466 D [cmd:0] New _Command [dap_access_cmsis_dap]
  #   Probe/Board                   Unique ID   Target  
  0   CodeLV Nano VCP & CMSIS-DAP   E0E7E35B   

The other chip is the target microcontroller that is intended to be programmed.

I currently run firmware entirely written in Zig, hence the name. If testing goes well I will hopefully put a few of these up for sale along with access to my zuric framework. The code flashed looks like:

var led_green: gpio.Pin = undefined;

pub fn main() !void {
    led_green = gpio.Pin.initOutput(.PA15);
     while (true) {
        time.sleep(100, .ms);


The board was designed in Horizon-EDA. The board was manufacturered by jlcpcb. The stencil, paste, assembly, and reflow were done in house.

Homemade stencil Stencil

Stencil result Solder paste on board

I didn't take any pictures of the reflow but the result is in the first picture. It works!

Stay tuned...