Git Product home page Git Product logo

d1_build's Introduction

Build an Image for the Sipeed Lichee RV

Automatic building of a Debian image for the Sipeed Lichee RV Risc-V single board computer. This project uses Docker for the heavy lifting. This means that bootable disk images can be created on any kind of OS (windows, mac or Linux).

Author: Tim Molteno ([email protected])

Pre-built images

These can be downloaded from here, and installed using any standard disk imaging utility (dd on linux).

Username, Password and WiFi

The username is rv, with password lichee. The root password is licheerv. In these images you can use nmcli or nmtui command line tools to set up a wifi connection

sudo nmcli dev wifi connect "MyWifi" password "my-password"

This will connect to a notwork called "MyWifi", with password "my-password"

Ethernet

The builds currently contain a handful of standard USB Ethernet drivers, including those for Realtek 100M adapters. Upon connection, Debian will automatically configure the USB device and connect to the network, with no need for manual configuration.

How to build your own image

This is intended to be used on a debian system with docker, and docker-compose installed. Modify the parameters of the build in the file docker-compose.yml such as kernel version and board target. Then issue.

DOCKER_BUILDKIT=1 docker-compose build
docker-compose up

The build stage does a lot of the work (compiling kernels e.t.c and takes quite a bit of time). Once this is done it will be cached by Docker, so should run faster. The execution stage (docker-compose up) runs a script that does more of the image building using a series of scripts (build.sh, create_image.sh).

This should produce a disk image in the directory ./lichee_rv_dock/ located in the same folder as the repository.

There is a Makefile that automates this, and you can just type

make

And the image will be built. This image can be transferred to an SD card using dd (on Linux)

sudo dd if=licheerv.img of=/dev/sdX bs=4M

where /dev/sdX is the name of the sdcard device (check dmesg output).

Clean Build

Just issue,

DOCKER_BUILDKIT=1 docker-compose build --no-cache

And everything will be rebulid (new kernel download e.t.c.). This is very slow (on my laptop)

NOTES

  • Do NOT fix the GPT if you resize the root partition (second partition). This will cause boot errors.
  • WiFi on the RV 86 Panel does not work as the xr829 driver is missing. Issue here (tmolteno#7)
  • The tiny LCD screen is not going yet. (tmolteno#8)

Links

How Booting Works

First Boot Stage

  • The first sun20i_d1_spl code is loaded. It looks for a u-boot toc1 file from the mmc drive (sd-card reader). This file is written directly onto the first part of the SDcard (not in a filesystem)
  • The TOC file contains a list of parts of the system. These are (in order) opensbi, dtb, u-boot. These parts are loaded into memory.

Second Boot stage

  • The OpenSBI runs as the second boot stage. It is responsible for loading U-Boot

Third boot stage

This is U-Boot. It mounts the boot partition on the mmc drive. Reads a file called 'boot.scr' and executes this script. This loads the kernel (Image.gz), uncompresses it and starts things running.

d1_build's People

Contributors

iyesin avatar jailbird777 avatar mtuxpe avatar nexusxe avatar peeweep avatar tmolteno 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.