|
| 1 | +--- |
| 2 | +sys: rtthread |
| 3 | +sys_ver: 5.2.0 |
| 4 | +sys_var: smart |
| 5 | + |
| 6 | +status: basic |
| 7 | +last_update: 2024-11-28 |
| 8 | +--- |
| 9 | + |
| 10 | +# RT-Thread Milk-V DuoS Test Report |
| 11 | + |
| 12 | +## Test Environment |
| 13 | + |
| 14 | +### Operating System Information |
| 15 | + |
| 16 | +- Source Code Link: |
| 17 | + - https://github.com/RT-Thread/rt-thread |
| 18 | + - https://github.com/RT-Thread/userapps |
| 19 | +- Reference Installation Document: https://github.com/RT-Thread/rt-thread/tree/master/bsp/cvitek |
| 20 | + - Toolchain: https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2 |
| 21 | + |
| 22 | +### Hardware Information |
| 23 | + |
| 24 | +- Milk-V DuoS |
| 25 | +- A USB-A to C or USB C to C Cable |
| 26 | +- A microSD Card |
| 27 | +- A USB to UART Debugger (e.g., CH340, CH341, FT2232, etc.) |
| 28 | + |
| 29 | +## Installation Steps |
| 30 | + |
| 31 | +The following steps are tested on Arch Linux, but should be applicable to all major Linux distributions. |
| 32 | + |
| 33 | +### Fetch Source Code and Compile Firmware |
| 34 | + |
| 35 | +Obtain the toolchain and configure it: |
| 36 | +```bash |
| 37 | +wget https://github.com/RT-Thread/toolchains-ci/releases/download/v1.7/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2 |
| 38 | + |
| 39 | +tar -xjvf riscv64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2 |
| 40 | +``` |
| 41 | + |
| 42 | +Update the following paths as needed: |
| 43 | +```bash |
| 44 | +export RTT_CC_PREFIX=riscv64-unknown-linux-musl- |
| 45 | +export RTT_EXEC_PATH=/opt/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu/bin |
| 46 | +``` |
| 47 | + |
| 48 | +Fetch dependencies: |
| 49 | +```bash |
| 50 | +sudo apt install -y scons libncurses5-dev device-tree-compiler |
| 51 | +# or on Arch Linux: sudo pacman -S scons dtc ncurses |
| 52 | +``` |
| 53 | + |
| 54 | +```bash |
| 55 | +git clone --depth=1 https://github.com/RT-Thread/rt-thread |
| 56 | +cd rt-thread/bsp/cvitek/cv18xx_risc-v |
| 57 | +# Generate configuration |
| 58 | +scons --menuconfig |
| 59 | +``` |
| 60 | + |
| 61 | +In menuconfig, please select `milkv-duos` under the `Board Type` option. Enter `RT-Thread Kernel` submenu ---> Select `Enable RT-Thread Smart (microkernel on kernel/userland)` to enable the RT-Smart kernel. |
| 62 | + |
| 63 | +```bash |
| 64 | +source ~/.env/env.sh |
| 65 | +pkgs --update |
| 66 | +scons -j$(nproc) --verbose |
| 67 | +cd ../ |
| 68 | +./combine-fip.sh $(pwd)/cv18xx_risc-v Image |
| 69 | +``` |
| 70 | + |
| 71 | +`boot.sd` and `fip.bin` files will be generated in the `cvitek/output/milkv-duos-sd` directory upon completion. |
| 72 | + |
| 73 | +### Fetch Source Code and Compile RT-Smart userapps |
| 74 | + |
| 75 | +Fetch dependencies: |
| 76 | +```bash |
| 77 | +sudo apt install -y unzip xmake |
| 78 | +``` |
| 79 | + |
| 80 | +Compile: |
| 81 | +```bash |
| 82 | +git clone https://github.com/RT-Thread/userapps.git |
| 83 | +cd userapps |
| 84 | +source env.sh |
| 85 | +cd apps |
| 86 | +xmake f -a riscv64gc |
| 87 | +xmake -j$(nproc) |
| 88 | +``` |
| 89 | + |
| 90 | +Build Image: |
| 91 | +```bash |
| 92 | +xmake smart-rootfs |
| 93 | +xmake smart-image -f ext4 |
| 94 | +``` |
| 95 | +The userapp image would be generated at `userapps/apps/build/ext4.img`. |
| 96 | + |
| 97 | +### Prepare microSD Card |
| 98 | + |
| 99 | +Clear the microSD card and create a FAT32 partition: |
| 100 | +```shell |
| 101 | +wipefs -af /path/to/your-card |
| 102 | +mkfs.fat /path/to/your-card |
| 103 | +``` |
| 104 | + |
| 105 | +Copy the generated `boot.sd` and `fip.bin` files onto the microSD card. The storage card is now ready to boot RT-Smart on the DuoS. |
| 106 | + |
| 107 | +### Logging into the System |
| 108 | + |
| 109 | +Log into the system via the serial port. |
| 110 | + |
| 111 | +## Expected Results |
| 112 | + |
| 113 | +The system boots up normally and allows access through the serial port. |
| 114 | + |
| 115 | +## Actual Results |
| 116 | + |
| 117 | +The system boots up normally and allows access through the serial port. |
| 118 | + |
| 119 | +### Boot Log |
| 120 | + |
| 121 | +Screencast (from compile to boot): |
| 122 | +[](https://asciinema.org/a/WF4Ves2YpwbHHUMLnmQPtPtBb) |
| 123 | + |
| 124 | +```log |
| 125 | +Starting kernel ... |
| 126 | +
|
| 127 | +[I/drv.pinmux] Pin Name = "UART0_RX", Func Type = 281, selected Func [0] |
| 128 | +
|
| 129 | +[I/drv.pinmux] Pin Name = "UART0_TX", Func Type = 282, selected Func [0] |
| 130 | +
|
| 131 | +heap: [0x0xffffffc0002fb110 - 0x0xffffffc000afb110] |
| 132 | +
|
| 133 | + \ | / |
| 134 | +- RT - Thread Smart Operating System |
| 135 | + / | \ 5.2.0 build Nov 28 2024 11:29:57 |
| 136 | + 2006 - 2024 Copyright by RT-Thread team |
| 137 | +lwIP-2.1.2 initialized! |
| 138 | +[I/sal.skt] Socket Abstraction Layer initialize success. |
| 139 | +[I/drivers.serial] Using /dev/ttyS0 as default console |
| 140 | +Hello RT-Smart! |
| 141 | +
|
| 142 | +``` |
| 143 | + |
| 144 | +## Test Criteria |
| 145 | + |
| 146 | +Successful: The actual result matches the expected result. |
| 147 | + |
| 148 | +Failed: The actual result does not match the expected result. |
| 149 | + |
| 150 | +## Test Conclusion |
| 151 | + |
| 152 | +Test successful. |
0 commit comments