Skip to content

wuhanstudio/litex-picorv32-rtthread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RT-Thread on Litex SoC (RISC-V)

Using RT-Thread Nano on a customized LiteX SoC (RISC-V).

Prerequisites

  1. Clone the repo:
$ git clone https://github.com/wuhanstudio/litex-picorv32-rtthread
$ cd litex-picorv32-rtthread
$ git submodule init
$ git submodule update
  1. Install LiteX:
$ mkdir python-litex && cd python-litex
$ wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
$ chmod +x litex_setup.py
$ ./litex_setup.py --init --install --user `whoami` --config=full
$ pip3 install meson sphinx sphinxcontrib-wavedrom

For C development:

$ sudo ./litex_setup.py --gcc=riscv

You can upload bitstream and firmware to Icesugar board using the tool icesprog in side the folder icesugar/tools/.

$ sudo apt install libusb-dev libhidapi-dev 
$ cd litex-picorv32-rtthread
$ sudo cp icesugar/tools/icesprog* /usr/bin/
  1. Install IceStorm:
$ git clone https://github.com/YosysHQ/icestorm.git
$ cd icestorm
$ sudo apt-get install build-essential clang bison flex libreadline-dev \
                     gawk tcl-dev libffi-dev git mercurial graphviz   \
                     xdot pkg-config python python3 libftdi-dev \
                     qt5-default python3-dev libboost-all-dev cmake libeigen3-dev
$ make -j$(nproc)
$ sudo make install
  1. Install Yosys:
$ git clone https://github.com/YosysHQ/yosys.git
$ cd yosys
$ make -j$(nproc)
$ sudo make install
  1. Install Nextpnr:
$ git clone https://github.com/YosysHQ/nextpnr
$ cd nextpnr
$ cmake . -DARCH=ice40
$ make -j$(nproc)
$ sudo make install

LiteX SoC

$ cd litex-soc-icesugar-rust

# This command uses our custom config
$ python3 -m soc.targets.muselab_icesugar --build --doc
$ python3 -m soc.targets.muselab_icesugar --flash

# This command uses the upstream default config
# python3 -m litex_boards.targets.muselab_icesugar --build --doc
# python3 -m litex_boards.targets.muselab_icesugar --flash

C Demo

# This command creates the folder demo that includes the source code
# litex_bare_metal_demo --build-path=./build/muselab_icesugar/

$ cd demo
$ make
$ icesprog -w demo.bin -o 0x40000

RT-Thread Nano (In Progress)

$ cd rtthread-nano
$ make
$ icesprog -w rt-thread.bin -o 0x40000

References

About

RT-Thread on Litex SoC (picorv32)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published