
Programmer
See how Rose-Hulman Institute of Technology capstone team built a JTAG programmer in Ada by turning a $10 STM32F070 Nucleo into a tool that configures a Gowin FPGA and uploads firmware to its RISC-V bootloader, down to the registers in Ada 2012.

Rose-Hulman
A Rose-Hulman Institute of Technology capstone team, working with AdaCore through the GNAT Academic Program, turned a $10 STM32F070 Nucleo into a JTAG programmer for the Gowin GW1NR-9 on the $15 Tang Nano 9K, configuring the FPGA and then driving the NEORV32 RISC-V bootloader to upload firmware, all in Ada 2012 down to the registers.
The firmware consists of two Ada tasks coordinating via a protected object: a serial command interpreter and a JTAG worker. The worker bit-bangs the IEEE 1149.1 TAP through Gowin's configuration command sequence, then pulls a clever trick: once parked in Shift-DR, it remaps the same pins to the hardware SPI peripheral and streams the bitstream at 12 MHz, DMA ring buffer in, SPI out, before bit-banging the final byte to exit the state machine cleanly.
And the test rig might be the best part: a TI MSP432 LaunchPad impersonates the FPGA, stepping a full 16-state TAP model on every clock edge, serving the real Gowin IDCODE and a synthesized status register, and failing any driver that skips the erase sequence or sends a short bitstream, with the violation named on a UART log.


