Git Product home page Git Product logo

ezfe310's Introduction

ezfe310

The SiFive HiFive1 was just discontinued, making it as good a time as any to introduce this project.

ezfe310 is a stripped-down, bare-metal library for targeting the SiFive FE310 series of SoCs. It's intended primarily for educators and hobbyists seeking a simple, comprehensible embedded toolchain.

ezfe310 is in beta -- you might want to wait until any bugs in the runtime or linker script are ironed out. Currently, I think it's safe, but I might be inadvertantly overwriting the bootloader (e.g. the LEDs no longer flash upon reset).

ezfe310 features:

  • A small, well-documented linker script for the HiFive1 (scripts/ld/hifive1.h)
  • A small, well-documented runtime for C and assembly programs (src/runtime/crt0.s)
  • Nearly every register and field in the FE310 exposed to C programs as an lvalue/bitmask (include/mmio.h)
  • A lightweight, legible library for basic embedded functionality (ez.h)
  • Example programs (src/examples/)

Quickstart

  1. Grab a copy of the HiFive1 Getting Started Guide and the FE310 Manual at https://www.sifive.com/boards/hifive1.
  2. Install your favorite RISC-V versions of GCC, GDB, and OpenOCD, and populate the fields RISCV_AS, RISCV_GCC, RISCV_GDB, and RISCV_OPENOCD in the Makefile with the appropriate paths.
  3. Run make compile to compile src/main/main.c (and the runtime).
  4. Plug in your HiFive1, confirm that /dev/ttyUSB1 appears, and run make upload. Consult the Getting Started Guide if something doesn't work.
  5. Use your favorite TTY utility (screen, picocom, tio, etc.) to open /dev/ttyUSB1 at a baud rate of 115200.

Todo

  • Verify that the linker script, etc. won't brick anything.
  • Reliable UART input.
  • Interrupts.
  • More features from C's standard library.
  • Explore GCC features (binary literals, etc.).
  • Heap allocation.
  • Documentation.
  • Testing.
  • FE310G001/HiFive Rev B support.

Thanks

ezfe310 draws heavily from the work of others in the RISC-V community. The following helped provide a foundation for the project (and are good resources in their own right):

https://wiki.osdev.org/HiFive-1_Bare_Bones

https://gitlab.com/Leonhart231/hifive1

https://github.com/sifive/freedom-e-sdk/tree/v1_0

ezfe310's People

Contributors

znbm 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.