SINBAD Flight Software, the on board software of NOMAD in ExoMars 2016
M. Carmen Pastor-Morales a , Julio F. Rodr´ıguez-G´ omez a , Rafael Morales-Mu˜ noz a , Juan M.
G´ omez-L´ opez a , Beatriz Aparicio-del-Moral a , Gian Paolo Candini a , Jose M. Jer´ onimo-Zafra a , Jose J. L´ opez-Moreno a , Nicol´ as F. Robles-Mu˜ noz a , Rosario Sanz-Mesa a , Eddy Neefs b , Ann
Carine Vandaele b , Rachel Drummond b , Ian R. Thomas b , Sophie Berkenbosch b , Roland Clairquin b , Sofie Delanoye b , Bojan Ristic b , Jeroen Maes b , Sabrina Bonnewijn b , Manish R.
Patel c , Mark Leese c , Jon P. Mason c , and The NOMAD team.
a Instituto de Astrof´ısica de Andaluc´ıa, IAA-CSIC, Glorieta de la Astronom´ıa, 18008 Granada, Spain;
b Belgian Institute for Space Aeronomy, BIRA-IASB, Ringlaan 3, 1180 Brussels, Belgium;
c The Open University, Milton Keynes, MK7 6AA, UK.
ABSTRACT
The Spacecraft INterface and control Board for NomAD (SINBAD) is an electronic interface designed by the Instituto de Astrof´ısica de Andaluc´ıa (IAA-CSIC). It is part of the Nadir and Occultation for MArs Discovery instrument (NOMAD) on board in the ESA ' s ExoMars Trace Gas Orbiter mission. This mission was launched in March 2016.
The SINBAD Flight Software (SFS) is the software embedded in SINBAD. It is in charge of managing the interfaces, devices, data, observing sequences, patching and contingencies of NOMAD.
It is presented in this paper the most remarkable aspects of the SFS design, likewise the main problems and lessons learned during the software development process.
Keywords: ExoMars, embedded software, flight software, RTEMS, patching
1. INTRODUCTION
The Nadir and Occultation for MArs Discovery instrument (NOMAD), in the ExoMars Trace Gas Orbiter (TGO) 2016 mission, has as goal looking for trace gases, in particular methane, which could be signatures of active biological or geological process in Mars 1 . This instrument is a spectrometer suite that consists of three separate channels, Solar Occultation (SO) 2, 3 , Limb Nadir and Occultation (LNO) 2, 3 , and Ultraviolet and VISible Spectrometer (UVIS) 4 .
The Spacecraft INterface and control Board for NomAD (SINBAD) is the module in charge of managing the power and the communication with the TGO spacecraft for the NOMAD instrument.
The SINBAD Flight Software (SFS) is the software implemented in SINBAD, which controls the NOMAD instrument. It main tasks have been defined as follows:
• Manage the communication with TGO spacecraft. These interfaces are implemented by a MIL- STD-1553B bus for telecommands and housekeeping transmission, and a Spacewire 5 bus for science data transmission.
• Control the observing sequence of the NOMAD channels. When an observation is commanded, the SFS sends the relative set of parameters to the channels to perform the observations and afterwards, it reads the data produced. These data are sending later to the spacecraft. SINBAD stores the observation parameters in the on board memory in Channel Observation Parameters (COP) tables.
[email protected], phone: +34958230652, web: www.iaa.es
Power Main Power Red.
Survival HTRs Main
Survival HTRs Red.
Operational HTRs
DC/DCs Module
MIL-STD-1553B Address
MIL-STD-1553B
4
4 SpW Main
SpW Red.
Power board
st
Communication
Board "-
NOMAD
UVIS channel
SO
channel
LNO channe
- Flip
Mirror
Test Port
• Control of system devices: SFS controls the LNO flip mirror and the operational heaters, and reads the magnitudes of the temperature, current consumption and voltage from the system sensors.
• Patch software and data. SFS is able to patch or update code and data in the system memory during flight.
• Implement the NOMAD contingency and recovery plan. This plan is designed in order to detect problems and recover the instrument autonomously under certain circumstances.
1.1 NOMAD description
NOMAD is composed of SINBAD, the three channels (SO, LNO and UVIS), a mechanical structure and two thermal control systems. These last are a survival heater (under the control of the spacecraft) and an operational heater (under the control of SINBAD). See Figure 1.
Figure 1. NOMAD block diagram
NOMAD external interfaces are used in the communication with the TGO spacecraft. There are two different communication standards for these interfaces, a MIL-STD-1553B bus and a Spacewire bus. The instrument has also an external connector that configures the MIL-STD-1553B bus address for NOMAD and a test port.
SINBAD consists of two boards, a communication board and a power board. The power board is in charge of receiving, adjusting and distributing power to all the modules of the system and the communication board implements the communications and control of the NOMAD instrument.
The communication board contains two FPGAs, a main one called Shireen and a secondary one called Chimera, see Figure 2. Shireen implements a fault tolerant IP core of the Leon 3 processor (SPARC V8 architec- ture of 32 bits) running at 25 MHz and different IP cores to manage several functions. The arbiter between these IP cores is a standard bus AMBA. This FPGA has also two RS-422 interfaces: one for communicating with UVIS channel and other for testing and debugging purposes. It also has a RS-232 port for the debug support unit of the Leon 3 processor (DSU). Furthermore it has a GPIO interface with 16 I/O lines used for different purposes:
read the MIL-STD-1553B bus address connector, control LNO flip mirror mechanism and handle chimera error
registers.
SHIREEN FPGA
Spacewire
Gaisler Spacewire
IP core
MI L- STD -1553 -B
UVIS channel
SO channel
Gaisler MIL -1553 -B
IP core
Gaisler
GPIO 1
IP core Gaisler FT
memory controller
RS -422 Test Port TCs Science & HK TMs
TCs
Gaisler APB UART IP core RS-422
UVIS DSU
-} MRAM,1
LNO channel
Scien & HK data
TCs
Scien :e & HK data
SO /LNO Interface
I/O module Hardware control
CHIMERA FPGA SINBAD Communication board
This board also has a memory bus interface with three blocks: an Electrically Erasable Programmable Read- Only Memory (EEPROM), a Magneto-resistive Random-Access Memory (MRAM) and finally the I/O module.
Shireen and Chimera are connected through this I/O memory module.
Part of the I/O module is allocated for three FIFO memory areas, which are used to send telecommands and to receive science and housekeeping data from SO and LNO channels. Other part of the IO module is used to manage several system devices: LNO flip mirror (stepper motor and pin puller), sensors (read through ADCs), operational heaters, power control, chimera error and system reset registers.
Figure 2. SINBAD Communication board interfaces
1.2 Communication between TGO spacecraft and NOMAD
To operate the instrument, the spacecraft sends telecommands (TCs) to NOMAD through the MIL-STD-1553B bus. The maximum size of a TC is 64 bytes (B) and the limit number of TCs per instrument in an operation cycle (5 days) is 750 TCs. NOMAD sends to the spacecraft data packets called telemetries (TMs). Depending of its type a TM can be sent through MIL-STD-1553B or Spacewire, see Table 1.
TCs and TMs are gathered by activities:
• Housekeeping activities. TMs in this activity are used to report instrument status. NOMAD house- keeping (HK) and event TMs contain information about contingencies, packets, patches, etc. Channels HK TMs include values from channels environmental information. The HK data are transmitted to the spacecraft every 30 seconds.
• Science data activities. TC and TMs in this activity are used to schedule and deliver science data to the spacecraft.
• Memory management activities. These TCs and TMs are used to update, download, patch or check
data in memory.
Table 1. NOMAD telecommands and telemetries for communication with the TGO spacecraft
Housekeeping Bus
TM(10) Event MIL-STD-1553B
TM(11) NOMAD HK 1 MIL-STD-1553B
TM(12) NOMAD HK 2 MIL-STD-1553B
TM(13) NOMAD HK 3 MIL-STD-1553B
TM(23) SO HK MIL-STD-1553B
TM(26) LNO HK MIL-STD-1553B
TM(29) UVIS HK MIL-STD-1553B and Spacewire
Science data activity Bus
TC(20) Start operation MIL-STD-1553B
TM(22) SO Science Spacewire
TM(25) LNO Science Spacewire
TM(27) UVIS Applied parameters Spacewire
TM(28) UVIS Science Spacewire
Memory management Bus
TC(30) Patch memory MIL-STD-1553B
TC(31) Dump memory MIL-STD-1553B
TM(32) Dump memory report MIL-STD-1553B
TC(33) Check memory MIL-STD-1553B
TM(34) Check memory report MIL-STD-1553B TC(35) File manager operation MIL-STD-1553B TM(36) File manager operation report MIL-STD-1553B TM(37) File manager download file report Spacewire
Mode change Bus
TC(40) Safe Mode MIL-STD-1553B
Power Bus
TC(50) Ready to power off MIL-STD-1553B
System log Bus
TM(60) System log Spacewire
General Bus
TC(70) Custom command MIL-STD-1553B
• Mode change activity. This TC sets the instrument in safe mode.
• Power TC activities. This TC is used to inform the instrument that must be ready to be powered off after one second.
• System log activities. This TM stores all the relevant system information.
• General activities. This TC is used to command special control operations: command LNO flip mirror
position, fire LNO pin puller and force/unforce operational heater to power on.
NOMAD OLLWd
Boot loader SINBAD Flight Software (SFS)
RTEMS 4.10 Buses drivers
1.3 NOMAD software
The NOMAD software consists of two separate programs, the Boot loader and the SINBAD Flight Software (SFS), see Figure 3.
Figure 3. NOMAD software
The company Aeroflex-Gaisler provides the utility program MKPROM2. It is used to create boot-images for programs compiled with the C Cross-compiler BCC or the RTEMS cross-compiler RCC (www.gaisler.com/index.
php/downloads/compilers). This program encapsulates the application in a loader suitable to be placed in a boot PROM.
The boot loader of the NOMAD software contains the MKPROM2 code with some modification done at IAA to adapt the program to the project requirements (see Section 4.3: Errors at boot). This program is in charge of loading a SFS version to the execution area (see Figure 6: SINBAD memory map).
The SFS has been developed by the IAA, in C language, over a tailored version of the Real-Time Executive for Multiprocessor Systems RTEMS 4.10 (www.rtems.org), provided by Aeroflex-Gaisler. RTEMS is an open source Real Time Operating System (RTOS) that is thoroughly used in space embedded systems.
The SFS also uses some RTEMS drivers developed by Aeroflex-Gaisler: MIL-STD-1553-B, Spacewire and GPIO drivers. Part of these drivers code has been modified and adapted by the IAA to the project requirements.
2. SOFTWARE DESIGN AND DEVELOPMENT
This section describes the tools used during the software development and the most significant aspects of the software design.
2.1 Software development environment
The development environment of the SFS consists of the following tools:
• Laboratory EGSE: the IAA Laboratory EGSE (LEGSE) is a spacecraft simulator implemented by the IAA to test the SINBAD subsystem. It is composed of a computer that incorporates the following interfaces:
MIL-STD-1553B, Spacewire, SINBAD test port and Leon DSU. Spacecraft buses interfaces were validated against a TGO simulator provided by ESA. The LGSE runs openSUSE 12.3, 64-bits and a software to simulate the TGO spacecraft behavior developed by the IAA. The main purposes of this software are the execution of test scripts and the storage of the generated traffic in log and data files to be analyzed. During the validation campaign the LEGSE has been used to automatize the SFS tests.
• MIL-STD-1553B and Spacewire break-out boxes: two break out boxes developed at IAA to analyze the buses signals.
• Spacewire conformance tester: this tool executes a variety of tests to check that the unit under test,
SINBAD in this case, is compliant to the Spacewire standard.
Software layers
Hardware &
firmware layers
I
Managers
SINBAD
flight software User Drivers
Operating System & Drivers
IP cores Firmware
HW devices External devices
• Software development tools: the integrated development environment Eclipse CDT Helios (eclipse.
org/downloads/packages/heliossr2) and compilers: the LEON C/C++ IDE for Eclipse LIDE, the Bare- C Cross-compiler system BCC and the RTEMS Cross-compiler system RCC (www.gaisler.com/index.php/
products/compilers). The debug monitor for LEON processors GRMON (www.gaisler.com/index.php/
products/debug-tools/grmon) and the boot prom builder MKPROM2 (http://www.gaisler.com/index.
php/downloads/compilers).
• Software quality and management tools: the version control system Git (git-scm.com), the project management web application Redmine (www.redmine.org), the programmable tool for verification of coding standards Vera ++ (bitbucket.org/verateam/vera/wiki/Home) and the Source Monitor tool (www.campwoodsw.com/sourcemonitor.html) to analyze how much code has a program and its relative complexity. To generate the code coverage of the SFS have been used the following tools: the Leon computer simulator TSIM (www.gaisler.com/index.php/products/simulators/tsim), the RTEMS Cov- erage Analysis tool Covoar (devel.rtems.org/wiki/TBR/UserManual/RTEMS_Coverage_Analysis) and the program for analyzing the code coverage Gcov (gcc.gnu.org/onlinedocs/gcc/Gcov.html).
2.2 Software architecture
This section describes the architecture used to design the SFS and its relation with hardware components, see Figure 4.
Figure 4. Scheme of system layers
The lowest layer gathers hardware devices, e.g. channels, LNO flip mirror, etc. The second layer contains the IP cores implemented in the firmware of the FPGA. These IP cores have been also considered as hardware devices.
The operating system, drivers and managers are compiled in a single executable file, the SINBAD Flight Software.
The operating system layer contains the operating system (OS) and the low level drivers. These drivers implement the logic to communicate the OS and the IP cores, providing an API to be used by the upper layers.
The user drivers layer is composed of modules that build wrapper functions for OS drivers. These units configure the high level parameters of the hardware devices.
The managers layer contains the software modules in charge of implementing the SFS high level logic. These modules utilize the user drivers from the lower layer to handle system devices. Moreover the managers implement the necessary functions to complete the behavior of the system. They are:
• Main manager: creates and initializes all managers in the system, stores log information about the SFS initialization, checks watchdog information and commands the first HK generation.
• MIL-STD-1553B manager: configures and implements the access to the MIL-STD-1553B bus.
• Spacewire manager: configures and implements the access to the Spacewire bus.
• TC manager: receives TCs from MIL-STD-1553B manager and dispatches them to relevant manager.
• TM manager: receives all TMs generated in the system and dispatches them to be send to the relevant bus manager.
• HK manager: gathers system information and generates HK, events an reports TMs. It updates HK values every 30 seconds.
• SO/LNO manager: handles SO and LNO channel activities.
• UVIS manager: handles UVIS channel activities.
• System logger manager: gathers messages produced by other managers. When these messages reach a defined size (or by a timeout) they are compressed and send in a TM System log.
• File manager: configures and implements the access to the file system.
• Operational mode manager: implements the relevant actions during mode changes. The operational modes of NOMAD are: Safe mode, Observing mode and Power off. This last one is not actually a mode, it is only a state where NOMAD have not power.
• Chimera manager: is in charge of the initialization of Chimera registers.
• Sensor manager: reads the NOMAD sensors values. It also detects sensor contingencies in case that some of the sensor is out of the security ranges.
• Flip mirror manager: handles the operation of the LNO flip mirror.
• Contingency and recovery manager: implements and controls the contingencies and associated recov- ery actions of the system.
• Mission clock manager: updates the mission clock of the system. The mission time is transmitted from the spacecraft through the MIL-STD-1553B bus.
• Watchdog manager: refreshes the watchdog register and analyses watchdog error, if any, after booting.
• Trap manager: implements a handler for the system traps as part of the Contingency and recovery plan of the instrument.
2.3 Observation procedure
One of the main tasks of the SFS is to manage the communication with the spacecraft and control the observation sequence of the channels. The packets involved in this procedure are dispatched by several managers, which use queues to control the data flow, see Figure 5.
The data flow from the spacecraft starts when a TC Start observation (see Table 1: NOMAD telecommands and telemetries for communication with the TGO spacecraft) arrives to the instrument. First of all it is handled by the MIL-STD-1553B manager which sends the packet to a queue in the TC manager. This manager checks the header and checksum and, if everything is correct, sends the packet to the Observation manager.
The Observation manager commands the observation tasks to the channels managers.
The channels managers analyze the commanded values and obtain the relevant parameters from Channel Observation Parameters (COP) tables (see Section 2.6: Channel observation parameters tables). During the observation, each channel manager gathers the data received from the channel, builds packets if it is necessary (this is done for SO and LNO channel, for UVIS, the SFS only checks the packet checksum) and sends them to the TM manager queue.
The TM manager analyses the headers of the packets in its queue and, depends on the telemetry type, it sends them to the HK manager or to the Spacewire manager.
The HK manager gathers the HK information and transmits it to the MIL-STD-1553B manager.
The packets are finally transmitted to the spacecraft from the buses managers.
TC start
TMs
MIL -STD- 1553B manager
TC
Spacewire
manager t TMs
TC manager
-.E111 13
HK
HK manager HKt
TM manager
-.E] UA.-
TC
t
TC
Observation manager
TC Science &
Channel HK TMs
SO /LNO manager
UVIS manager
SFS
SO/LNO TC
SO /LNO Science &
HK
SO /LNO channel
UVIS TC
UVIS Science &
_