Using RT-Thread Nano on a customized LiteX SoC (RISC-V).
- Clone the repo:
$ git clone https://github.com/wuhanstudio/litex-picorv32-rtthread
$ cd litex-picorv32-rtthread
$ git submodule init
$ git submodule update
- 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/
- 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
- Install Yosys:
$ git clone https://github.com/YosysHQ/yosys.git
$ cd yosys
$ make -j$(nproc)
$ sudo make install
- Install Nextpnr:
$ git clone https://github.com/YosysHQ/nextpnr
$ cd nextpnr
$ cmake . -DARCH=ice40
$ make -j$(nproc)
$ sudo make install
$ 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
# 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
$ cd rtthread-nano
$ make
$ icesprog -w rt-thread.bin -o 0x40000