Klinge is an FPGA computer designed by Lone Dynamics Corporation.
This repo contains schematics, PCB layouts, pinouts, a 3D-printable case, example gateware and documentation.
The 3D enclosure fits into a Half10 compute bay, which can be used stand-alone or attached to a 10" rack.
Find more information on the Klinge product page.
Klinge has a JTAG interface and ships with a DFU bootloader that allows the included flash MMOD to be programmed over the USB-C port.
The DFU bootloader is available for 5 seconds after power-on, issuing a DFU command during this period will stop the boot process until the DFU device is detached. If no command is received the boot process will continue and the user gateware will be loaded.
Install dfu-util (Debian/Ubuntu):
$ sudo apt install dfu-util
Update the user gateware on the flash MMOD:
$ sudo dfu-util -a 0 -D image.bit
Detach the DFU device and continue the boot process:
$ sudo dfu-util -a 0 -e
It is possible to update the bootloader itself using DFU but you shouldn't attempt this unless you have a JTAG programmer (or another method to program the MMOD) available, in case you need to restore the bootloader.
These examples assume you're using a "USB Blaster" JTAG cable, see the header pinout below. You will need to have openFPGALoader installed.
Program the configuration SRAM:
openFPGALoader -c usb-blaster image.bit
Program the flash MMOD:
openFPGALoader -f -c usb-blaster images/bootloader/tinydfu_klinge.bit
Building the blinky example requires Yosys, nextpnr-ecp5 and Project Trellis.
Assuming they are installed, you can simply type make
to build the gateware, which will be written to output/blinky.bin. You can then use openFPGALoader or dfu-util to write the gateware to the device.
See the Kakao Linux repo for the latest instructions.
Copy the files from the images/linux
directory to the root directory of a FAT-formatted MicroSD card.
Klinge ships with LiteX gateware on the user gateware section of the MMOD that is compatible with these images. After several seconds the Linux penguin should appear on the screen (HDMI) followed by a login prompt.
Please follow the setup instructions in the linux-on-litex-vexriscv repo and then:
- Build the Linux-capable gateware:
$ cd linux-on-litex-vexriscv
$ ./make.py --board klinge --uart-baudrate 115200 --build
$ ls build/klinge
- Write the gateware to the MMOD using USB DFU:
$ sudo dfu-util -a 0 -D build/klinge/gateware/klinge.bit
-
Copy the device tree binary
build/klinge/klinge.dtb
to a FAT-formatted MicroSD card. -
Build the Linux kernel and root filesystem:
See the Kakao Linux repo for instructions.
-
Copy the Image and rootfs.cpio files generated in the previous step to the boot partition of the MicroSD card, in addition to the following files:
-
Copy the OpenSBI binary (included in this repo as
klinge/images/linux/opensbi.bin
) to the MicroSD card. Alternatively, you can build this binary by following these instructions. -
Copy
klinge/images/linux/boot.json
to the MicroSD card. -
Power-cycle Klinge. After Linux has finished booting you should see a login prompt on the HDMI display.
If you haven't yet installed LiteX please see the LiteX quick start guide for details on installing LiteX.
Build the LiteX gateware:
$ cd litex-boards/litex_boards/targets
$ ./machdyne_klinge.py --cpu-type=vexriscv --cpu-variant=lite --sys-clk-freq 40000000 --uart-baudrate 1000000 --uart-name serial --build
Program the LiteX gateware to SRAM over JTAG:
$ ./machdyne_klinge.py --cable usb-blaster --load
Or program the LiteX gateware to flash over DFU:
$ sudo dfu-util -a 0 -D build/machdyne_klinge/gateware/machdyne_klinge.bit
The 3.3V JTAG header can be used to program the FPGA SRAM as well as the MMOD flash memory. It can also be used to provide power (5V) to the board.
2 4 6
1 3 5
Pin | Signal |
---|---|
1 | TCK |
2 | TDI |
3 | TDO |
4 | TMS |
5 | 5V0 |
6 | GND |
Revision | Notes |
---|---|
V1 | Current production version |
The contents of this repo are released under the Lone Dynamics Open License.
Note: You can use these designs for commercial purposes but we ask that instead of producing exact clones, that you either replace our trademarks and logos with your own or add your own next to ours.