Single repo containing both picorv32 and RT-Thread is available here: https://github.com/wuhanstudio/picorv32_tang
\ | /
- RT - Thread Operating System
/ | \ 3.1.3 build Nov 25 2020
2006 - 2019 Copyright by rt-thread team
Hello RT-Thread!
msh >
This repo aims to run RT-Thread (RTOS) on Picorv32 soft core (荔枝糖 EG4S20 FPGA).
Picorv32 is an open source RISC-V CPU core, and RT-Thread is a burgeoning Real-Time Operating System (RTOS) in China that is small, stable and fast.
This repo consists of two sub-repos. One is the FPGA soft core (picorv32), and the other is the firmware (RT-Thread).
$ git clone https://github.com/wuhanstudio/picorv32_tang
$ cd picorv32_tang
$ git submodule init
$ git submodule update
First, let's build the RT-Thread operating system. The tool chain required for compilation is riscv32-unknown-elf-gcc. You may find this tutorial helpful.
$ cd rtthread-nano/rt-thread/bsp/picorv32_blink/
$ mkdir build & cd build
$ cmake ../
$ make
Now you should have rt-thread.bin.
We use MIF to initialize ROM, so let's convert bin to mif.
# Copy generated rt-thread.bin out.
$ cp rtthread-nano/rt-thread/bsp/picorv32_blink/build/rt-thread.bin bin2mif/
$ cd bin2mif
# Generate MIF
$ python3 bin2mif.py rt-thread.bin rt-thread.mif
Then copy generated rt-thread.mif to FPGA project directory:
$ cp bin2mif/rt-thread.mif picorv32_EG4S20/firmware/
Now, let's make things work on FPGA. The IDE can be downloaded here, and instructions on how to install it can be found here.
Click on Generate Bitstream, then choose download to flash the bitstream to your board.
- PLL
- SDRAM
- ROM
- UART