Code Monkey home page Code Monkey logo

docker-linuxonlitex's Introduction

What is this project

This project is an iteration to build up a docker container that contains all I need to build Linux on my Sipeed Tang Primer 20k. It will help me to have an isolated area to compile and clean it up easily without needing to remember to run scripts for cleanup.

You need to build this docker, and then you can run an instance of it.

This Dockerfile assumes you've put your Gowin IDE files inside the IDE folder (I've already copied the files inside the repo, but you can change it if you want โ€“ just download the student version from the Gowin site).

So How to Start

  1. Clone the repository:

    git clone https://github.com/gr8linux/docker-linuxonlitex.git
    cd docker-linuxonlitex
    
  2. Build the Docker Image:

    docker build .
    
  3. Run the Docker Container:

    cd ~/src/mybuildarea
    docker run -it --rm -v .:/home/linux-on-litex-vexriscv/build dockerlinuxonlitex
    
  4. After that you need to run the below or your prefered config inside the container

    ./make.py --board=sipeed_tang_primer_20k --toolchain=gowin --build
    

    if the build was finished without any error you shoud see your file inside the build directory

  5. Exit the docker and run the below command to load/flash it into your board

    openFPGALoader sipeed_tang_primer_20k/gateware/sipeed_tang_primer_20k.fs
    

To run it as of a privileged

docker run -it --rm --privileged dockerlinuxonlitex
# After you login 
lsusb
# Or after the build you can load the file by openFPGALoader

You can then load it using OpenFPGALoader. OpenFPGALoader is already included in the image, and if you run in privileged mode, you can run it inside the container itself.

This setup provides a convenient environment for compiling Linux for your Sipeed Tang Primer 20k FPGA board, keeping everything self-contained within the Docker container.

Sample build without run the command inside docker

To just build your requried image you could run it something like below

docker run -it --rm  -v .:/home/linux-on-litex-vexriscv/build dockerlinuxonlitex python -m litex_boards.targets.sipeed_tang_primer_20k --l2-size 512  --build --cpu-type vexriscv_smp --cpu-variant linux --build  --with-spi-sdcard --with-wishbone-memory

Build Process

Or if you like to load it directly


docker run --privileged -it --rm  -v .:/home/linux-on-litex-vexriscv/build dockerlinuxonlitex python -m litex_boards.targets.sipeed_tang_primer_20k --l2-size 512  --build --cpu-type vexriscv_smp --cpu-variant linux --build  --with-spi-sdcard --with-wishbone-memory --load

Or just let linux-on-litex make file do that for you

docker run --privileged -it --rm  -v .:/home/linux-on-litex-vexriscv/build dockerlinuxonlitex ./make.py --board=sipeed_tang_primer_20k --toolchain=gowin --build --load

What is next

You might like to have the board and know how it is looklike

The board

You could buy the board directly from Amazon or Aliexpress if you like Just search Sipeed tang primer 20k

Board Picture

The Gowin IDE

You need to download it from the Gowin site:

Download eda tools

docker-linuxonlitex's People

Contributors

gr8linux avatar

Watchers

 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.