|  | 
|  | 1 | +# `armv7-rtems-eabihf` | 
|  | 2 | + | 
|  | 3 | +**Tier: 3** | 
|  | 4 | + | 
|  | 5 | +ARM targets for the [RTEMS realtime operating system](https://www.rtems.org)  using the RTEMS gcc cross-compiler for linking against the libraries of a specified Board Support Package (BSP). | 
|  | 6 | + | 
|  | 7 | +## Target maintainers | 
|  | 8 | + | 
|  | 9 | +- [@thesummer](https://github.com/thesummer) | 
|  | 10 | + | 
|  | 11 | +## Requirements | 
|  | 12 | + | 
|  | 13 | +The target does not support host tools. Only cross-compilation is possible. | 
|  | 14 | +The cross-compiler toolchain can be obtained by following the installation instructions | 
|  | 15 | +of the [RTEMS Documentation](https://docs.rtems.org/branches/master/user/index.html). Additionally to the cross-compiler also a compiled BSP | 
|  | 16 | +for a board fitting the architecture needs to be available on the host. | 
|  | 17 | +Currently tested has been the BSP `xilinx_zynq_a9_qemu` of RTEMS 6. | 
|  | 18 | + | 
|  | 19 | +`std` support is available, but not yet fully tested. Do NOT use in flight software! | 
|  | 20 | + | 
|  | 21 | +The target follows the EABI calling convention for `extern "C"`. | 
|  | 22 | + | 
|  | 23 | +The resulting binaries are in ELF format. | 
|  | 24 | + | 
|  | 25 | +## Building the target | 
|  | 26 | + | 
|  | 27 | +The target can be build by the standard compiler of Rust. | 
|  | 28 | +## Building Rust programs | 
|  | 29 | + | 
|  | 30 | +Rust does not yet ship pre-compiled artifacts for this target. To compile for | 
|  | 31 | +this target, you will either need to build Rust with the target enabled (see | 
|  | 32 | +"Building the target" above), or build your own copy of `core` by using | 
|  | 33 | +`build-std` or similar. | 
|  | 34 | + | 
|  | 35 | +In order to build an RTEMS executable it is also necessary to have a basic RTEMS configuration (in C) compiled to link against as this configures the operating system. | 
|  | 36 | +An example can be found at this [`rtems-sys`](https://github.com/thesummer/rtems-sys) crate which could be added as an dependency to your application. | 
|  | 37 | + | 
|  | 38 | +## Testing | 
|  | 39 | + | 
|  | 40 | +The resulting binaries run fine on an emulated target (possibly also on a real Zedboard or similar). | 
|  | 41 | +For example, on qemu the following command can execute the binary: | 
|  | 42 | +``` | 
|  | 43 | +$ qemu-system-arm -no-reboot -serial null -serial mon:stdio -net none -nographic -M xilinx-zynq-a9 -m 512M -kernel <binary file> | 
|  | 44 | +``` | 
|  | 45 | + | 
|  | 46 | +While basic execution of the unit test harness seems to work. However, running the Rust testsuite on the (emulated) hardware has not yet been tested. | 
|  | 47 | + | 
|  | 48 | +## Cross-compilation toolchains and C code | 
|  | 49 | + | 
|  | 50 | +Compatible C-code can be built with the RTEMS cross-compiler toolchain `arm-rtems6-gcc`. | 
|  | 51 | +For more information how to build the toolchain, RTEMS itself and RTEMS applications please have a look at the [RTEMS Documentation](https://docs.rtems.org/branches/master/user/index.html). | 
0 commit comments