Code Monkey home page Code Monkey logo

foboot's Introduction

Foboot: The Bootloader for Fomu

Foboot is a failsafe bootloader for Fomu. It exposes a DFU interface to the host. Foboot comes in two halves: A Software half and a Hardware half. These two halves are integrated into a single "bitstream" that is directly loaded onto an ICE40UP5k board, such as Fomu.

Requirements

To build the hardware, you need:

  • Python 3.5+
  • Nextpnr
  • Icestorm
  • Yosys
  • Git

Subproject hardware dependencies will be taken care of with lxbuildenv.

To build the software, you need:

  • RISC-V toolchain

Building the project

The hardware half will take care of building the software half, if it is run with --boot-source bios (which is the default). Therefore, to build Foboot, enter the hw/ directory and run:

$ python3 foboot-bitstream.py --revision hacker

This will verify you have the correct dependencies installed, compile the Foboot software, then synthesize the Foboot bitstream. The resulting output will be in build/gateware/. You should write build/gateware/top-multiboot.bin to your Fomu device in order to get basic bootloader support.

Usage

You can write the bitstream to your SPI flash. If you're using fomu-flash, you would run the following:

$ fomu-flash -w build/gateware/top-multiboot.bin
Erasing @ 018000 / 01973a  Done
Programming @ 01973a / 01973a  Done
$ fomu-flash -r
resetting fpga
$

Fomu should now show up when you connect it to your machine:

[172294.296354] usb 1-1.3: new full-speed USB device number 33 using dwc_otg
[172294.445661] usb 1-1.3: New USB device found, idVendor=1209, idProduct=70b1
[172294.445675] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[172294.445684] usb 1-1.3: Product: Fomu Bootloader (0)
[172294.445692] usb 1-1.3: Manufacturer: Kosagi

To load a new bitstream, use the dfu-util -D command. For example:

$ dfu-util -D blink.bin

This will reflash the SPI beginning at offset 262144.

To exit DFU and run the bitstream at offset 262144, run:

$ dfu-util -e

Note that, like Toboot, the program will auto-boot once it has finished loading.

Building the Software

Software is contained in the sw/ directory.

foboot's People

Contributors

xobs avatar tomkeddie avatar enjoy-digital avatar david-sawatzke avatar mithro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.