How to test RTEMS Kendryte K210 BSP using rtems-test

Wednesday, 19 July 2023ยท4 min to read
How to test RTEMS Kendryte K210 BSP using rtems-test

Hi again!

This blog is made to document how to test Kendryte K210 using rtems-test. As a prerequisite, you need to have:

Required Dependency for Renode

Renode requires Mono >= 5.20 (Linux, macOS) or .NET >= 4.7 (Windows).

Linux

Install the mono-complete package as per the installation instructions for various Linux distributions, which can be found on the Mono project website.

macOS

On macOS, the Mono package can be downloaded directly from the Mono project website.

Windows

On Windows 7, download and install .NET Framework 4.7. Windows 10 ships with .NET by default, so no action is required.

Other Dependencies (Linux only)

sudo apt-get install policykit-1 libgtk2.0-0 screen uml-utilities gtk-sharp2 libc6-dev gcc python3 python3-pip

Installing Renode

To install renode, you can download the official package for debian, fedora, arch, macOS, and windows here. Alternatively, you can access Renode's GitHub releases or you can also build it from source.

For RTEMS usage, it is recommended to install it via the RTEMS Source Builder (RSB) because its using a version which has been proven to work with the RTEMS ecosystem. To do so, we can go to the RSB directory and use the following command.

$ cd rtems
$ ../source-builder/sb-set-builder --prefix=$YOUR_PREFIX --trace --bset-tar-file devel/renode

$YOUR_PREFIX is where your build artefact be built. After executing the command, you should be able to run Renode via $YOUR_PREFIX/bin/renode. Also, make sure that you have included the bin path of the prefix to your PATH environment variable. Otherwise, the test will fail later on.

Building Kendryte K210 BSP

To build RTEMS Kendryte K210 BSP, Go to the RTEMS repository directory and create a config.ini file with content as follows.

[riscv/kendrytek210]
RTEMS_SMP        = True

Then, execute the following command to build the BSP.

$ ./waf configure --prefix=$YOUR_PREFIX
$ ./waf build install

That should build all the necessary things to use the BSP.

Testing the BSP

To test the BSP, go to your rtems-tools repository directory and build the repository to the prefix of your choice the same way as we built the BSP.

$ ./waf configure --prefix=$YOUR_PREFIX
$ ./waf build install

Next, we can use rtems-test to test the BSP. The command to test the BSP is as follows.

$ rtems-test --rtems-bsp=kendrytek210-renode  ~/quick-start/src/rtems/build/riscv/kendrytek210/testsuites/

If it is successful, you probably see an output that looks something like this:

RTEMS Testing - Tester, 6.0.not_released
 Command Line: /home/mazaya/quick-start/rtems/6/bin/rtems-test --rtems-bsp=kendrytek210-renode /home/mazaya/quick-start/src/rtems/build/ri
scv/kendrytek210/testsuites/
 Host: Linux mazaya-HP-Spectre-x360-2-in-1-Laptop-14-ef0xxx 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 U
TC 2 x86_64
 Python: 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
Host: Linux-5.19.0-46-generic-x86_64-with-glibc2.35 (Linux mazaya-HP-Spectre-x360-2-in-1-Laptop-14-ef0xxx 5.19.0-46-generic #47~22.04.1-Ub
untu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2 x86_64 x86_64)
[ 3/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: cdtest.exe
[ 2/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: capture.exe
[ 6/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: iostream.exe
[ 1/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: base_sp.exe
[ 4/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: fileio.exe
[11/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: unlimited.exe
[ 5/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: hello.exe
[ 7/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: minimum.exe
[ 8/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: nsecs.exe
[10/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: ticker.exe
[ 9/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: paranoia.exe
[ 1/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: base_sp.exe
[ 2/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: capture.exe
[ 3/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: cdtest.exe
[ 4/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: fileio.exe
[ 5/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: hello.exe
[ 6/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: iostream.exe
[ 7/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: minimum.exe
[ 8/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: nsecs.exe
[ 9/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: paranoia.exe
[10/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: ticker.exe
[11/11] p:0  f:0  u:0  e:0  I:0  B:0  t:0  L:0  i:0  W:0  | riscv/kendrytek210-renode: unlimited.exe

Passed:         6
Failed:         3
User Input:     2
Expected Fail:  0
Indeterminate:  0
Benchmark:      0
Timeout:        0
Test too long:  0
Invalid:        0
Wrong Version:  0
Wrong Build:    0
Wrong Tools:    0
Wrong Header:   0
-----------------
Total:         11
Failures:
 minimum.exe
 nsecs.exe
 paranoia.exe
User Input:
 capture.exe
 fileio.exe
Average test time: 0:00:01.184675
Testing time     : 0:00:13.031424

And that's it! you have tested the Kendryte K210 BSP using rtems-test :)