Merge pull request 'Restructured a little bit' (#4) from mueller/master into master
Reviewed-on: eive/eive_obsw#4
This commit is contained in:
commit
e97ecbf335
8
Makefile
8
Makefile
@ -22,7 +22,7 @@ CUSTOM_DEFINES += -DLINUX
|
|||||||
# General folder paths
|
# General folder paths
|
||||||
FRAMEWORK_PATH = fsfw
|
FRAMEWORK_PATH = fsfw
|
||||||
MISSION_PATH = mission
|
MISSION_PATH = mission
|
||||||
CONFIG_PATH = config
|
CONFIG_PATH = fsfwconfig
|
||||||
TEST_PATH = test
|
TEST_PATH = test
|
||||||
UNITTEST_PATH = unittest
|
UNITTEST_PATH = unittest
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ endif
|
|||||||
BUILDPATH = _bin
|
BUILDPATH = _bin
|
||||||
DEPENDPATH = _dep
|
DEPENDPATH = _dep
|
||||||
OBJECTPATH = _obj
|
OBJECTPATH = _obj
|
||||||
ifeq ($(MAKECMDGOALS),release)
|
ifeq ($(MAKECMDGOALS), release)
|
||||||
BUILD_FOLDER = mission
|
BUILD_FOLDER = mission
|
||||||
else
|
else
|
||||||
BUILD_FOLDER = devel
|
BUILD_FOLDER = devel
|
||||||
@ -70,7 +70,11 @@ CLEANBIN2 = $(BUILDPATH)/$(OUTPUT_FOLDER)/devel
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Tool suffix when cross-compiling
|
# Tool suffix when cross-compiling
|
||||||
|
ifdef HOST_LINUX
|
||||||
|
CROSS_COMPILE =
|
||||||
|
else
|
||||||
CROSS_COMPILE = arm-linux-gnueabihf-
|
CROSS_COMPILE = arm-linux-gnueabihf-
|
||||||
|
endif
|
||||||
|
|
||||||
ifdef WINDOWS
|
ifdef WINDOWS
|
||||||
# C Compiler
|
# C Compiler
|
||||||
|
@ -58,7 +58,7 @@ endif
|
|||||||
# General folder paths
|
# General folder paths
|
||||||
FRAMEWORK_PATH = fsfw
|
FRAMEWORK_PATH = fsfw
|
||||||
MISSION_PATH = mission
|
MISSION_PATH = mission
|
||||||
CONFIG_PATH = $(BOARD_FILE_ROOT)/config
|
CONFIG_PATH = $(BOARD_FILE_ROOT)/fsfwconfig
|
||||||
TEST_PATH = test
|
TEST_PATH = test
|
||||||
UNITTEST_PATH = unittest
|
UNITTEST_PATH = unittest
|
||||||
|
|
||||||
|
128
README.md
128
README.md
@ -1,6 +1,9 @@
|
|||||||
# <a id="top"></a> <a name="linux"></a> EIVE On-Board Software
|
# <a id="top"></a> <a name="linux"></a> EIVE On-Board Software
|
||||||
|
|
||||||
## General information
|
## General information
|
||||||
|
|
||||||
|
Target systems:
|
||||||
|
|
||||||
* OBC
|
* OBC
|
||||||
* Xiphos Q7S
|
* Xiphos Q7S
|
||||||
* Based on Zynq-7020 SoC (xc7z020clg484-2)
|
* Based on Zynq-7020 SoC (xc7z020clg484-2)
|
||||||
@ -12,24 +15,36 @@
|
|||||||
* Linux OS
|
* Linux OS
|
||||||
* Built with Yocto 2.5
|
* Built with Yocto 2.5
|
||||||
* Linux Kernel https://github.com/XiphosSystemsCorp/linux-xlnx.git
|
* Linux Kernel https://github.com/XiphosSystemsCorp/linux-xlnx.git
|
||||||
|
* Host System
|
||||||
|
* Generic software components which are not dependant on hardware can also
|
||||||
|
be run. All host code is contained in the hosted folder
|
||||||
|
* Tested for Linux (Ubuntu 20.04) and Windows 10
|
||||||
|
|
||||||
|
|
||||||
## Setting up development environment
|
## Setting up development environment
|
||||||
* Install Vivado 2018.2 and Xilinx SDK from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html
|
* Install Vivado 2018.2 and Xilinx SDK from https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/vivado-design-tools/archive.html.
|
||||||
|
Install the Vivado Design Suite - HLx Editions - 2018.2 Full Product Installation instead of the updates. It is recommended to use the installer
|
||||||
|
* Install settings. In the Devices selection, it is sufficient to pick SoC → Zynq-7000: <br>
|
||||||
|
<img src="./doc/img/xilinx-install.PNG" width="50%"> <br>
|
||||||
* For supported OS refer to https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug973-vivado-release-notes-install-license.pdf
|
* For supported OS refer to https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_2/ug973-vivado-release-notes-install-license.pdf
|
||||||
* Add path of linux cross-compiler to environment variables SDK\2018.2\gnu\aarch32\nt\gcc-arm-linux-gnueabi\bin
|
* Add path of linux cross-compiler to environment variables SDK\2018.2\gnu\aarch32\nt\gcc-arm-linux-gnueabi\bin
|
||||||
* Install make (only on windows, SDK on Linux can use the make installed with the SDK)
|
* Install make (only on windows, SDK on Linux can use the make installed with the SDK)
|
||||||
1. Install NodeJS LTS
|
|
||||||
2. Install xpm
|
|
||||||
````
|
|
||||||
npm install --global xpm
|
|
||||||
````
|
|
||||||
3. Install Windows build tools (after installation also linux commands like mkdir can be used from windows)
|
|
||||||
````
|
|
||||||
xpm install --global @xpack-dev-tools/windows-build-tools@latest
|
|
||||||
````
|
|
||||||
|
|
||||||
### Building the software
|
### Installing make on Windows
|
||||||
|
1. Install NodeJS LTS
|
||||||
|
2. Install xpm
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install --global xpm
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Install Windows build tools (after installation also linux commands like mkdir can be used from windows)
|
||||||
|
|
||||||
|
```sh
|
||||||
|
xpm install --global @xpack-dev-tools/windows-build-tools@latest
|
||||||
|
```
|
||||||
|
|
||||||
|
## Building the software
|
||||||
|
|
||||||
1. Clone the repository with
|
1. Clone the repository with
|
||||||
```sh
|
```sh
|
||||||
@ -43,21 +58,23 @@ git submodule sync
|
|||||||
git submodule update
|
git submodule update
|
||||||
```
|
```
|
||||||
|
|
||||||
4. Open Xilinx SDK 2018.2
|
3. Open Xilinx SDK 2018.2
|
||||||
5. Import project
|
4. Import project
|
||||||
* File → Import → C/C++ → Existing Code as Makefile Project
|
* File → Import → C/C++ → Existing Code as Makefile Project
|
||||||
6. Set build command
|
5. Set build command. Replace \<target\> with either debug or release.
|
||||||
* When on Linux right click project → Properties → C/C++ Build → Set build command to make -j
|
* When on Linux right click project → Properties → C/C++ Build → Set build command to `make <target> -j`
|
||||||
* -j causes the compiler to use all available cores
|
* -j causes the compiler to use all available cores
|
||||||
* On windows create a make target (Windows → Show View → Make Target)
|
* The target is used to either compile the debug or the optimized release build.
|
||||||
|
* On windows create a make target additionally (Windows → Show View → Make Target)
|
||||||
* Right click eive_obsw → New
|
* Right click eive_obsw → New
|
||||||
* Target name: all
|
* Target name: all
|
||||||
* Uncheck "Same as the target name"
|
* Uncheck "Same as the target name"
|
||||||
* Uncheck "Use builder settings"
|
* Uncheck "Use builder settings"
|
||||||
* As build command type: <path to make>\make -j all WINDOWS=1
|
* As build command type: `make -j <target> WINDOWS=1`
|
||||||
7. Run build command (double click the generated target)
|
6. Run build command by double clicking the created target or by right clicking
|
||||||
|
the project folder and selecting Build Project.
|
||||||
|
|
||||||
### Debugging the software (when workstation is directly conncected to Q7S)
|
## Debugging the software (when workstation is directly conncected to Q7S)
|
||||||
1. Assign static IP address to Q7S
|
1. Assign static IP address to Q7S
|
||||||
* Open serial console of Q7S (Accessible via the micro-USB of the PIM, see also Q7S user maunal chapter 10.3)
|
* Open serial console of Q7S (Accessible via the micro-USB of the PIM, see also Q7S user maunal chapter 10.3)
|
||||||
* Baudrate 115200
|
* Baudrate 115200
|
||||||
@ -65,35 +82,43 @@ git submodule update
|
|||||||
* user: root
|
* user: root
|
||||||
* pw: root
|
* pw: root
|
||||||
* Set IP address and netmask with
|
* Set IP address and netmask with
|
||||||
````
|
|
||||||
ifconfig eth0 192.168.133.10
|
```sh
|
||||||
ifconfig eth0 netmask 255.255.255.0
|
ifconfig eth0 192.168.133.10
|
||||||
````
|
ifconfig eth0 netmask 255.255.255.0
|
||||||
|
```
|
||||||
|
|
||||||
2. Connect Q7S to workstation via ethernet
|
2. Connect Q7S to workstation via ethernet
|
||||||
3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S
|
3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S
|
||||||
* When IP address is set to 192.168.133.10 and the netmask is 255.255.255.0, an example IP address for the workstation
|
* When IP address is set to 192.168.133.10 and the netmask is 255.255.255.0, an example IP address for the workstation
|
||||||
is 192.168.133.2
|
is 192.168.133.2
|
||||||
4. Run tcf-agent on Q7S
|
4. Run tcf-agent on Q7S
|
||||||
* Tcf-agent is not yet integrated in the rootfs of the Q7S. Therefore build tcf-agent manually
|
* Tcf-agent is not yet integrated in the rootfs of the Q7S. Therefore build tcf-agent manually
|
||||||
````
|
|
||||||
git clone git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
|
```sh
|
||||||
cd org.eclipse.tcf.agent/agent
|
git clone git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git
|
||||||
make CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld MACHINE=arm NO_SSL=1 NO_UUID=1
|
cd org.eclipse.tcf.agent/agent
|
||||||
````
|
make CC=arm-linux-gnueabihf-gcc LD=arm-linux-gnueabihf-ld MACHINE=arm NO_SSL=1 NO_UUID=1
|
||||||
|
```
|
||||||
|
|
||||||
* Transfer executable agent from org.eclipse.tcf.agent/agent/obj/GNU/Linux/arm/Debug to /tmp of Q7S
|
* Transfer executable agent from org.eclipse.tcf.agent/agent/obj/GNU/Linux/arm/Debug to /tmp of Q7S
|
||||||
````
|
|
||||||
cd obj/GNU/Linux/arm/Debug
|
```sh
|
||||||
scp agent root@192.168.133.10:/tmp
|
cd obj/GNU/Linux/arm/Debug
|
||||||
````
|
scp agent root@192.168.133.10:/tmp
|
||||||
|
```
|
||||||
|
|
||||||
* On Q7S
|
* On Q7S
|
||||||
````
|
```sh
|
||||||
cd /tmp
|
cd /tmp
|
||||||
chmod +x agent
|
chmod +x agent
|
||||||
````
|
```
|
||||||
|
|
||||||
* Run agent
|
* Run agent
|
||||||
````
|
```sh
|
||||||
./agent
|
./agent
|
||||||
````
|
```
|
||||||
|
|
||||||
5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations
|
5. In Xilinx SDK 2018.2 right click on project → Debug As → Debug Configurations
|
||||||
6. Right click Xilinx C/C++ applicaton (System Debugger) → New →
|
6. Right click Xilinx C/C++ applicaton (System Debugger) → New →
|
||||||
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
|
7. Set Debug Type to Linux Application Debug and Connectin to Linux Agent
|
||||||
@ -106,15 +131,15 @@ git submodule update
|
|||||||
* Local File Path: Path to eiveobsw-linux.elf (in _bin\linux\devel)
|
* Local File Path: Path to eiveobsw-linux.elf (in _bin\linux\devel)
|
||||||
* Remote File Path: /tmp/eive_obsw.elf
|
* Remote File Path: /tmp/eive_obsw.elf
|
||||||
|
|
||||||
### Debugging the software via Flatsat PC
|
## Debugging the software via Flatsat PC
|
||||||
Open SSH connection to flatsat PC:
|
Open SSH connection to flatsat PC:
|
||||||
````
|
````
|
||||||
ssh eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5
|
ssh eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5
|
||||||
````
|
````
|
||||||
To access the console of the Q7S run the following:
|
To access the console of the Q7S run the following:
|
||||||
````
|
```sh
|
||||||
sudo picocom -b 115200 /dev/ttyUSB0
|
picocom -b 115200 /dev/ttyUSB0
|
||||||
````
|
```
|
||||||
To debug an application, first make sure a static IP address is assigned to the Q7S. Run ifconfig on the Q7S serial console.
|
To debug an application, first make sure a static IP address is assigned to the Q7S. Run ifconfig on the Q7S serial console.
|
||||||
````
|
````
|
||||||
ifconfig
|
ifconfig
|
||||||
@ -134,7 +159,7 @@ Note: When now setting up a debug session in the Xilinx SDK, the host must be se
|
|||||||
of the Q7S.
|
of the Q7S.
|
||||||
|
|
||||||
|
|
||||||
### Launching an application after boot
|
## Launching an application after boot
|
||||||
Load the root partiton from the flash memory (there are to nor-flash memories and each flash holds two xdi images).
|
Load the root partiton from the flash memory (there are to nor-flash memories and each flash holds two xdi images).
|
||||||
Note: It is not possible to modify the current loaded root partition.
|
Note: It is not possible to modify the current loaded root partition.
|
||||||
1. Disable write protection of the desired root partition
|
1. Disable write protection of the desired root partition
|
||||||
@ -193,7 +218,7 @@ More detailed information about the used q7s commands can be found in the Q7S us
|
|||||||
writeprotect 0 0 0 # qspi0 nom unlock (see also Q7S user manual)
|
writeprotect 0 0 0 # qspi0 nom unlock (see also Q7S user manual)
|
||||||
````
|
````
|
||||||
|
|
||||||
### Setting up UNIX environment for real-time functionalities
|
## Setting up UNIX environment for real-time functionalities
|
||||||
Please note that on most UNIX environments (e.g. Ubuntu), the real time functionalities
|
Please note that on most UNIX environments (e.g. Ubuntu), the real time functionalities
|
||||||
used by the UNIX pthread module are restricted, which will lead to permission errors when creating these tasks
|
used by the UNIX pthread module are restricted, which will lead to permission errors when creating these tasks
|
||||||
and configuring real-time properites like scheduling priorities.
|
and configuring real-time properites like scheduling priorities.
|
||||||
@ -252,7 +277,18 @@ a permanent solution). If running the script before executing the binary does
|
|||||||
not help or an warning is issue that the soft real time value is invalid,
|
not help or an warning is issue that the soft real time value is invalid,
|
||||||
the hard real-time limit of the system might not be high enough (see step 1).
|
the hard real-time limit of the system might not be high enough (see step 1).
|
||||||
|
|
||||||
### Flight Software Framework (FSFW)
|
## Building and running the software on a host system
|
||||||
|
|
||||||
|
The host build can be built with following command
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make -f Makefile-Hosted all -j
|
||||||
|
```
|
||||||
|
|
||||||
|
If compiling on Windows, it is recommended to supply `WINDOWS=1` .
|
||||||
|
A release build can be built by using the `mission` target.
|
||||||
|
|
||||||
|
## Flight Software Framework (FSFW)
|
||||||
|
|
||||||
An EIVE fork of the FSFW is submodules into this repository.
|
An EIVE fork of the FSFW is submodules into this repository.
|
||||||
To add the master upstream branch and merge changes and updates from it
|
To add the master upstream branch and merge changes and updates from it
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#include "InitMission.h"
|
#include <bsp_linux/InitMission.h>
|
||||||
|
#include <bsp_linux/ObjectFactory.h>
|
||||||
#include <OBSWConfig.h>
|
|
||||||
#include <config/objects/systemObjectList.h>
|
|
||||||
#include <mission/core/ObjectFactory.h>
|
|
||||||
|
|
||||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
@ -12,6 +9,8 @@
|
|||||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
#include <fsfwconfig/objects/systemObjectList.h>
|
||||||
|
#include <fsfwconfig/OBSWConfig.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
9
bsp_linux/InitMission.h
Normal file
9
bsp_linux/InitMission.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef BSP_LINUX_INITMISSION_H_
|
||||||
|
#define BSP_LINUX_INITMISSION_H_
|
||||||
|
|
||||||
|
namespace InitMission {
|
||||||
|
void initMission();
|
||||||
|
void initTasks();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* BSP_LINUX_INITMISSION_H_ */
|
42
bsp_linux/ObjectFactory.cpp
Normal file
42
bsp_linux/ObjectFactory.cpp
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
|
#include <objects/systemObjectList.h>
|
||||||
|
#include <OBSWConfig.h>
|
||||||
|
#include <tmtc/apid.h>
|
||||||
|
#include <tmtc/pusIds.h>
|
||||||
|
|
||||||
|
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||||
|
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||||
|
#include <fsfw/osal/linux/TmTcUnixUdpBridge.h>
|
||||||
|
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||||
|
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
|
||||||
|
|
||||||
|
#include <mission/core/GenericFactory.h>
|
||||||
|
#include <mission/utility/TmFunnel.h>
|
||||||
|
|
||||||
|
void Factory::setStaticFrameworkObjectIds() {
|
||||||
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
TmFunnel::downlinkDestination = objects::UDP_BRIDGE;
|
||||||
|
// No storage object for now.
|
||||||
|
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||||
|
TmPacketStored::timeStamperId = objects::TIME_STAMPER;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void ObjectFactory::produce(){
|
||||||
|
Factory::setStaticFrameworkObjectIds();
|
||||||
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
|
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
|
||||||
|
objects::CCSDS_PACKET_DISTRIBUTOR,
|
||||||
|
objects::TM_STORE, objects::TC_STORE);
|
||||||
|
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||||
|
}
|
@ -5,8 +5,8 @@
|
|||||||
* Author: steffen
|
* Author: steffen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MISSION_CORE_OBJECTFACTORY_H_
|
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||||
#define MISSION_CORE_OBJECTFACTORY_H_
|
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
|
||||||
|
|
||||||
namespace ObjectFactory {
|
namespace ObjectFactory {
|
||||||
@ -14,4 +14,4 @@ namespace ObjectFactory {
|
|||||||
void produce();
|
void produce();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_CORE_OBJECTFACTORY_H_ */
|
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
@ -1,25 +1,22 @@
|
|||||||
#if defined(GCOV)
|
#include "InitMission.h"
|
||||||
#include <boardconfig/gcov.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <mission/core/InitMission.h>
|
#include <OBSWVersion.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <version.h>
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the main program for the hosted build. It can be run for
|
* @brief This is the main program for the target hardware.
|
||||||
* Linux and Windows.
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||||
std::cout << "-- Compiled for Linux " << " --" << std::endl;
|
std::cout << "-- Compiled for Linux " << " --" << std::endl;
|
||||||
std::cout << "-- Software version v" << SW_VERSION << "." << SW_SUBVERSION
|
std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "."
|
||||||
<< " -- " << std::endl;
|
<< SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl;
|
||||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||||
|
|
||||||
InitMission::initMission();
|
InitMission::initMission();
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
#ifndef CONFIG_TMTC_TMTCSIZE_H_
|
|
||||||
#define CONFIG_TMTC_TMTCSIZE_H_
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
namespace tmtcsize {
|
|
||||||
static const uint32_t MAX_TM_PACKET = 50;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CONFIG_TMTC_TMTCSIZE_H_ */
|
|
@ -1,9 +0,0 @@
|
|||||||
#ifndef CONFIG_VERSION_H_
|
|
||||||
#define CONFIG_VERSION_H_
|
|
||||||
|
|
||||||
#define SW_VERSION 0
|
|
||||||
#define SW_SUBVERSION 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_VERSION_H_ */
|
|
BIN
doc/img/xilinx-install.PNG
Normal file
BIN
doc/img/xilinx-install.PNG
Normal file
Binary file not shown.
After Width: | Height: | Size: 46 KiB |
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 113397c6c6ae4c46341f4880710e4e4d9b6e7630
|
Subproject commit ca34250e8d74cec8a75bed284bf0ec9252019b65
|
54
fsfwconfig/FSFWConfig.h
Normal file
54
fsfwconfig/FSFWConfig.h
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
#ifndef FSFWCONFIG_FSFWCONFIG_H_
|
||||||
|
#define FSFWCONFIG_FSFWCONFIG_H_
|
||||||
|
|
||||||
|
#include <FSFWVersion.h>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
//! Used to determine whether C++ ostreams are used
|
||||||
|
//! Those can lead to code bloat.
|
||||||
|
#define FSFW_CPP_OSTREAM_ENABLED 1
|
||||||
|
|
||||||
|
//! Reduced printout to further decrese code size
|
||||||
|
//! Be careful, this also turns off most diagnostic prinouts!
|
||||||
|
#define FSFW_REDUCED_PRINTOUT 0
|
||||||
|
|
||||||
|
//! Can be used to enable debugging printouts for developing the FSFW
|
||||||
|
#define FSFW_DEBUGGING 0
|
||||||
|
|
||||||
|
//! Defines the FIFO depth of each commanding service base which
|
||||||
|
//! also determines how many commands a CSB service can handle in one cycle
|
||||||
|
//! simulataneously. This will increase the required RAM for
|
||||||
|
//! each CSB service !
|
||||||
|
#define FSFW_CSB_FIFO_DEPTH 6
|
||||||
|
|
||||||
|
//! If FSFW_OBJ_EVENT_TRANSLATION is set to one,
|
||||||
|
//! additional output which requires the translation files translateObjects
|
||||||
|
//! and translateEvents (and their compiled source files)
|
||||||
|
#define FSFW_OBJ_EVENT_TRANSLATION 0
|
||||||
|
|
||||||
|
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
||||||
|
#define FSFW_DEBUG_OUTPUT 1
|
||||||
|
//! Specify whether info events are printed too.
|
||||||
|
#define FSFW_DEBUG_INFO 1
|
||||||
|
#include <translateObjects.h>
|
||||||
|
#include <translateEvents.h>
|
||||||
|
#else
|
||||||
|
#define FSFW_DEBUG_OUTPUT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//! When using the newlib nano library, C99 support for stdio facilities
|
||||||
|
//! will not be provided. This define should be set to 1 if this is the case.
|
||||||
|
#define FSFW_NO_C99_IO 1
|
||||||
|
|
||||||
|
namespace fsfwconfig {
|
||||||
|
//! Default timestamp size. The default timestamp will be an eight byte CDC
|
||||||
|
//! short timestamp.
|
||||||
|
static constexpr uint8_t FSFW_MISSION_TIMESTAMP_SIZE = 8;
|
||||||
|
|
||||||
|
//! Configure the allocated pool sizes for the event manager.
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_MATCHTREE_NODES = 240;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMT_EVENTIDMATCHERS = 120;
|
||||||
|
static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* FSFWCONFIG_FSFWCONFIG_H_ */
|
@ -3,12 +3,12 @@
|
|||||||
* code inclusion exclusion or various other project constants and
|
* code inclusion exclusion or various other project constants and
|
||||||
* properties in one place.
|
* properties in one place.
|
||||||
*/
|
*/
|
||||||
#ifndef CONFIG_OBSWCONFIG_H_
|
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||||
#define CONFIG_OBSWCONFIG_H_
|
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||||
|
|
||||||
#define OBSW_ADD_TEST_CODE 1
|
#define OBSW_ADD_TEST_CODE 0
|
||||||
|
|
||||||
// Define not used yet, PUS stack and TMTC tasks are always started
|
// Define not used yet, PUS stack and TMTC tasks are always started
|
||||||
#define ADD_PUS_STACK 1
|
#define ADD_PUS_STACK 1
|
||||||
|
|
||||||
#endif /* CONFIG_OBSWCONFIG_H_ */
|
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
13
fsfwconfig/OBSWVersion.h
Normal file
13
fsfwconfig/OBSWVersion.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef FSFWCONFIG_OBSWVERSION_H_
|
||||||
|
#define FSFWCONFIG_OBSWVERSION_H_
|
||||||
|
|
||||||
|
//! TODO: Think of a cool name for the software releases.
|
||||||
|
const char* const SW_NAME = "eive";
|
||||||
|
|
||||||
|
#define SW_VERSION 0
|
||||||
|
#define SW_SUBVERSION 2
|
||||||
|
#define SW_SUBSUBVERSION 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FSFWCONFIG_OBSWVERSION_H_ */
|
@ -1,4 +1,4 @@
|
|||||||
#include "dataPoolInit.h"
|
#include <fsfwconfig/cdatapool/dataPoolInit.h>
|
||||||
|
|
||||||
void datapool::dataPoolInit(std::map<uint32_t, PoolEntryIF*>* poolMap) {
|
void datapool::dataPoolInit(std::map<uint32_t, PoolEntryIF*>* poolMap) {
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
#ifndef FSFWCONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
||||||
#define CONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
#define FSFWCONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
||||||
|
|
||||||
#include <fsfw/datapool/DataPool.h>
|
#include <fsfw/datapool/DataPool.h>
|
||||||
|
|
||||||
@ -10,4 +10,4 @@ namespace datapool{
|
|||||||
NO_PARAMETER = 0,
|
NO_PARAMETER = 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CDATAPOOL_DATAPOOLINIT_H_ */
|
#endif /* FSFWCONFIG_CDATAPOOL_DATAPOOLINIT_H_ */
|
@ -4,7 +4,7 @@
|
|||||||
* \date 06.11.2019
|
* \date 06.11.2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "logicalAddresses.h"
|
#include <fsfwconfig/devices/logicalAddresses.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
|||||||
* \date 07.11.2019
|
* \date 07.11.2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_DEVICES_LOGICALADDRESSES_H_
|
#ifndef FSFWCONFIG_DEVICES_LOGICALADDRESSES_H_
|
||||||
#define CONFIG_DEVICES_LOGICALADDRESSES_H_
|
#define FSFWCONFIG_DEVICES_LOGICALADDRESSES_H_
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <config/objects/systemObjectList.h>
|
|
||||||
#include <fsfw/devicehandlers/CookieIF.h>
|
#include <fsfw/devicehandlers/CookieIF.h>
|
||||||
|
#include <fsfwconfig/objects/systemObjectList.h>
|
||||||
|
|
||||||
namespace addresses {
|
namespace addresses {
|
||||||
/* Logical addresses have uint32_t datatype */
|
/* Logical addresses have uint32_t datatype */
|
||||||
@ -23,4 +23,4 @@ namespace addresses {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_DEVICES_LOGICALADDRESSES_H_ */
|
#endif /* FSFWCONFIG_DEVICES_LOGICALADDRESSES_H_ */
|
@ -4,7 +4,7 @@
|
|||||||
* @date 28.11.2019
|
* @date 28.11.2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "powerSwitcherList.h"
|
#include <fsfwconfig/devices/powerSwitcherList.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
|||||||
* @date 28.11.2019
|
* @date 28.11.2019
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_DEVICES_POWERSWITCHERLIST_H_
|
#ifndef FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
|
||||||
#define CONFIG_DEVICES_POWERSWITCHERLIST_H_
|
#define FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_
|
||||||
|
|
||||||
namespace switches {
|
namespace switches {
|
||||||
/* Switches are uint8_t datatype and go from 0 to 255 */
|
/* Switches are uint8_t datatype and go from 0 to 255 */
|
||||||
@ -19,4 +19,4 @@ namespace switches {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_DEVICES_POWERSWITCHERLIST_H_ */
|
#endif /* FSFWCONFIG_DEVICES_POWERSWITCHERLIST_H_ */
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
#ifndef FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
||||||
#define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
#define FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_
|
||||||
|
|
||||||
#include <fsfw/events/fwSubsystemIdRanges.h>
|
#include <fsfw/events/fwSubsystemIdRanges.h>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -21,4 +21,4 @@ enum: uint8_t {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */
|
#endif /* FSFWCONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */
|
@ -2,7 +2,7 @@
|
|||||||
* @brief Auto-generated event translation file. Contains 80 translations.
|
* @brief Auto-generated event translation file. Contains 80 translations.
|
||||||
* Generated on: 2020-05-02 20:13:41
|
* Generated on: 2020-05-02 20:13:41
|
||||||
*/
|
*/
|
||||||
#include "translateEvents.h"
|
#include <fsfwconfig/events/translateEvents.h>
|
||||||
|
|
||||||
const char *GPS_STARTUP_FAILED_STRING = "GPS_STARTUP_FAILED";
|
const char *GPS_STARTUP_FAILED_STRING = "GPS_STARTUP_FAILED";
|
||||||
const char *GPS_FIX_STRING = "GPS_FIX";
|
const char *GPS_FIX_STRING = "GPS_FIX";
|
@ -5,12 +5,12 @@
|
|||||||
* Author: Robin
|
* Author: Robin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_EVENTS_TRANSLATEEVENTS_H_
|
#ifndef FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_
|
||||||
#define CONFIG_EVENTS_TRANSLATEEVENTS_H_
|
#define FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_
|
||||||
|
|
||||||
#include <fsfw/events/Event.h>
|
#include <fsfw/events/Event.h>
|
||||||
|
|
||||||
const char * translateEvents(Event event);
|
const char * translateEvents(Event event);
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_EVENTS_TRANSLATEEVENTS_H_ */
|
#endif /* FSFWCONFIG_EVENTS_TRANSLATEEVENTS_H_ */
|
@ -1,5 +1,5 @@
|
|||||||
#include "MissionMessageTypes.h"
|
|
||||||
#include <fsfw/ipc/CommandMessage.h>
|
#include <fsfw/ipc/CommandMessage.h>
|
||||||
|
#include <fsfwconfig/ipc/MissionMessageTypes.h>
|
||||||
|
|
||||||
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
||||||
// switch(message->getMessageType()) {
|
// switch(message->getMessageType()) {
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_IPC_MISSIONMESSAGETYPES_H_
|
#ifndef FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_
|
||||||
#define CONFIG_IPC_MISSIONMESSAGETYPES_H_
|
#define FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_
|
||||||
|
|
||||||
#include <fsfw/ipc/FwMessageTypes.h>
|
#include <fsfw/ipc/FwMessageTypes.h>
|
||||||
|
|
||||||
@ -19,4 +19,4 @@ enum MESSAGE_TYPE {
|
|||||||
void clearMissionMessage(CommandMessage* message);
|
void clearMissionMessage(CommandMessage* message);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_IPC_MISSIONMESSAGETYPES_H_ */
|
#endif /* FSFWCONFIG_IPC_MISSIONMESSAGETYPES_H_ */
|
@ -1,5 +1,5 @@
|
|||||||
/* Auto-generated event translation file. Contains 77 translations. */
|
/* Auto-generated event translation file. Contains 77 translations. */
|
||||||
#include <config/objects/translateObjects.h>
|
#include <fsfwconfig/objects/translateObjects.h>
|
||||||
|
|
||||||
const char *AT91_UART2_TEST_TASK_STRING = "AT91_UART2_TEST_TASK";
|
const char *AT91_UART2_TEST_TASK_STRING = "AT91_UART2_TEST_TASK";
|
||||||
const char *ARDUINO_0_STRING = "ARDUINO_0";
|
const char *ARDUINO_0_STRING = "ARDUINO_0";
|
@ -5,12 +5,12 @@
|
|||||||
* Author: Robin
|
* Author: Robin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_OBJECTS_TRANSLATEOBJECTS_H_
|
#ifndef FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_
|
||||||
#define CONFIG_OBJECTS_TRANSLATEOBJECTS_H_
|
#define FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_
|
||||||
|
|
||||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
|
|
||||||
const char* translateObject(object_id_t object);
|
const char* translateObject(object_id_t object);
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */
|
#endif /* FSFWCONFIG_OBJECTS_TRANSLATEOBJECTS_H_ */
|
@ -1,10 +1,9 @@
|
|||||||
#include <PollingSequenceFactory.h>
|
|
||||||
#include <systemObjectList.h>
|
|
||||||
|
|
||||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
|
#include <fsfwconfig/objects/systemObjectList.h>
|
||||||
|
#include <fsfwconfig/pollingsequence/PollingSequenceFactory.h>
|
||||||
|
|
||||||
ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence)
|
ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence)
|
||||||
{
|
{
|
19
fsfwconfig/returnvalues/classIds.h
Normal file
19
fsfwconfig/returnvalues/classIds.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef FSFWCONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
|
#define FSFWCONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
|
|
||||||
|
#include <fsfw/returnvalues/FwClassIds.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Source IDs starts at 73 for now
|
||||||
|
* Framework IDs for ReturnValues run from 0 to 56
|
||||||
|
* and are located inside <fsfw/returnvalues/FwClassIds.h>
|
||||||
|
*/
|
||||||
|
namespace CLASS_ID {
|
||||||
|
enum {
|
||||||
|
MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT,
|
||||||
|
MGM_LIS3MDL
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FSFWCONFIG_RETURNVALUES_CLASSIDS_H_ */
|
@ -1,5 +1,5 @@
|
|||||||
#ifndef CONFIG_TMTC_APID_H_
|
#ifndef FSFWCONFIG_TMTC_APID_H_
|
||||||
#define CONFIG_TMTC_APID_H_
|
#define FSFWCONFIG_TMTC_APID_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -16,4 +16,4 @@ namespace apid {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_TMTC_APID_H_ */
|
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
10
fsfwconfig/tmtc/tmTcSize.h
Normal file
10
fsfwconfig/tmtc/tmTcSize.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef FSFWCONFIG_TMTC_TMTCSIZE_H_
|
||||||
|
#define FSFWCONFIG_TMTC_TMTCSIZE_H_
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
namespace tmtcsize {
|
||||||
|
static const uint32_t MAX_TM_PACKET = 50;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* FSFWCONFIG_TMTC_TMTCSIZE_H_ */
|
159
hosted/InitMission.cpp
Normal file
159
hosted/InitMission.cpp
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
#include <bsp_linux/InitMission.h>
|
||||||
|
#include <bsp_linux/ObjectFactory.h>
|
||||||
|
|
||||||
|
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||||
|
#include <fsfw/datapool/DataPool.h>
|
||||||
|
#include <fsfw/objectmanager/ObjectManager.h>
|
||||||
|
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||||
|
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||||
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
#include <fsfwconfig/objects/systemObjectList.h>
|
||||||
|
#include <fsfwconfig/OBSWConfig.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
// This is configured for linux without \cr
|
||||||
|
#ifdef LINUX
|
||||||
|
ServiceInterfaceStream sif::debug("DEBUG");
|
||||||
|
ServiceInterfaceStream sif::info("INFO");
|
||||||
|
ServiceInterfaceStream sif::warning("WARNING");
|
||||||
|
ServiceInterfaceStream sif::error("ERROR", false, false, true);
|
||||||
|
#else
|
||||||
|
ServiceInterfaceStream sif::debug("DEBUG", true);
|
||||||
|
ServiceInterfaceStream sif::info("INFO", true);
|
||||||
|
ServiceInterfaceStream sif::warning("WARNING", true);
|
||||||
|
ServiceInterfaceStream sif::error("ERROR", true, false, true);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ObjectManagerIF *objectManager = nullptr;
|
||||||
|
|
||||||
|
//Initialize Data Pool
|
||||||
|
DataPool dataPool(nullptr);
|
||||||
|
|
||||||
|
void InitMission::initMission() {
|
||||||
|
sif::info << "Building global objects.." << std::endl;
|
||||||
|
/* Instantiate global object manager and also create all objects */
|
||||||
|
objectManager = new ObjectManager(ObjectFactory::produce);
|
||||||
|
sif::info << "Initializing all objects.." << std::endl;
|
||||||
|
objectManager->initialize();
|
||||||
|
|
||||||
|
/* This function creates and starts all tasks */
|
||||||
|
initTasks();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InitMission::initTasks(){
|
||||||
|
/* TMTC Distribution */
|
||||||
|
PeriodicTaskIF* TmTcDistributor = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||||
|
0.100, nullptr);
|
||||||
|
ReturnValue_t result = TmTcDistributor->addComponent(
|
||||||
|
objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
result = TmTcDistributor->addComponent(objects::PUS_PACKET_DISTRIBUTOR);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
result = TmTcDistributor->addComponent(objects::TM_FUNNEL);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* UDP bridge */
|
||||||
|
PeriodicTaskIF* UdpBridgeTask = TaskFactory::instance()->createPeriodicTask(
|
||||||
|
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||||
|
0.2, nullptr);
|
||||||
|
result = UdpBridgeTask->addComponent(objects::UDP_BRIDGE);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
|
||||||
|
}
|
||||||
|
PeriodicTaskIF* UdpPollingTask = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("UDP_POLLING", 80,
|
||||||
|
PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, nullptr);
|
||||||
|
result = UdpPollingTask->addComponent(objects::UDP_POLLING_TASK);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "Add component UDP Polling failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* PUS Services */
|
||||||
|
PeriodicTaskIF* PusVerification = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("PUS_VERIF_1", 40,
|
||||||
|
PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, nullptr);
|
||||||
|
result = PusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
PeriodicTaskIF* PusEvents = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("PUS_VERIF_1", 60,
|
||||||
|
PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, nullptr);
|
||||||
|
result = PusVerification->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
PeriodicTaskIF* PusHighPrio = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("PUS_HIGH_PRIO", 50,
|
||||||
|
PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||||
|
0.200, nullptr);
|
||||||
|
result = PusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
result = PusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
PeriodicTaskIF* PusMedPrio = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("PUS_HIGH_PRIO", 40,
|
||||||
|
PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||||
|
0.8, nullptr);
|
||||||
|
result = PusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
result = PusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
PeriodicTaskIF* PusLowPrio = TaskFactory::instance()->
|
||||||
|
createPeriodicTask("PUSB", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE,
|
||||||
|
1.6, nullptr);
|
||||||
|
result = PusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||||
|
if(result!=HasReturnvaluesIF::RETURN_OK){
|
||||||
|
sif::error << "Object add component failed" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
|
FixedTimeslotTaskIF* TestTimeslotTask = TaskFactory::instance()->
|
||||||
|
createFixedTimeslotTask("PST_TEST_TASK", 10,
|
||||||
|
PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.0, nullptr);
|
||||||
|
result = pst::pollingSequenceTestFunction(TestTimeslotTask);
|
||||||
|
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
|
sif::error << "InitMission::createTasks: Test PST initialization "
|
||||||
|
<< "failed!" << std::endl;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//Main thread sleep
|
||||||
|
sif::info << "Starting tasks.." << std::endl;
|
||||||
|
TmTcDistributor->startTask();
|
||||||
|
UdpBridgeTask->startTask();
|
||||||
|
UdpPollingTask->startTask();
|
||||||
|
|
||||||
|
PusVerification->startTask();
|
||||||
|
PusEvents->startTask();
|
||||||
|
PusHighPrio->startTask();
|
||||||
|
PusMedPrio->startTask();
|
||||||
|
PusLowPrio->startTask();
|
||||||
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
|
TestTimeslotTask->startTask();
|
||||||
|
#endif
|
||||||
|
sif::info << "Tasks started.." << std::endl;
|
||||||
|
}
|
9
hosted/InitMission.h
Normal file
9
hosted/InitMission.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef BSP_LINUX_INITMISSION_H_
|
||||||
|
#define BSP_LINUX_INITMISSION_H_
|
||||||
|
|
||||||
|
namespace InitMission {
|
||||||
|
void initMission();
|
||||||
|
void initTasks();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* BSP_LINUX_INITMISSION_H_ */
|
61
hosted/ObjectFactory.cpp
Normal file
61
hosted/ObjectFactory.cpp
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
|
#include <objects/systemObjectList.h>
|
||||||
|
#include <OBSWConfig.h>
|
||||||
|
#include <tmtc/apid.h>
|
||||||
|
#include <tmtc/pusIds.h>
|
||||||
|
|
||||||
|
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||||
|
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||||
|
|
||||||
|
#include <mission/core/GenericFactory.h>
|
||||||
|
#include <mission/utility/TmFunnel.h>
|
||||||
|
|
||||||
|
#ifdef LINUX
|
||||||
|
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
|
||||||
|
#include <fsfw/osal/linux/TmTcUnixUdpBridge.h>
|
||||||
|
#elif WIN32
|
||||||
|
#include <fsfw/osal/windows/TcWinUdpPollingTask.h>
|
||||||
|
#include <fsfw/osal/windows/TmTcWinUdpBridge.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||||
|
|
||||||
|
|
||||||
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
|
#include <test/testtasks/TestTask.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void Factory::setStaticFrameworkObjectIds(){
|
||||||
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||||
|
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||||
|
|
||||||
|
TmFunnel::downlinkDestination = objects::UDP_BRIDGE;
|
||||||
|
// No storage object for now.
|
||||||
|
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||||
|
|
||||||
|
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||||
|
TmPacketStored::timeStamperId = objects::TIME_STAMPER;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::produce(){
|
||||||
|
Factory::setStaticFrameworkObjectIds();
|
||||||
|
ObjectFactory::produceGenericObjects();
|
||||||
|
|
||||||
|
#ifdef LINUX
|
||||||
|
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
|
||||||
|
objects::CCSDS_PACKET_DISTRIBUTOR,
|
||||||
|
objects::TM_STORE, objects::TC_STORE);
|
||||||
|
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
||||||
|
#elif WIN32
|
||||||
|
new TmTcWinUdpBridge(objects::UDP_BRIDGE,
|
||||||
|
objects::CCSDS_PACKET_DISTRIBUTOR, objects::TM_STORE,
|
||||||
|
objects::TC_STORE);
|
||||||
|
new TcWinUdpPollingTask(objects::UDP_POLLING_TASK,
|
||||||
|
objects::UDP_BRIDGE);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
17
hosted/ObjectFactory.h
Normal file
17
hosted/ObjectFactory.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
/*
|
||||||
|
* ObjectFactory.h
|
||||||
|
*
|
||||||
|
* Created on: Sep 22, 2020
|
||||||
|
* Author: steffen
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||||
|
|
||||||
|
|
||||||
|
namespace ObjectFactory {
|
||||||
|
void setStatics();
|
||||||
|
void produce();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
@ -1,9 +0,0 @@
|
|||||||
#ifndef CONFIG_FSFWCONFIG_H_
|
|
||||||
#define CONFIG_FSFWCONFIG_H_
|
|
||||||
|
|
||||||
//! When using the newlib nano library, C99 support for stdio facilities
|
|
||||||
//! will not be provided. This define should be set to 1 if this is the case.
|
|
||||||
#define FSFW_NO_C99_IO 0
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_FSFWCONFIG_H_ */
|
|
@ -1,9 +0,0 @@
|
|||||||
#ifndef CONFIG_VERSION_H_
|
|
||||||
#define CONFIG_VERSION_H_
|
|
||||||
|
|
||||||
#define SW_VERSION 0
|
|
||||||
#define SW_SUBVERSION 1
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_VERSION_H_ */
|
|
12
hosted/fsfwconfig/OBSWVersion.h
Normal file
12
hosted/fsfwconfig/OBSWVersion.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef FSFWCONFIG_OBSWVERSION_H_
|
||||||
|
#define FSFWCONFIG_OBSWVERSION_H_
|
||||||
|
|
||||||
|
const char* const SW_NAME = "eive";
|
||||||
|
|
||||||
|
#define SW_VERSION 0
|
||||||
|
#define SW_SUBVERSION 2
|
||||||
|
#define SW_SUBSUBVERSION 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* FSFWCONFIG_OBSWVERSION_H_ */
|
@ -1,5 +1,5 @@
|
|||||||
#include "MissionMessageTypes.h"
|
|
||||||
#include <fsfw/ipc/CommandMessage.h>
|
#include <fsfw/ipc/CommandMessage.h>
|
||||||
|
#include <hosted/fsfwconfig/ipc/MissionMessageTypes.h>
|
||||||
|
|
||||||
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
void messagetypes::clearMissionMessage(CommandMessage* message) {
|
||||||
switch(message->getMessageType()) {
|
switch(message->getMessageType()) {
|
@ -1,13 +1,8 @@
|
|||||||
/*
|
|
||||||
* classIds.h
|
|
||||||
*
|
|
||||||
* Created on: 16.07.2018
|
|
||||||
* Author: mohr
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_
|
#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
#define CONFIG_RETURNVALUES_CLASSIDS_H_
|
#define CONFIG_RETURNVALUES_CLASSIDS_H_
|
||||||
|
|
||||||
|
#include <fsfw/returnvalues/FwClassIds.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source IDs starts at 73 for now
|
* Source IDs starts at 73 for now
|
||||||
* Framework IDs for ReturnValues run from 0 to 56
|
* Framework IDs for ReturnValues run from 0 to 56
|
@ -1,8 +1,8 @@
|
|||||||
#include <mission/core/InitMission.h>
|
#include <bsp_linux/InitMission.h>
|
||||||
#include <fsfw/tasks/TaskFactory.h>
|
#include <fsfw/tasks/TaskFactory.h>
|
||||||
|
#include <hosted/fsfwconfig/OBSWVersion.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <version.h>
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static const char* COMPILE_PRINTOUT = "Windows";
|
static const char* COMPILE_PRINTOUT = "Windows";
|
||||||
@ -20,8 +20,8 @@ int main(void)
|
|||||||
{
|
{
|
||||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||||
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
||||||
std::cout << "-- Software version v" << SW_VERSION << "." << SW_SUBVERSION
|
std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "."
|
||||||
<< " -- " << std::endl;
|
<< SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl;
|
||||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||||
|
|
||||||
InitMission::initMission();
|
InitMission::initMission();
|
||||||
|
83
mission/core/GenericFactory.cpp
Normal file
83
mission/core/GenericFactory.cpp
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
#include "GenericFactory.h"
|
||||||
|
#include <fsfwconfig/objects/systemObjectList.h>
|
||||||
|
#include <fsfwconfig/tmtc/apid.h>
|
||||||
|
#include <fsfwconfig/tmtc/pusIds.h>
|
||||||
|
|
||||||
|
#include <fsfw/events/EventManager.h>
|
||||||
|
#include <fsfw/health/HealthTable.h>
|
||||||
|
#include <fsfw/internalError/InternalErrorReporter.h>
|
||||||
|
#include <fsfw/pus/CService200ModeCommanding.h>
|
||||||
|
#include <fsfw/pus/Service17Test.h>
|
||||||
|
#include <fsfw/pus/Service1TelecommandVerification.h>
|
||||||
|
#include <fsfw/pus/Service2DeviceAccess.h>
|
||||||
|
#include <fsfw/pus/Service5EventReporting.h>
|
||||||
|
#include <fsfw/pus/Service8FunctionManagement.h>
|
||||||
|
#include <fsfw/pus/Service9TimeManagement.h>
|
||||||
|
#include <fsfw/storagemanager/PoolManager.h>
|
||||||
|
#include <fsfw/tcdistribution/CCSDSDistributor.h>
|
||||||
|
#include <fsfw/tcdistribution/PUSDistributor.h>
|
||||||
|
#include <fsfw/timemanager/TimeStamper.h>
|
||||||
|
#include <mission/utility/TmFunnel.h>
|
||||||
|
|
||||||
|
|
||||||
|
void ObjectFactory::produceGenericObjects() {
|
||||||
|
/* Framework objects */
|
||||||
|
new EventManager(objects::EVENT_MANAGER);
|
||||||
|
new HealthTable(objects::HEALTH_TABLE);
|
||||||
|
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER, 0, 0, 0);
|
||||||
|
new TimeStamper(objects::TIME_STAMPER);
|
||||||
|
|
||||||
|
{
|
||||||
|
static constexpr uint8_t NUMBER_OF_POOLS = 5;
|
||||||
|
const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024};
|
||||||
|
const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5};
|
||||||
|
new PoolManager<NUMBER_OF_POOLS>(objects::TC_STORE, element_sizes,
|
||||||
|
n_elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
static constexpr uint8_t NUMBER_OF_POOLS = 5;
|
||||||
|
const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024};
|
||||||
|
const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5};
|
||||||
|
new PoolManager<NUMBER_OF_POOLS>(objects::TM_STORE, element_sizes,
|
||||||
|
n_elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
static constexpr uint8_t NUMBER_OF_POOLS = 6;
|
||||||
|
const uint16_t element_sizes[NUMBER_OF_POOLS] = {32, 64, 512,
|
||||||
|
1024, 2048, 4096};
|
||||||
|
const uint16_t n_elements[NUMBER_OF_POOLS] = {200, 100, 50, 25, 15, 5};
|
||||||
|
new PoolManager<NUMBER_OF_POOLS>(objects::IPC_STORE, element_sizes,
|
||||||
|
n_elements);
|
||||||
|
}
|
||||||
|
|
||||||
|
new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
|
new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR,
|
||||||
|
objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||||
|
|
||||||
|
|
||||||
|
/* TMTC Reception via UDP socket */
|
||||||
|
new TmFunnel(objects::TM_FUNNEL);
|
||||||
|
|
||||||
|
/* PUS stack */
|
||||||
|
new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION,
|
||||||
|
apid::EIVE_OBSW, pus::PUS_SERVICE_1, objects::TM_FUNNEL);
|
||||||
|
new Service2DeviceAccess(objects::PUS_SERVICE_2_DEVICE_ACCESS,
|
||||||
|
apid::EIVE_OBSW, pus::PUS_SERVICE_2, 3, 10);
|
||||||
|
new Service5EventReporting(objects::PUS_SERVICE_5_EVENT_REPORTING,
|
||||||
|
apid::EIVE_OBSW, pus::PUS_SERVICE_5, 50);
|
||||||
|
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT,
|
||||||
|
apid::EIVE_OBSW, pus::PUS_SERVICE_8, 3, 10);
|
||||||
|
new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT,
|
||||||
|
apid::EIVE_OBSW, pus::PUS_SERVICE_9);
|
||||||
|
new Service17Test(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW,
|
||||||
|
pus::PUS_SERVICE_17);
|
||||||
|
new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT,
|
||||||
|
apid::EIVE_OBSW, pus::PUS_SERVICE_200);
|
||||||
|
|
||||||
|
/* Test Device Handler */
|
||||||
|
#if OBSW_ADD_TEST_CODE == 1
|
||||||
|
new TestTask(objects::TEST_TASK);
|
||||||
|
#endif
|
||||||
|
}
|
12
mission/core/GenericFactory.h
Normal file
12
mission/core/GenericFactory.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#ifndef MISSION_CORE_GENERICFACTORY_H_
|
||||||
|
#define MISSION_CORE_GENERICFACTORY_H_
|
||||||
|
|
||||||
|
namespace ObjectFactory {
|
||||||
|
|
||||||
|
void produceGenericObjects();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* MISSION_CORE_GENERICFACTORY_H_ */
|
@ -1,9 +0,0 @@
|
|||||||
#ifndef MISSION_CORE_INITMISSION_H_
|
|
||||||
#define MISSION_CORE_INITMISSION_H_
|
|
||||||
|
|
||||||
namespace InitMission {
|
|
||||||
void initMission();
|
|
||||||
void initTasks();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* MISSION_CORE_INITMISSION_H_ */
|
|
@ -1,134 +0,0 @@
|
|||||||
#include "ObjectFactory.h"
|
|
||||||
|
|
||||||
#include <config/OBSWConfig.h>
|
|
||||||
#include <config/objects/systemObjectList.h>
|
|
||||||
#include <config/tmtc/apid.h>
|
|
||||||
#include <config/tmtc/pusIds.h>
|
|
||||||
|
|
||||||
#include <mission/utility/TmFunnel.h>
|
|
||||||
|
|
||||||
#include <fsfw/health/HealthTable.h>
|
|
||||||
#include <fsfw/storagemanager/PoolManager.h>
|
|
||||||
#include <fsfw/events/EventManager.h>
|
|
||||||
#include <fsfw/timemanager/TimeStamper.h>
|
|
||||||
#include <fsfw/internalError/InternalErrorReporter.h>
|
|
||||||
#include <fsfw/monitoring/MonitoringMessageContent.h>
|
|
||||||
#include <fsfw/tcdistribution/CCSDSDistributor.h>
|
|
||||||
#include <fsfw/tcdistribution/PUSDistributor.h>
|
|
||||||
#include <fsfw/pus/Service1TelecommandVerification.h>
|
|
||||||
#include <fsfw/pus/Service2DeviceAccess.h>
|
|
||||||
#include <fsfw/pus/Service5EventReporting.h>
|
|
||||||
#include <fsfw/pus/Service8FunctionManagement.h>
|
|
||||||
#include <fsfw/pus/Service9TimeManagement.h>
|
|
||||||
#include <fsfw/pus/Service17Test.h>
|
|
||||||
#include <fsfw/pus/CService200ModeCommanding.h>
|
|
||||||
#include "../../fsfw/devicehandlers/CookieIF.h"
|
|
||||||
#include "../../hosted/comIF/ArduinoComIF.h"
|
|
||||||
#ifdef LINUX
|
|
||||||
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
|
|
||||||
#include <fsfw/osal/linux/TmTcUnixUdpBridge.h>
|
|
||||||
#elif WIN32
|
|
||||||
#include <fsfw/osal/windows/TcWinUdpPollingTask.h>
|
|
||||||
#include <fsfw/osal/windows/TmTcWinUdpBridge.h>
|
|
||||||
#endif
|
|
||||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
|
||||||
|
|
||||||
|
|
||||||
#if ADD_TEST_CODE == 1
|
|
||||||
//#include <test/TestCookie.h>
|
|
||||||
//#include <test/TestDeviceHandler.h>
|
|
||||||
#include <test/testtasks/TestTask.h>
|
|
||||||
//#include <test/TestEchoComIF.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void Factory::setStaticFrameworkObjectIds(){
|
|
||||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
||||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
|
||||||
|
|
||||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
||||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
|
||||||
|
|
||||||
TmFunnel::downlinkDestination = objects::UDP_BRIDGE;
|
|
||||||
// No storage object for now.
|
|
||||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
|
||||||
|
|
||||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
|
||||||
TmPacketStored::timeStamperId = objects::TIME_STAMPER;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ObjectFactory::produce(){
|
|
||||||
Factory::setStaticFrameworkObjectIds();
|
|
||||||
|
|
||||||
/* Framework objects */
|
|
||||||
new EventManager(objects::EVENT_MANAGER);
|
|
||||||
new HealthTable(objects::HEALTH_TABLE);
|
|
||||||
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER, 0, 0, 0);
|
|
||||||
new TimeStamper(objects::TIME_STAMPER);
|
|
||||||
|
|
||||||
{
|
|
||||||
static constexpr uint8_t NUMBER_OF_POOLS = 5;
|
|
||||||
const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024};
|
|
||||||
const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5};
|
|
||||||
new PoolManager<NUMBER_OF_POOLS>(objects::TC_STORE, element_sizes,
|
|
||||||
n_elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
static constexpr uint8_t NUMBER_OF_POOLS = 5;
|
|
||||||
const uint16_t element_sizes[NUMBER_OF_POOLS] = {16, 32, 64, 128, 1024};
|
|
||||||
const uint16_t n_elements[NUMBER_OF_POOLS] = {100, 50, 25, 15, 5};
|
|
||||||
new PoolManager<NUMBER_OF_POOLS>(objects::TM_STORE, element_sizes,
|
|
||||||
n_elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
static constexpr uint8_t NUMBER_OF_POOLS = 6;
|
|
||||||
const uint16_t element_sizes[NUMBER_OF_POOLS] = {32, 64, 512,
|
|
||||||
1024, 2048, 4096};
|
|
||||||
const uint16_t n_elements[NUMBER_OF_POOLS] = {200, 100, 50, 25, 15, 5};
|
|
||||||
new PoolManager<NUMBER_OF_POOLS>(objects::IPC_STORE, element_sizes,
|
|
||||||
n_elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR);
|
|
||||||
new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR,
|
|
||||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
|
||||||
|
|
||||||
|
|
||||||
/* TMTC Reception via UDP socket */
|
|
||||||
new TmFunnel(objects::TM_FUNNEL);
|
|
||||||
|
|
||||||
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
|
|
||||||
objects::CCSDS_PACKET_DISTRIBUTOR,
|
|
||||||
objects::TM_STORE, objects::TC_STORE);
|
|
||||||
|
|
||||||
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
|
|
||||||
|
|
||||||
/* PUS stack */
|
|
||||||
new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION,
|
|
||||||
apid::EIVE_OBSW, pus::PUS_SERVICE_1, objects::TM_FUNNEL);
|
|
||||||
new Service2DeviceAccess(objects::PUS_SERVICE_2_DEVICE_ACCESS,
|
|
||||||
apid::EIVE_OBSW, pus::PUS_SERVICE_2, 3, 10);
|
|
||||||
new Service5EventReporting(objects::PUS_SERVICE_5_EVENT_REPORTING,
|
|
||||||
apid::EIVE_OBSW, pus::PUS_SERVICE_5, 50);
|
|
||||||
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT,
|
|
||||||
apid::EIVE_OBSW, pus::PUS_SERVICE_8, 3, 10);
|
|
||||||
new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT,
|
|
||||||
apid::EIVE_OBSW, pus::PUS_SERVICE_9);
|
|
||||||
new Service17Test(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW,
|
|
||||||
pus::PUS_SERVICE_17);
|
|
||||||
new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT,
|
|
||||||
apid::EIVE_OBSW, pus::PUS_SERVICE_200);
|
|
||||||
|
|
||||||
/* Test Device Handler */
|
|
||||||
#if ADD_TEST_CODE == 1
|
|
||||||
new TestTask(objects::TEST_TASK);
|
|
||||||
// CookieIF* testCookie = new TestCookie(0);
|
|
||||||
// new TestEchoComIF(objects::TEST_ECHO_COM_IF);
|
|
||||||
// new TestDevice(objects::TEST_DEVICE_HANDLER, objects::TEST_ECHO_COM_IF,
|
|
||||||
// testCookie, true);
|
|
||||||
new ArduinoComIF(objects::ARDUINO_COM_IF, true, nullptr);
|
|
||||||
#endif
|
|
||||||
}
|
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 3fc71f9094e8fb670942f0c29a9dea0b6e03d17f
|
Subproject commit 2f1c3d5eb9c3858d99c4516f4f132425ea1a97b7
|
Loading…
Reference in New Issue
Block a user