Skip to content

index-0/fe310env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fe310env - FE310 development environment
========================================
fe310env is a minimalist development environment for the SiFive FE310 family.
It provides the small runtime and build pieces needed to produce firmware
for FE310-based boards.

Features
--------
* Optimized bootloader that reclaims ~99.3% of the 64 KiB boot region
* Trap and exception handler with weak defaults for easy override
* Brickguard recovery to unbrick the board after a bad flash
* Initializes the C runtime and supports Newlib libc
* Includes libfe310, a minimal FE310 library for MMIO and peripherals
* Works with both GNU and LLVM toolchains
* Simple Make-based build system

Requirements
------------
* RISC-V toolchain with rv32imac_zicsr_zifencei architecture support
* Make

Usage
-----
In an empty folder create a Makefile and define:

BOARD ?= hifive1-revb
ENVDIR ?= ../path/to/fe310env
SRC += file1.c file2.c
include $(ENVDIR)/Makefile.include

After running make, the build drops these into out/ in your project directory:
* fw.elf
* fw.hex
* fw.lst
* obj/

Use your usual flasher (GDB + OpenOCD or J-Link) to upload the firmware.

Footprint
---------
These examples are built to match behavior across environments using the nano
specs and similar compiler flags, with bootloader sizes excluded.

 example | fe310env | freedom-sdk | delta (B) | delta (%)
----------------------------------------------------------
 empty   |     8914 |       14280 |     -5366 |   -37.57%
 hello   |    12940 |       22170 |     -9230 |   -41.63%
 pwm     |     9292 |       22018 |    -12726 |   -57.79%
 spi     |     9348 |       21758 |    -12410 |   -57.03%

License
-------
See LICENSE file for copyright and license details.

About

minimal runtime and build setup for producing firmware. (read-only mirror)

Resources

License

Stars

Watchers

Forks