NOEL-ARTYA7-EX-QSG
December 2020, Version 1.2
13
www.cobhamaes.com/gaisler
5. RTEMS Real Time Operating System
5.1. Overview
RTEMS is a real time operating system that supports many processor families [RD-3]. Cobham Gaisler distributes
a precompiled RTEMS toolchain for NOEL-V. This section gives the reader a brief introduction on how to use
RTEMS together with the NOEL-ARTYA7-EX design. It will be demonstrated how to install the toolchain and
build an existing sample RTEMS project and run it on the board using GRMON.
The NOEL-V RTEMS distribution includes a prebuilt toolchain with GNU Binutils, GCC and Newlib. The sup-
ported host operating system is Linux. It also contains prebuilt RTEMS kernels for the NOEL-V, including 32-bit
and 64-bit versions. Support is included for the NOEL-ARTYA7-EX interrupt controller, timer and UART.
Sample RTEMS projects are available within the toolchain package, installed in the
examples
directory.
5.2. Features
• Kernel:
• BSP variants for
rv32i
,
rv32im
,
rv32ima
,
rv32imafd
,
rv64im
,
rv64ima
and
rv64imafd
.
• Uni-processor and SMP kernels available.
• RTEMS POSIX support
• Based on RTEMS master as of June 2020. (Exact
rtems.git
commit hash can be found in the
README
file in the root directory of the toolchain distribution.)
• NOEL-V BSP
• Console driver for APBUART
• Interrupt controller (PLIC and CLINT)
• Clock driver via CLINT
mtime
• GCC 9.3.0
5.3. Install toolchain and kernel
The toolchain and source can be downloaded from https://www.gaisler.com/NOEL-ARTYA7.
First extract the toolchain and kernel archive into
/opt
. In order for the compiler to be found, the binary directory
/opt/rtems-noel-1.0.4/bin
has to be added to the
PATH
variable as below:
$ cd /opt
$ tar xf rtems-noel-1.0.4.tar.bz2
$ export PATH=$PATH:/opt/rtems-noel-1.0.4/bin
5.4. Building an RTEMS sample application
Once the toolchain is set up, you can compile and link a sample RTEMS application by doing:
$ cd /opt/rtems-noel-1.0.4/examples/hello
$ make
riscv-rtems5-gcc --pipe -march=rv64ima -mabi=lp64 \
-B/opt/rtems-noel-1.0.4/kernel/riscv-rtems5/noel64ima/lib \
-specs bsp_specs -qrtems -c test.c -o test.o
riscv-rtems5-gcc --pipe -march=rv64ima -mabi=lp64 \
-B/opt/rtems-noel-1.0.4/kernel/riscv-rtems5/noel64ima/lib \
-specs bsp_specs -qrtems -Wl,--gc-sections test.o -o hello.exe
The default load address is at the start of the RAM, i.e.
0x00000000
.
See Chapter 8 for more information on the available examples.
5.5. Running and debugging with GRMON
Once your executable is compiled, connect to your NOEL-ARTYA7-EX with GRMON. The following log shows
how to load and run an executable. Note that the console output is redirected to GRMON by the use of the
-u