Merge branch 'develop' into mohr/catch2
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
commit
2f51f58c7e
2
.gitignore
vendored
2
.gitignore
vendored
@ -9,7 +9,7 @@
|
||||
!misc/eclipse/**/.project
|
||||
|
||||
#vscode
|
||||
.vscode
|
||||
/.vscode
|
||||
|
||||
# Python
|
||||
__pycache__
|
||||
|
@ -16,14 +16,21 @@ set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
|
||||
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
|
||||
|
||||
option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF)
|
||||
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
|
||||
|
||||
if(NOT FSFW_OSAL)
|
||||
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
if(TGT_BSP)
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
option(LINUX_CROSS_COMPILE ON)
|
||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" OFF)
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Perform steps like loading toolchain files where applicable.
|
||||
@ -86,7 +93,7 @@ pre_source_hw_os_config()
|
||||
|
||||
if(TGT_BSP)
|
||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
|
||||
OR TGT_BSP MATCHES "arm/beagleboneblack"
|
||||
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
|
||||
)
|
||||
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
|
||||
if(NOT BUILD_Q7S_SIMPLE_MODE)
|
||||
@ -96,12 +103,18 @@ if(TGT_BSP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi")
|
||||
if(TGT_BSP MATCHES "arm/raspberrypi" )
|
||||
# Used by configure file
|
||||
set(RASPBERRY_PI ON)
|
||||
set(FSFW_HAL_ADD_RASPBERRY_PI ON)
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/egse")
|
||||
# Used by configure file
|
||||
set(EGSE ON)
|
||||
set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF)
|
||||
endif()
|
||||
|
||||
if(TGT_BSP MATCHES "arm/beagleboneblack")
|
||||
# Used by configure file
|
||||
set(BEAGLEBONEBLACK ON)
|
||||
@ -123,7 +136,7 @@ configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
|
||||
configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h)
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h)
|
||||
elseif(TGT_BSP MATCHES "arm/raspberrypi")
|
||||
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
|
||||
configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h)
|
||||
endif()
|
||||
|
||||
@ -192,6 +205,12 @@ add_library(${LIB_EIVE_MISSION})
|
||||
|
||||
# Add main executable
|
||||
add_executable(${OBSW_NAME})
|
||||
if(EIVE_CREATE_UNIQUE_OBSW_BIN)
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME}-$ENV{USERNAME})
|
||||
else()
|
||||
set(OBSW_BIN_NAME ${CMAKE_PROJECT_NAME})
|
||||
endif()
|
||||
set_target_properties(${OBSW_NAME} PROPERTIES OUTPUT_NAME ${OBSW_BIN_NAME})
|
||||
|
||||
#watchdog
|
||||
add_executable(${WATCHDOG_NAME} EXCLUDE_FROM_ALL)
|
||||
@ -270,6 +289,11 @@ target_link_libraries(${UNITTEST_NAME} PRIVATE
|
||||
${LIB_EIVE_MISSION}
|
||||
)
|
||||
|
||||
if(TGT_BSP MATCHES "arm/egse")
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
${LIB_ARCSEC}
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ADD_CSP_LIB)
|
||||
target_link_libraries(${OBSW_NAME} PRIVATE
|
||||
@ -302,7 +326,7 @@ target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||
${LIB_ARCSEC_PATH}
|
||||
)
|
||||
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse")
|
||||
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
|
||||
${ARCSEC_LIB_PATH}
|
||||
)
|
||||
@ -346,9 +370,10 @@ string(CONCAT POST_BUILD_COMMENT
|
||||
add_custom_command(
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_SIZE} ${OBSW_NAME}${FILE_SUFFIX}
|
||||
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
|
||||
COMMENT ${POST_BUILD_COMMENT}
|
||||
)
|
||||
|
||||
|
||||
include (${CMAKE_SCRIPT_PATH}/BuildType.cmake)
|
||||
set_build_type()
|
||||
|
54
README.md
54
README.md
@ -19,9 +19,10 @@
|
||||
12. [Static Code Analysis](#static-code-analysis)
|
||||
13. [Eclipse](#eclipse)
|
||||
14. [Running the OBSW on a Raspberry Pi](#rpi)
|
||||
15. [Manually preparing sysroots to compile gpsd](#gpsd)
|
||||
16. [FSFW](#fsfw)
|
||||
17. [Coding Style](#coding-style)
|
||||
15. [Running OBSW on EGSE](#egse)
|
||||
16. [Manually preparing sysroots to compile gpsd](#gpsd)
|
||||
17. [FSFW](#fsfw)
|
||||
18. [Coding Style](#coding-style)
|
||||
|
||||
# <a id="general"></a> General information
|
||||
|
||||
@ -174,7 +175,7 @@ To build the EIVE watchdog, the corresponding target must be specified in the bu
|
||||
The configure steps do not need to be repeated if the folder has already been configured.
|
||||
|
||||
```sh
|
||||
mkdir build-Debug-Q7S && cd build-Debug-Q7S
|
||||
mkdir build-Debug-Watchdog && cd build-Debug-Watchdog
|
||||
cmake -DTGT_BSP=arm/q7s -DCMAKE_BUILD_TYPE=Debug ..
|
||||
cmake --build . --target eive-watchdog -j
|
||||
```
|
||||
@ -441,12 +442,24 @@ Beagle Bone Black for download here
|
||||
Download it and unzip it somewhere in the Xilinx installation folder.
|
||||
You can use the following command if `wget` can be used or for CI/CD:
|
||||
|
||||
```
|
||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/agnJGYeRf6fw2ci/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz
|
||||
```sh
|
||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/SyXpdBBQX32xPgE/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz
|
||||
```
|
||||
|
||||
Then, create a new environmental variables `Q7S_SYSROOT` and set it to the local system root path.
|
||||
|
||||
### Updating system root for CI
|
||||
|
||||
If the system root is updated, it needs to be manually updated on the buggy file server.
|
||||
If access on `buggy.irs.uni-stuttgart.de` is possible with `ssh` and the rootfs in the cloud
|
||||
[was updated](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/rootfs&fileid=831849)
|
||||
as well, you can update the rootfs like this:
|
||||
|
||||
```sh
|
||||
cd /var/www/eive/tools
|
||||
wget https://eive-cloud.irs.uni-stuttgart.de/index.php/s/SyXpdBBQX32xPgE/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz
|
||||
```
|
||||
|
||||
## Setting up UNIX environment for real-time functionalities
|
||||
|
||||
Please note that on most UNIX environments (e.g. Ubuntu), the real time functionalities
|
||||
@ -1140,6 +1153,35 @@ sudo apt-get install gpiod libgpiod-dev
|
||||
|
||||
to install the required GPIO libraries before cloning the system root folder.
|
||||
|
||||
# <a id="egse"></a> Running OBSW on EGSE
|
||||
The EGSE is a test system from arcsec build arround a raspberry pi 4 to test the star tracker. The IP address of the EGSE (raspberry pi) is 192.168.18.31. An ssh session can be opened with
|
||||
````
|
||||
ssh pi@192.168.18.31
|
||||
````
|
||||
Password: raspberry
|
||||
|
||||
To run the obsw perform the following steps:
|
||||
1. Build the cmake EGSE Configuration
|
||||
* the sysroots for the EGSE can be found [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/egse&fileid=1190471)
|
||||
* toolchain for linux host can be downloaded from [here](https://github.com/Pro/raspi-toolchain)
|
||||
* toolchain for windows host from [here](https://gnutoolchains.com/raspberry/) (the raspios-buster-armhf toolchain is the right one for the EGSE)
|
||||
2. Disable the ser2net systemd service on the EGSE
|
||||
````sh
|
||||
$ sudo systemctl stop ser2net.service
|
||||
````
|
||||
3. Power on the star tracker by running
|
||||
````sh
|
||||
$ ~/powerctrl/enable0.sh`
|
||||
````
|
||||
4. Run portforwarding script for tmtc tcp connection and tcf agent on host PC
|
||||
````sh
|
||||
$ ./scripts/egse-port.sh
|
||||
````
|
||||
5. The star tracker can be powered off by running
|
||||
````sh
|
||||
$ ~/powerctrl/disable0.sh
|
||||
````
|
||||
|
||||
# <a id="gpsd"></a> Manually preparing sysroots to compile gpsd
|
||||
Copy all header files from [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Software/gpsd&fileid=1189985) to the /usr/include directory and all static libraries to /usr/lib.
|
||||
|
||||
|
7
bsp_egse/CMakeLists.txt
Normal file
7
bsp_egse/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(boardconfig)
|
192
bsp_egse/InitMission.cpp
Normal file
192
bsp_egse/InitMission.cpp
Normal file
@ -0,0 +1,192 @@
|
||||
#include "InitMission.h"
|
||||
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
#include <fsfw/tasks/PeriodicTaskIF.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <mission/utility/InitMission.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "ObjectFactory.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "pollingsequence/pollingSequenceFactory.h"
|
||||
|
||||
ServiceInterfaceStream sif::debug("DEBUG");
|
||||
ServiceInterfaceStream sif::info("INFO");
|
||||
ServiceInterfaceStream sif::warning("WARNING");
|
||||
ServiceInterfaceStream sif::error("ERROR");
|
||||
|
||||
ObjectManagerIF* objectManager = nullptr;
|
||||
|
||||
void initmission::initMission() {
|
||||
sif::info << "Make sure the systemd service ser2net on the egse has been stopped "
|
||||
<< "(alias stop-ser2net)" << std::endl;
|
||||
sif::info << "Make sure the power lines of the star tracker have been enabled "
|
||||
<< "(alias enable-startracker)" << std::endl;
|
||||
sif::info << "Building global objects.." << std::endl;
|
||||
/* Instantiate global object manager and also create all objects */
|
||||
ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr);
|
||||
sif::info << "Initializing all objects.." << std::endl;
|
||||
ObjectManager::instance()->initialize();
|
||||
|
||||
/* This function creates and starts all tasks */
|
||||
initTasks();
|
||||
}
|
||||
|
||||
void initmission::initTasks() {
|
||||
TaskFactory* factory = TaskFactory::instance();
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
if (factory == nullptr) {
|
||||
/* Should never happen ! */
|
||||
return;
|
||||
}
|
||||
#if OBSW_PRINT_MISSED_DEADLINES == 1
|
||||
void (*missedDeadlineFunc)(void) = TaskFactory::printMissedDeadline;
|
||||
#else
|
||||
void (*missedDeadlineFunc)(void) = nullptr;
|
||||
#endif
|
||||
|
||||
/* TMTC Distribution */
|
||||
PeriodicTaskIF* tmtcDistributor = factory->createPeriodicTask(
|
||||
"DIST", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
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;
|
||||
}
|
||||
|
||||
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
|
||||
"TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Add component TMTC Bridge failed" << std::endl;
|
||||
}
|
||||
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
||||
"TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Add component TMTC Polling failed" << std::endl;
|
||||
}
|
||||
|
||||
/* PUS Services */
|
||||
std::vector<PeriodicTaskIF*> pusTasks;
|
||||
createPusTasks(*factory, missedDeadlineFunc, pusTasks);
|
||||
|
||||
std::vector<PeriodicTaskIF*> pstTasks;
|
||||
FixedTimeslotTaskIF* pst = factory->createFixedTimeslotTask(
|
||||
"STAR_TRACKER_PST", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 4, 0.5, missedDeadlineFunc);
|
||||
result = pst::pstUart(pst);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
|
||||
}
|
||||
pstTasks.push_back(pst);
|
||||
|
||||
PeriodicTaskIF* strHelperTask = factory->createPeriodicTask(
|
||||
"STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = strHelperTask->addComponent(objects::STR_HELPER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER);
|
||||
}
|
||||
pstTasks.push_back(strHelperTask);
|
||||
|
||||
auto taskStarter = [](std::vector<PeriodicTaskIF*>& taskVector, std::string name) {
|
||||
for (const auto& task : taskVector) {
|
||||
if (task != nullptr) {
|
||||
task->startTask();
|
||||
} else {
|
||||
sif::error << "Task in vector " << name << " is invalid!" << std::endl;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
sif::info << "Starting tasks.." << std::endl;
|
||||
tmtcDistributor->startTask();
|
||||
tmtcBridgeTask->startTask();
|
||||
tmtcPollingTask->startTask();
|
||||
|
||||
taskStarter(pstTasks, "PST Tasks");
|
||||
taskStarter(pusTasks, "PUS Tasks");
|
||||
|
||||
sif::info << "Tasks started.." << std::endl;
|
||||
}
|
||||
|
||||
void initmission::createPusTasks(TaskFactory& factory,
|
||||
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
PeriodicTaskIF* pusVerification = factory.createPeriodicTask(
|
||||
"PUS_VERIF", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||
result = pusVerification->addComponent(objects::PUS_SERVICE_1_VERIFICATION);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Object add component failed" << std::endl;
|
||||
}
|
||||
taskVec.push_back(pusVerification);
|
||||
|
||||
PeriodicTaskIF* pusEvents = factory.createPeriodicTask(
|
||||
"PUS_EVENTS", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||
result = pusEvents->addComponent(objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_EVENTS", objects::PUS_SERVICE_5_EVENT_REPORTING);
|
||||
}
|
||||
result = pusEvents->addComponent(objects::EVENT_MANAGER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS_MGMT", objects::EVENT_MANAGER);
|
||||
}
|
||||
taskVec.push_back(pusEvents);
|
||||
|
||||
PeriodicTaskIF* pusHighPrio = factory.createPeriodicTask(
|
||||
"PUS_HIGH_PRIO", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.200, missedDeadlineFunc);
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS2", objects::PUS_SERVICE_2_DEVICE_ACCESS);
|
||||
}
|
||||
result = pusHighPrio->addComponent(objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS9", objects::PUS_SERVICE_9_TIME_MGMT);
|
||||
}
|
||||
taskVec.push_back(pusHighPrio);
|
||||
|
||||
PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask(
|
||||
"PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc);
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS8", objects::PUS_SERVICE_8_FUNCTION_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS200", objects::PUS_SERVICE_200_MODE_MGMT);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS);
|
||||
}
|
||||
result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING);
|
||||
}
|
||||
taskVec.push_back(pusMedPrio);
|
||||
|
||||
PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask(
|
||||
"PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc);
|
||||
result = pusLowPrio->addComponent(objects::PUS_SERVICE_17_TEST);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST);
|
||||
}
|
||||
result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("INT_ERR_RPRT", objects::INTERNAL_ERROR_REPORTER);
|
||||
}
|
||||
taskVec.push_back(pusLowPrio);
|
||||
}
|
21
bsp_egse/InitMission.h
Normal file
21
bsp_egse/InitMission.h
Normal file
@ -0,0 +1,21 @@
|
||||
#ifndef BSP_LINUX_INITMISSION_H_
|
||||
#define BSP_LINUX_INITMISSION_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "fsfw/tasks/Typedef.h"
|
||||
|
||||
class PeriodicTaskIF;
|
||||
class TaskFactory;
|
||||
|
||||
namespace initmission {
|
||||
void initMission();
|
||||
void initTasks();
|
||||
|
||||
void createPstTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||
std::vector<PeriodicTaskIF*>& taskVec);
|
||||
void createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||
std::vector<PeriodicTaskIF*>& taskVec);
|
||||
}; // namespace initmission
|
||||
|
||||
#endif /* BSP_LINUX_INITMISSION_H_ */
|
49
bsp_egse/ObjectFactory.cpp
Normal file
49
bsp_egse/ObjectFactory.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <devConf.h>
|
||||
#include <fsfw_hal/linux/uart/UartComIF.h>
|
||||
#include <fsfw_hal/linux/uart/UartCookie.h>
|
||||
#include <mission/devices/GPSHyperionHandler.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "busConf.h"
|
||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||
#include "fsfw/tmtcservices/CommandingServiceBase.h"
|
||||
#include "fsfw/tmtcservices/PusServiceBase.h"
|
||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||
#include "linux/devices/startracker/StarTrackerHandler.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "tmtc/apid.h"
|
||||
#include "tmtc/pusIds.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::TMTC_BRIDGE;
|
||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||
}
|
||||
|
||||
void ObjectFactory::produce(void* args) {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
UartCookie* starTrackerCookie =
|
||||
new UartCookie(objects::STAR_TRACKER, egse::STAR_TRACKER_UART, UartModes::NON_CANONICAL,
|
||||
uart::STAR_TRACKER_BAUD, startracker::MAX_FRAME_SIZE * 2 + 2);
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
starTrackerCookie->setNoFixedSizeReply();
|
||||
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
|
||||
StarTrackerHandler* starTrackerHandler = new StarTrackerHandler(
|
||||
objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie, strHelper);
|
||||
starTrackerHandler->setStartUpImmediately();
|
||||
}
|
8
bsp_egse/ObjectFactory.h
Normal file
8
bsp_egse/ObjectFactory.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef BSP_LINUX_OBJECTFACTORY_H_
|
||||
#define BSP_LINUX_OBJECTFACTORY_H_
|
||||
|
||||
namespace ObjectFactory {
|
||||
void produce(void* args);
|
||||
}; // namespace ObjectFactory
|
||||
|
||||
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
7
bsp_egse/boardconfig/CMakeLists.txt
Normal file
7
bsp_egse/boardconfig/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
8
bsp_egse/boardconfig/busConf.h
Normal file
8
bsp_egse/boardconfig/busConf.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef BSP_EGSE_BOARDCONFIG_BUSCONF_H_
|
||||
#define BSP_EGSE_BOARDCONFIG_BUSCONF_H_
|
||||
|
||||
namespace egse {
|
||||
static constexpr char STAR_TRACKER_UART[] = "/dev/serial0";
|
||||
}
|
||||
|
||||
#endif /* BSP_EGSE_BOARDCONFIG_BUSCONF_H_ */
|
38
bsp_egse/boardconfig/etl_profile.h
Normal file
38
bsp_egse/boardconfig/etl_profile.h
Normal file
@ -0,0 +1,38 @@
|
||||
///\file
|
||||
|
||||
/******************************************************************************
|
||||
The MIT License(MIT)
|
||||
|
||||
Embedded Template Library.
|
||||
https://github.com/ETLCPP/etl
|
||||
https://www.etlcpp.com
|
||||
|
||||
Copyright(c) 2019 jwellbelove
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files(the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions :
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
******************************************************************************/
|
||||
#ifndef __ETL_PROFILE_H__
|
||||
#define __ETL_PROFILE_H__
|
||||
|
||||
#define ETL_CHECK_PUSH_POP
|
||||
|
||||
#define ETL_CPP11_SUPPORTED 1
|
||||
#define ETL_NO_NULLPTR_SUPPORT 0
|
||||
|
||||
#endif
|
15
bsp_egse/boardconfig/gcov.h
Normal file
15
bsp_egse/boardconfig/gcov.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef LINUX_GCOV_H_
|
||||
#define LINUX_GCOV_H_
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
#ifdef GCOV
|
||||
extern "C" void __gcov_flush();
|
||||
#else
|
||||
void __gcov_flush() {
|
||||
sif::info << "GCC GCOV: Please supply GCOV=1 in Makefile if "
|
||||
"coverage information is desired.\n"
|
||||
<< std::flush;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LINUX_GCOV_H_ */
|
10
bsp_egse/boardconfig/print.c
Normal file
10
bsp_egse/boardconfig/print.c
Normal file
@ -0,0 +1,10 @@
|
||||
#include <bsp_egse/boardconfig/print.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void printChar(const char* character, bool errStream) {
|
||||
if (errStream) {
|
||||
putc(*character, stderr);
|
||||
return;
|
||||
}
|
||||
putc(*character, stdout);
|
||||
}
|
8
bsp_egse/boardconfig/print.h
Normal file
8
bsp_egse/boardconfig/print.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef HOSTED_BOARDCONFIG_PRINT_H_
|
||||
#define HOSTED_BOARDCONFIG_PRINT_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
void printChar(const char* character, bool errStream);
|
||||
|
||||
#endif /* HOSTED_BOARDCONFIG_PRINT_H_ */
|
6
bsp_egse/boardconfig/rpiConfig.h.in
Normal file
6
bsp_egse/boardconfig/rpiConfig.h.in
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_
|
||||
#define BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#endif /* BSP_RPI_BOARDCONFIG_RPI_CONFIG_H_ */
|
28
bsp_egse/main.cpp
Normal file
28
bsp_egse/main.cpp
Normal file
@ -0,0 +1,28 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "InitMission.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
#include "fsfw/FSFWVersion.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
|
||||
/**
|
||||
* @brief This is the main program entry point for the egse (raspberry pi 4)
|
||||
* @return
|
||||
*/
|
||||
int main(void) {
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for EGSE from Arcsec"
|
||||
<< " --" << std::endl;
|
||||
std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "."
|
||||
<< SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << FSFW_REVISION
|
||||
<< "--" << std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
initmission::initMission();
|
||||
|
||||
for (;;) {
|
||||
/* Suspend main thread by sleeping it. */
|
||||
TaskFactory::delayTask(5000);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
|
@ -64,17 +64,17 @@ void initmission::initTasks() {
|
||||
}
|
||||
|
||||
/* UDP bridge */
|
||||
PeriodicTaskIF* udpBridgeTask = factory->createPeriodicTask(
|
||||
"UDP_UNIX_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = udpBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||
PeriodicTaskIF* tmtcBridgeTask = factory->createPeriodicTask(
|
||||
"TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Add component UDP Unix Bridge failed" << std::endl;
|
||||
sif::error << "Add component TMTC Bridge failed" << std::endl;
|
||||
}
|
||||
PeriodicTaskIF* udpPollingTask = factory->createPeriodicTask(
|
||||
"UDP_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
result = udpPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
||||
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
||||
"TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
result = tmtcPollingTask->addComponent(objects::TMTC_POLLING_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "Add component UDP Polling failed" << std::endl;
|
||||
sif::error << "Add component TMTC Polling failed" << std::endl;
|
||||
}
|
||||
|
||||
/* PUS Services */
|
||||
@ -100,8 +100,8 @@ void initmission::initTasks() {
|
||||
|
||||
sif::info << "Starting tasks.." << std::endl;
|
||||
tmTcDistributor->startTask();
|
||||
udpBridgeTask->startTask();
|
||||
udpPollingTask->startTask();
|
||||
tmtcBridgeTask->startTask();
|
||||
tmtcPollingTask->startTask();
|
||||
|
||||
taskStarter(pusTasks, "PUS Tasks");
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
@ -211,7 +211,7 @@ void initmission::createTestTasks(TaskFactory& factory,
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK);
|
||||
}
|
||||
#if RPI_ADD_SPI_TEST == 1
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 1
|
||||
result = testTask->addComponent(objects::SPI_TEST);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST);
|
||||
@ -223,12 +223,13 @@ void initmission::createTestTasks(TaskFactory& factory,
|
||||
initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST);
|
||||
}
|
||||
#endif /* RPI_ADD_GPIO_TEST == 1 */
|
||||
#if RPI_ADD_UART_TEST == 1
|
||||
#if OBSW_ADD_UART_TEST_CODE == 1
|
||||
result = testTask->addComponent(objects::UART_TEST);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("UART_TEST", objects::UART_TEST);
|
||||
}
|
||||
#endif /* RPI_ADD_GPIO_TEST == 1 */
|
||||
taskVec.push_back(testTask);
|
||||
|
||||
bool startTestPst = true;
|
||||
static_cast<void>(startTestPst);
|
||||
|
@ -1,9 +1,7 @@
|
||||
#include "ObjectFactory.h"
|
||||
|
||||
#include <devConf.h>
|
||||
#include <mission/devices/GPSHyperionHandler.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "devConf.h"
|
||||
#include "devices/addresses.h"
|
||||
#include "devices/gpioIds.h"
|
||||
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
|
||||
@ -15,6 +13,7 @@
|
||||
#include "linux/boardtest/SpiTestClass.h"
|
||||
#include "linux/boardtest/UartTestClass.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
#include "mission/devices/GPSHyperionHandler.h"
|
||||
#include "mission/devices/GyroADIS1650XHandler.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
@ -61,16 +60,6 @@ void ObjectFactory::produce(void* args) {
|
||||
Factory::setStaticFrameworkObjectIds();
|
||||
ObjectFactory::produceGenericObjects();
|
||||
|
||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 1
|
||||
auto tmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||
new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
|
||||
#else
|
||||
auto tmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
tmtcBridge->setMaxNumberOfPacketsStored(50);
|
||||
new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE);
|
||||
#endif
|
||||
|
||||
GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF);
|
||||
GpioCookie* gpioCookie = nullptr;
|
||||
static_cast<void>(gpioCookie);
|
||||
@ -188,11 +177,11 @@ void ObjectFactory::produce(void* args) {
|
||||
void ObjectFactory::createTestTasks() {
|
||||
new TestTask(objects::TEST_TASK);
|
||||
|
||||
#if RPI_ADD_SPI_TEST == 1
|
||||
#if OBSW_ADD_SPI_TEST_CODE == 1
|
||||
new SpiTestClass(objects::SPI_TEST, gpioIF);
|
||||
#endif
|
||||
|
||||
#if RPI_ADD_UART_TEST == 1
|
||||
#if OBSW_ADD_UART_TEST_CODE == 1
|
||||
new UartTestClass(objects::UART_TEST);
|
||||
#else
|
||||
new UartComIF(objects::UART_COM_IF);
|
||||
|
@ -1,7 +1,7 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <bsp_q7s/boardconfig/print.h>
|
||||
#include <bsp_linux_board/boardconfig/print.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void printChar(const char* character, bool errStream) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
)
|
||||
|
||||
|
||||
|
@ -11,19 +11,15 @@ target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC
|
||||
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
|
||||
add_subdirectory(simple)
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
main.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(boardtest)
|
||||
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(comIF)
|
||||
add_subdirectory(gpio)
|
||||
add_subdirectory(core)
|
||||
add_subdirectory(memory)
|
||||
add_subdirectory(callbacks)
|
||||
add_subdirectory(devices)
|
||||
|
||||
|
@ -29,6 +29,7 @@ static const int PTME_CONFIG = 4;
|
||||
} // namespace uiomapids
|
||||
|
||||
namespace gpioNames {
|
||||
|
||||
static constexpr char GYRO_0_ADIS_CS[] = "gyro_0_adis_chip_select";
|
||||
static constexpr char GYRO_1_L3G_CS[] = "gyro_1_l3g_chip_select";
|
||||
static constexpr char GYRO_2_ADIS_CS[] = "gyro_2_adis_chip_select";
|
||||
@ -44,6 +45,8 @@ static constexpr char GNSS_1_ENABLE[] = "enable_gnss_1";
|
||||
static constexpr char GYRO_0_ENABLE[] = "enable_gyro_0";
|
||||
static constexpr char GYRO_2_ENABLE[] = "enable_gyro_2";
|
||||
static constexpr char GNSS_SELECT[] = "gnss_mux_select";
|
||||
static constexpr char GNSS_MUX_SELECT[] = "gnss_mux_select";
|
||||
|
||||
static constexpr char HEATER_0[] = "heater0";
|
||||
static constexpr char HEATER_1[] = "heater1";
|
||||
static constexpr char HEATER_2[] = "heater2";
|
||||
@ -54,19 +57,20 @@ static constexpr char HEATER_6[] = "heater6";
|
||||
static constexpr char HEATER_7[] = "heater7";
|
||||
static constexpr char SA_DPL_PIN_0[] = "sa_dpl_0";
|
||||
static constexpr char SA_DPL_PIN_1[] = "sa_dpl_1";
|
||||
static constexpr char SPI_MUX_BIT_0_PIN[] = "spi_mux_bit_0";
|
||||
static constexpr char SPI_MUX_BIT_1_PIN[] = "spi_mux_bit_1";
|
||||
static constexpr char SPI_MUX_BIT_2_PIN[] = "spi_mux_bit_2";
|
||||
static constexpr char SPI_MUX_BIT_3_PIN[] = "spi_mux_bit_3";
|
||||
static constexpr char SPI_MUX_BIT_4_PIN[] = "spi_mux_bit_4";
|
||||
static constexpr char SPI_MUX_BIT_5_PIN[] = "spi_mux_bit_5";
|
||||
static constexpr char SPI_MUX_BIT_6_PIN[] = "spi_mux_bit_6";
|
||||
static constexpr char EN_RW_CS[] = "en_rw_cs";
|
||||
static constexpr char EN_RW_1[] = "enable_rw_1";
|
||||
static constexpr char EN_RW_2[] = "enable_rw_2";
|
||||
static constexpr char EN_RW_3[] = "enable_rw_3";
|
||||
static constexpr char EN_RW_4[] = "enable_rw_4";
|
||||
static constexpr char GNSS_MUX_SELECT[] = "gnss_mux_select";
|
||||
|
||||
static constexpr char RAD_SENSOR_CHIP_SELECT[] = "rad_sensor_chip_select";
|
||||
static constexpr char ENABLE_RADFET[] = "enable_radfet";
|
||||
static constexpr char PAPB_BUSY_SIGNAL_VC0[] = "papb_busy_signal_vc0";
|
||||
static constexpr char PAPB_EMPTY_SIGNAL_VC0[] = "papb_empty_signal_vc0";
|
||||
static constexpr char PAPB_BUSY_SIGNAL_VC1[] = "papb_busy_signal_vc1";
|
||||
@ -80,6 +84,16 @@ static constexpr char RS485_EN_TX_DATA[] = "tx_data_enable_ltc2872";
|
||||
static constexpr char RS485_EN_RX_CLOCK[] = "rx_clock_enable_ltc2872";
|
||||
static constexpr char RS485_EN_RX_DATA[] = "rx_data_enable_ltc2872";
|
||||
static constexpr char PDEC_RESET[] = "pdec_reset";
|
||||
|
||||
static constexpr char PL_PCDU_ENABLE_VBAT0[] = "enable_plpcdu_vbat0";
|
||||
static constexpr char PL_PCDU_ENABLE_VBAT1[] = "enable_plpcdu_vbat1";
|
||||
static constexpr char PL_PCDU_ENABLE_DRO[] = "enable_plpcdu_dro";
|
||||
static constexpr char PL_PCDU_ENABLE_X8[] = "enable_plpcdu_x8";
|
||||
static constexpr char PL_PCDU_ENABLE_TX[] = "enable_plpcdu_tx";
|
||||
static constexpr char PL_PCDU_ENABLE_HPA[] = "enable_plpcdu_hpa";
|
||||
static constexpr char PL_PCDU_ENABLE_MPA[] = "enable_plpcdu_mpa";
|
||||
static constexpr char PL_PCDU_ADC_CS[] = "plpcdu_adc_chip_select";
|
||||
|
||||
} // namespace gpioNames
|
||||
} // namespace q7s
|
||||
|
||||
|
@ -142,13 +142,13 @@ void Q7STestTask::testDummyParams() {
|
||||
param.print();
|
||||
|
||||
int test = 0;
|
||||
result = param.getValue<int>(DummyParameter::DUMMY_KEY_PARAM_1, &test);
|
||||
result = param.getValue<int>(DummyParameter::DUMMY_KEY_PARAM_1, test);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testDummyParams: Key " << DummyParameter::DUMMY_KEY_PARAM_1
|
||||
<< " does not exist" << std::endl;
|
||||
}
|
||||
std::string test2;
|
||||
result = param.getValue<std::string>(DummyParameter::DUMMY_KEY_PARAM_2, &test2);
|
||||
result = param.getValue<std::string>(DummyParameter::DUMMY_KEY_PARAM_2, test2);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testDummyParams: Key " << DummyParameter::DUMMY_KEY_PARAM_1
|
||||
<< " does not exist" << std::endl;
|
||||
@ -170,15 +170,15 @@ void Q7STestTask::testProtHandler() {
|
||||
bool opPerformed = false;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
// If any chips are unlocked, lock them here
|
||||
result = coreController->setBootCopyProtection(
|
||||
CoreController::Chip::ALL_CHIP, CoreController::Copy::ALL_COPY, true, opPerformed, true);
|
||||
result = coreController->setBootCopyProtection(xsc::Chip::ALL_CHIP, xsc::Copy::ALL_COPY, true,
|
||||
opPerformed, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||
}
|
||||
|
||||
// unlock own copy
|
||||
result = coreController->setBootCopyProtection(
|
||||
CoreController::Chip::SELF_CHIP, CoreController::Copy::SELF_COPY, false, opPerformed, true);
|
||||
result = coreController->setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, false,
|
||||
opPerformed, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||
}
|
||||
@ -191,8 +191,8 @@ void Q7STestTask::testProtHandler() {
|
||||
}
|
||||
|
||||
// lock own copy
|
||||
result = coreController->setBootCopyProtection(
|
||||
CoreController::Chip::SELF_CHIP, CoreController::Copy::SELF_COPY, true, opPerformed, true);
|
||||
result = coreController->setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
|
||||
opPerformed, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||
}
|
||||
@ -205,8 +205,8 @@ void Q7STestTask::testProtHandler() {
|
||||
}
|
||||
|
||||
// unlock specific copy
|
||||
result = coreController->setBootCopyProtection(
|
||||
CoreController::Chip::CHIP_1, CoreController::Copy::COPY_1, false, opPerformed, true);
|
||||
result = coreController->setBootCopyProtection(xsc::Chip::CHIP_1, xsc::Copy::COPY_1, false,
|
||||
opPerformed, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||
}
|
||||
@ -219,8 +219,8 @@ void Q7STestTask::testProtHandler() {
|
||||
}
|
||||
|
||||
// lock specific copy
|
||||
result = coreController->setBootCopyProtection(
|
||||
CoreController::Chip::CHIP_1, CoreController::Copy::COPY_1, true, opPerformed, true);
|
||||
result = coreController->setBootCopyProtection(xsc::Chip::CHIP_1, xsc::Copy::COPY_1, true,
|
||||
opPerformed, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Q7STestTask::testProtHandler: Op failed" << std::endl;
|
||||
}
|
||||
|
@ -2,4 +2,5 @@ target_sources(${OBSW_NAME} PRIVATE
|
||||
rwSpiCallback.cpp
|
||||
gnssCallback.cpp
|
||||
pcduSwitchCb.cpp
|
||||
gpioCallbacks.cpp
|
||||
)
|
||||
|
@ -12,6 +12,7 @@ namespace gpioCallbacks {
|
||||
GpioIF* gpioComInterface;
|
||||
|
||||
void initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
using namespace gpio;
|
||||
ReturnValue_t result;
|
||||
|
||||
if (gpioComIF == nullptr) {
|
||||
@ -25,40 +26,30 @@ void initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
|
||||
GpiodRegularByLineName* spiMuxBit = nullptr;
|
||||
/** Setting mux bit 1 to low will disable IC21 on the interface board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 1",
|
||||
gpio::DIR_OUT, gpio::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_0_PIN, "SPI Mux Bit 1",
|
||||
Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_0, spiMuxBit);
|
||||
/** Setting mux bit 2 to low disables IC1 on the TCS board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 2",
|
||||
gpio::DIR_OUT, gpio::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 2",
|
||||
Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
|
||||
/** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit 3",
|
||||
gpio::DIR_OUT, gpio::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
|
||||
|
||||
// spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_1_PIN, "SPI Mux Bit 1",
|
||||
// gpio::OUT, gpio::LOW);
|
||||
// spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_1, spiMuxBit);
|
||||
// /** Setting mux bit 2 to low disables IC1 on the TCS board */
|
||||
// spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 2",
|
||||
// gpio::OUT, gpio::HIGH); spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
|
||||
// /** Setting mux bit 3 to low disables IC2 on the TCS board and IC22 on the interface board
|
||||
// */ spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit
|
||||
// 3", gpio::OUT, gpio::LOW); spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_2_PIN, "SPI Mux Bit 3",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_2, spiMuxBit);
|
||||
|
||||
/** The following gpios can take arbitrary initial values */
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_4_PIN, "SPI Mux Bit 4",
|
||||
gpio::DIR_OUT, gpio::LOW);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_3_PIN, "SPI Mux Bit 4",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_3, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_4_PIN, "SPI Mux Bit 5",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_4, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_5_PIN, "SPI Mux Bit 5",
|
||||
gpio::DIR_OUT, gpio::LOW);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_5_PIN, "SPI Mux Bit 6",
|
||||
Direction::OUT, Levels::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_5, spiMuxBit);
|
||||
spiMuxBit = new GpiodRegularByLineName(q7s::gpioNames::SPI_MUX_BIT_6_PIN, "SPI Mux Bit 6",
|
||||
gpio::DIR_OUT, gpio::LOW);
|
||||
spiMuxGpios->addGpio(gpioIds::SPI_MUX_BIT_6, spiMuxBit);
|
||||
GpiodRegularByLineName* enRwDecoder =
|
||||
new GpiodRegularByLineName(q7s::gpioNames::EN_RW_CS, "EN_RW_CS", gpio::DIR_OUT, gpio::HIGH);
|
||||
GpiodRegularByLineName* enRwDecoder = new GpiodRegularByLineName(
|
||||
q7s::gpioNames::EN_RW_CS, "EN_RW_CS", Direction::OUT, Levels::HIGH);
|
||||
spiMuxGpios->addGpio(gpioIds::EN_RW_CS, enRwDecoder);
|
||||
|
||||
result = gpioComInterface->addGpios(spiMuxGpios);
|
||||
@ -70,6 +61,7 @@ void initSpiCsDecoder(GpioIF* gpioComIF) {
|
||||
|
||||
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Levels value,
|
||||
void* args) {
|
||||
using namespace gpio;
|
||||
if (gpioComInterface == nullptr) {
|
||||
sif::debug << "spiCsDecoderCallback: No gpioComIF specified. Call initSpiCsDecoder "
|
||||
<< "to specify gpioComIF" << std::endl;
|
||||
@ -81,7 +73,7 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
return;
|
||||
}
|
||||
|
||||
if (value == gpio::HIGH) {
|
||||
if (value == Levels::HIGH) {
|
||||
switch (gpioId) {
|
||||
case (gpioIds::RTD_IC_3): {
|
||||
disableDecoderTcsIc1();
|
||||
@ -147,6 +139,10 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
disableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_0): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_1): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
@ -156,23 +152,23 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_3): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_4): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_5): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_6): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_7): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_8): {
|
||||
@ -180,25 +176,17 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_9): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_10): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_11): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_12): {
|
||||
disableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_13): {
|
||||
disableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW1): {
|
||||
disableRwDecoder();
|
||||
break;
|
||||
@ -218,7 +206,7 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
default:
|
||||
sif::debug << "spiCsDecoderCallback: Invalid gpio id " << gpioId << std::endl;
|
||||
}
|
||||
} else if (value == gpio::LOW) {
|
||||
} else if (value == Levels::LOW) {
|
||||
switch (gpioId) {
|
||||
case (gpioIds::RTD_IC_3): {
|
||||
selectY7();
|
||||
@ -300,71 +288,66 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
enableDecoderTcsIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_1): {
|
||||
case (gpioIds::CS_SUS_0): {
|
||||
selectY0();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_1): {
|
||||
selectY1();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_2): {
|
||||
selectY1();
|
||||
selectY2();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_3): {
|
||||
selectY3();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_4): {
|
||||
selectY4();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_5): {
|
||||
selectY5();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_6): {
|
||||
selectY0();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_4): {
|
||||
case (gpioIds::CS_SUS_7): {
|
||||
selectY1();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_5): {
|
||||
selectY2();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_6): {
|
||||
selectY2();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_7): {
|
||||
selectY3();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_8): {
|
||||
selectY3();
|
||||
selectY2();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_9): {
|
||||
selectY4();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
selectY3();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_10): {
|
||||
selectY5();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_11): {
|
||||
selectY4();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_12): {
|
||||
case (gpioIds::CS_SUS_11): {
|
||||
selectY5();
|
||||
enableDecoderInterfaceBoardIc2();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_SUS_13): {
|
||||
selectY6();
|
||||
enableDecoderInterfaceBoardIc1();
|
||||
break;
|
||||
}
|
||||
case (gpioIds::CS_RW1): {
|
||||
selectY0();
|
||||
enableRwDecoder();
|
||||
@ -394,52 +377,52 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Lev
|
||||
}
|
||||
|
||||
void enableDecoderTcsIc1() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableDecoderTcsIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
}
|
||||
|
||||
void enableDecoderInterfaceBoardIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableDecoderInterfaceBoardIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableDecoderInterfaceBoardIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
}
|
||||
|
||||
void enableDecoderInterfaceBoardIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderTcsIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderTcsIc2() {
|
||||
// DO NOT CHANGE THE ORDER HERE
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderInterfaceBoardIc1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void disableDecoderInterfaceBoardIc2() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
}
|
||||
|
||||
void enableRwDecoder() { gpioComInterface->pullHigh(gpioIds::EN_RW_CS); }
|
||||
@ -447,57 +430,57 @@ void enableRwDecoder() { gpioComInterface->pullHigh(gpioIds::EN_RW_CS); }
|
||||
void disableRwDecoder() { gpioComInterface->pullLow(gpioIds::EN_RW_CS); }
|
||||
|
||||
void selectY0() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6);
|
||||
}
|
||||
|
||||
void selectY1() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6);
|
||||
}
|
||||
|
||||
void selectY2() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY3() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_6);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY4() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY5() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
}
|
||||
|
||||
void selectY6() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6);
|
||||
}
|
||||
|
||||
void selectY7() {
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_4);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_5);
|
||||
gpioComInterface->pullHigh(gpioIds::SPI_MUX_BIT_6);
|
||||
}
|
||||
|
||||
void disableAllDecoder() {
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_3);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_2);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_0);
|
||||
gpioComInterface->pullLow(gpioIds::SPI_MUX_BIT_1);
|
||||
gpioComInterface->pullLow(gpioIds::EN_RW_CS);
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "CoreController.h"
|
||||
|
||||
#include <fsfw/events/EventManager.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
#include "fsfw/FSFWVersion.h"
|
||||
@ -20,8 +22,8 @@
|
||||
#include "bsp_q7s/memory/SdCardManager.h"
|
||||
#include "bsp_q7s/memory/scratchApi.h"
|
||||
|
||||
CoreController::Chip CoreController::CURRENT_CHIP = Chip::NO_CHIP;
|
||||
CoreController::Copy CoreController::CURRENT_COPY = Copy::NO_COPY;
|
||||
xsc::Chip CoreController::CURRENT_CHIP = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy CoreController::CURRENT_COPY = xsc::Copy::NO_COPY;
|
||||
|
||||
CoreController::CoreController(object_id_t objectId)
|
||||
: ExtendedControllerBase(objectId, objects::NO_OBJECT, 5), opDivider(5) {
|
||||
@ -57,6 +59,7 @@ ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) {
|
||||
void CoreController::performControlOperation() {
|
||||
performWatchdogControlOperation();
|
||||
sdStateMachine();
|
||||
performMountedSdCardOperations();
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
@ -77,6 +80,8 @@ ReturnValue_t CoreController::initialize() {
|
||||
}
|
||||
|
||||
sdStateMachine();
|
||||
|
||||
triggerEvent(REBOOT_SW, CURRENT_CHIP, CURRENT_COPY);
|
||||
return ExtendedControllerBase::initialize();
|
||||
}
|
||||
|
||||
@ -89,7 +94,7 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
}
|
||||
}
|
||||
sdStateMachine();
|
||||
result = initVersionFile();
|
||||
performMountedSdCardOperations();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "CoreController::initialize: Version initialization failed" << std::endl;
|
||||
}
|
||||
@ -102,6 +107,72 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() {
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
const uint8_t *data, size_t size) {
|
||||
switch (actionId) {
|
||||
case (LIST_DIRECTORY_INTO_FILE): {
|
||||
return actionListDirectoryIntoFile(actionId, commandedBy, data, size);
|
||||
}
|
||||
case (SWITCH_REBOOT_FILE_HANDLING): {
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (data[0] == 0) {
|
||||
rebootFile.enabled = false;
|
||||
rewriteRebootFile(rebootFile);
|
||||
} else if (data[0] == 1) {
|
||||
rebootFile.enabled = true;
|
||||
rewriteRebootFile(rebootFile);
|
||||
} else {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (RESET_REBOOT_COUNTERS): {
|
||||
if (size == 0) {
|
||||
resetRebootCount(xsc::ALL_CHIP, xsc::ALL_COPY);
|
||||
} else if (size == 2) {
|
||||
if (data[0] > 1 or data[1] > 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
resetRebootCount(static_cast<xsc::Chip>(data[0]), static_cast<xsc::Copy>(data[1]));
|
||||
}
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (SWITCH_IMG_LOCK): {
|
||||
if (size != 3) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
if (data[1] > 1 or data[2] > 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
setRebootMechanismLock(data[0], static_cast<xsc::Chip>(data[1]),
|
||||
static_cast<xsc::Copy>(data[2]));
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (SET_MAX_REBOOT_CNT): {
|
||||
if (size < 1) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
rebootFile.maxCount = data[0];
|
||||
rewriteRebootFile(rebootFile);
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
case (REBOOT_OBC): {
|
||||
return actionPerformReboot(data, size);
|
||||
}
|
||||
default: {
|
||||
return HasActionsIF::INVALID_ACTION_ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
@ -500,21 +571,6 @@ ReturnValue_t CoreController::sdCardSetup(sd::SdCard sdCard, sd::SdState targetS
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
const uint8_t *data, size_t size) {
|
||||
switch (actionId) {
|
||||
case (LIST_DIRECTORY_INTO_FILE): {
|
||||
return actionListDirectoryIntoFile(actionId, commandedBy, data, size);
|
||||
}
|
||||
case (REBOOT_OBC): {
|
||||
return actionPerformReboot(data, size);
|
||||
}
|
||||
default: {
|
||||
return HasActionsIF::INVALID_ACTION_ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::sdColdRedundantBlockingInit() {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
|
||||
@ -689,7 +745,7 @@ ReturnValue_t CoreController::actionListDirectoryIntoFile(ActionId_t actionId,
|
||||
|
||||
ReturnValue_t CoreController::initBootCopy() {
|
||||
if (not std::filesystem::exists(CURR_COPY_FILE)) {
|
||||
// Thils file is created by the systemd service eive-early-config so this should
|
||||
// This file is created by the systemd service eive-early-config so this should
|
||||
// not happen normally
|
||||
std::string cmd = "xsc_boot_copy > " + std::string(CURR_COPY_FILE);
|
||||
int result = std::system(cmd.c_str());
|
||||
@ -697,22 +753,18 @@ ReturnValue_t CoreController::initBootCopy() {
|
||||
utility::handleSystemError(result, "CoreController::initBootCopy");
|
||||
}
|
||||
}
|
||||
std::ifstream file(CURR_COPY_FILE);
|
||||
std::string line;
|
||||
std::getline(file, line);
|
||||
std::istringstream iss(line);
|
||||
int value = 0;
|
||||
iss >> value;
|
||||
CURRENT_CHIP = static_cast<Chip>(value);
|
||||
iss >> value;
|
||||
CURRENT_COPY = static_cast<Copy>(value);
|
||||
|
||||
getCurrentBootCopy(CURRENT_CHIP, CURRENT_COPY);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void CoreController::getCurrentBootCopy(Chip &chip, Copy ©) {
|
||||
void CoreController::getCurrentBootCopy(xsc::Chip &chip, xsc::Copy ©) {
|
||||
xsc_libnor_chip_t xscChip;
|
||||
xsc_libnor_copy_t xscCopy;
|
||||
xsc_boot_get_chip_copy(&xscChip, &xscCopy);
|
||||
// Not really thread-safe but it does not need to be
|
||||
chip = CURRENT_CHIP;
|
||||
copy = CURRENT_COPY;
|
||||
chip = static_cast<xsc::Chip>(xscChip);
|
||||
copy = static_cast<xsc::Copy>(xscCopy);
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::initWatchdogFifo() {
|
||||
@ -759,8 +811,8 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_0);
|
||||
SdCardManager::instance()->switchOffSdCard(sd::SdCard::SLOT_1);
|
||||
// If any boot copies are unprotected
|
||||
ReturnValue_t retval =
|
||||
setBootCopyProtection(Chip::SELF_CHIP, Copy::SELF_COPY, true, protOpPerformed, false);
|
||||
ReturnValue_t retval = setBootCopyProtection(xsc::Chip::SELF_CHIP, xsc::Copy::SELF_COPY, true,
|
||||
protOpPerformed, false);
|
||||
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
sif::info << "Running slot was writeprotected before reboot" << std::endl;
|
||||
}
|
||||
@ -771,7 +823,7 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
}
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
}
|
||||
if (size < 3) {
|
||||
if (size < 3 or (data[1] > 1 or data[2] > 1)) {
|
||||
return HasActionsIF::INVALID_PARAMETERS;
|
||||
}
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
@ -782,21 +834,53 @@ ReturnValue_t CoreController::actionPerformReboot(const uint8_t *data, size_t si
|
||||
// Check that the target chip and copy is writeprotected first
|
||||
generateChipStateFile();
|
||||
// If any boot copies are unprotected, protect them here
|
||||
ReturnValue_t retval = setBootCopyProtection(
|
||||
static_cast<Chip>(data[1]), static_cast<Copy>(data[2]), true, protOpPerformed, false);
|
||||
auto tgtChip = static_cast<xsc::Chip>(data[1]);
|
||||
auto tgtCopy = static_cast<xsc::Copy>(data[2]);
|
||||
|
||||
ReturnValue_t retval =
|
||||
setBootCopyProtection(static_cast<xsc::Chip>(data[1]), static_cast<xsc::Copy>(data[2]), true,
|
||||
protOpPerformed, false);
|
||||
if (retval == HasReturnvaluesIF::RETURN_OK and protOpPerformed) {
|
||||
sif::info << "Target slot was writeprotected before reboot" << std::endl;
|
||||
}
|
||||
|
||||
// The second byte in data is the target chip, the third byte is the target copy
|
||||
std::string cmdString =
|
||||
"xsc_boot_copy " + std::to_string(data[1]) + " " + std::to_string(data[2]);
|
||||
int result = std::system(cmdString.c_str());
|
||||
if (result != 0) {
|
||||
utility::handleSystemError(result, "CoreController::executeAction");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
switch (tgtChip) {
|
||||
case (xsc::Chip::CHIP_0): {
|
||||
switch (tgtCopy) {
|
||||
case (xsc::Copy::COPY_0): {
|
||||
xsc_boot_copy(XSC_LIBNOR_CHIP_0, XSC_LIBNOR_COPY_NOMINAL);
|
||||
break;
|
||||
}
|
||||
return HasActionsIF::EXECUTION_FINISHED;
|
||||
case (xsc::Copy::COPY_1): {
|
||||
xsc_boot_copy(XSC_LIBNOR_CHIP_0, XSC_LIBNOR_COPY_GOLD);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case (xsc::Chip::CHIP_1): {
|
||||
switch (tgtCopy) {
|
||||
case (xsc::Copy::COPY_0): {
|
||||
xsc_boot_copy(XSC_LIBNOR_CHIP_1, XSC_LIBNOR_COPY_NOMINAL);
|
||||
break;
|
||||
}
|
||||
case (xsc::Copy::COPY_1): {
|
||||
xsc_boot_copy(XSC_LIBNOR_CHIP_1, XSC_LIBNOR_COPY_GOLD);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
CoreController::~CoreController() {}
|
||||
@ -850,8 +934,8 @@ ReturnValue_t CoreController::generateChipStateFile() {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t CoreController::setBootCopyProtection(Chip targetChip, Copy targetCopy, bool protect,
|
||||
bool &protOperationPerformed,
|
||||
ReturnValue_t CoreController::setBootCopyProtection(xsc::Chip targetChip, xsc::Copy targetCopy,
|
||||
bool protect, bool &protOperationPerformed,
|
||||
bool updateProtFile) {
|
||||
bool allChips = false;
|
||||
bool allCopies = false;
|
||||
@ -860,14 +944,14 @@ ReturnValue_t CoreController::setBootCopyProtection(Chip targetChip, Copy target
|
||||
protOperationPerformed = false;
|
||||
|
||||
switch (targetChip) {
|
||||
case (Chip::ALL_CHIP): {
|
||||
case (xsc::Chip::ALL_CHIP): {
|
||||
allChips = true;
|
||||
break;
|
||||
}
|
||||
case (Chip::NO_CHIP): {
|
||||
case (xsc::Chip::NO_CHIP): {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
case (Chip::SELF_CHIP): {
|
||||
case (xsc::Chip::SELF_CHIP): {
|
||||
selfChip = true;
|
||||
targetChip = CURRENT_CHIP;
|
||||
break;
|
||||
@ -877,14 +961,14 @@ ReturnValue_t CoreController::setBootCopyProtection(Chip targetChip, Copy target
|
||||
}
|
||||
}
|
||||
switch (targetCopy) {
|
||||
case (Copy::ALL_COPY): {
|
||||
case (xsc::Copy::ALL_COPY): {
|
||||
allCopies = true;
|
||||
break;
|
||||
}
|
||||
case (Copy::NO_COPY): {
|
||||
case (xsc::Copy::NO_COPY): {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
case (Copy::SELF_COPY): {
|
||||
case (xsc::Copy::SELF_COPY): {
|
||||
selfCopy = true;
|
||||
targetCopy = CURRENT_COPY;
|
||||
break;
|
||||
@ -907,10 +991,10 @@ ReturnValue_t CoreController::setBootCopyProtection(Chip targetChip, Copy target
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
int CoreController::handleBootCopyProtAtIndex(Chip targetChip, Copy targetCopy, bool protect,
|
||||
bool &protOperationPerformed, bool selfChip,
|
||||
bool selfCopy, bool allChips, bool allCopies,
|
||||
uint8_t arrIdx) {
|
||||
int CoreController::handleBootCopyProtAtIndex(xsc::Chip targetChip, xsc::Copy targetCopy,
|
||||
bool protect, bool &protOperationPerformed,
|
||||
bool selfChip, bool selfCopy, bool allChips,
|
||||
bool allCopies, uint8_t arrIdx) {
|
||||
bool currentProt = protArray[arrIdx];
|
||||
std::ostringstream oss;
|
||||
bool performOp = false;
|
||||
@ -923,22 +1007,22 @@ int CoreController::handleBootCopyProtAtIndex(Chip targetChip, Copy targetCopy,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
Chip currentChip;
|
||||
Copy currentCopy;
|
||||
xsc::Chip currentChip;
|
||||
xsc::Copy currentCopy;
|
||||
oss << "writeprotect ";
|
||||
if (arrIdx == 0 or arrIdx == 1) {
|
||||
oss << "0 ";
|
||||
currentChip = Chip::CHIP_0;
|
||||
currentChip = xsc::Chip::CHIP_0;
|
||||
} else {
|
||||
oss << "1 ";
|
||||
currentChip = Chip::CHIP_1;
|
||||
currentChip = xsc::Chip::CHIP_1;
|
||||
}
|
||||
if (arrIdx == 0 or arrIdx == 2) {
|
||||
oss << "0 ";
|
||||
currentCopy = Copy::COPY_0;
|
||||
currentCopy = xsc::Copy::COPY_0;
|
||||
} else {
|
||||
oss << "1 ";
|
||||
currentCopy = Copy::COPY_1;
|
||||
currentCopy = xsc::Copy::COPY_1;
|
||||
}
|
||||
if (protect) {
|
||||
oss << "1";
|
||||
@ -1033,29 +1117,29 @@ ReturnValue_t CoreController::handleProtInfoUpdateLine(std::string nextLine) {
|
||||
uint8_t wordIdx = 0;
|
||||
uint8_t arrayIdx = 0;
|
||||
istringstream iss(nextLine);
|
||||
Chip currentChip = Chip::CHIP_0;
|
||||
Copy currentCopy = Copy::COPY_0;
|
||||
xsc::Chip currentChip = xsc::Chip::CHIP_0;
|
||||
xsc::Copy currentCopy = xsc::Copy::COPY_0;
|
||||
while (iss >> word) {
|
||||
if (wordIdx == 1) {
|
||||
currentChip = static_cast<Chip>(stoi(word));
|
||||
currentChip = static_cast<xsc::Chip>(stoi(word));
|
||||
}
|
||||
if (wordIdx == 3) {
|
||||
currentCopy = static_cast<Copy>(stoi(word));
|
||||
currentCopy = static_cast<xsc::Copy>(stoi(word));
|
||||
}
|
||||
|
||||
if (wordIdx == 3) {
|
||||
if (currentChip == Chip::CHIP_0) {
|
||||
if (currentCopy == Copy::COPY_0) {
|
||||
if (currentChip == xsc::Chip::CHIP_0) {
|
||||
if (currentCopy == xsc::Copy::COPY_0) {
|
||||
arrayIdx = 0;
|
||||
} else if (currentCopy == Copy::COPY_1) {
|
||||
} else if (currentCopy == xsc::Copy::COPY_1) {
|
||||
arrayIdx = 1;
|
||||
}
|
||||
}
|
||||
|
||||
else if (currentChip == Chip::CHIP_1) {
|
||||
if (currentCopy == Copy::COPY_0) {
|
||||
else if (currentChip == xsc::Chip::CHIP_1) {
|
||||
if (currentCopy == xsc::Copy::COPY_0) {
|
||||
arrayIdx = 2;
|
||||
} else if (currentCopy == Copy::COPY_1) {
|
||||
} else if (currentCopy == xsc::Copy::COPY_1) {
|
||||
arrayIdx = 3;
|
||||
}
|
||||
}
|
||||
@ -1101,3 +1185,463 @@ void CoreController::performWatchdogControlOperation() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CoreController::performMountedSdCardOperations() {
|
||||
if (doPerformMountedSdCardOps) {
|
||||
bool sdCardMounted = false;
|
||||
sdCardMounted = sdcMan->isSdCardMounted(sdInfo.pref);
|
||||
if (sdCardMounted) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + "/" + CONF_FOLDER;
|
||||
if (not std::filesystem::exists(path)) {
|
||||
std::filesystem::create_directory(path);
|
||||
}
|
||||
initVersionFile();
|
||||
performRebootFileHandling(false);
|
||||
doPerformMountedSdCardOps = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CoreController::performRebootFileHandling(bool recreateFile) {
|
||||
using namespace std;
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
if (not std::filesystem::exists(path) or recreateFile) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "CoreController::performRebootFileHandling: Recreating reboot file" << std::endl;
|
||||
#endif
|
||||
rebootFile.enabled = true;
|
||||
rebootFile.img00Cnt = 0;
|
||||
rebootFile.img01Cnt = 0;
|
||||
rebootFile.img10Cnt = 0;
|
||||
rebootFile.img11Cnt = 0;
|
||||
rebootFile.lastChip = xsc::Chip::CHIP_0;
|
||||
rebootFile.lastCopy = xsc::Copy::COPY_0;
|
||||
rebootFile.img00Lock = false;
|
||||
rebootFile.img01Lock = false;
|
||||
rebootFile.img10Lock = false;
|
||||
rebootFile.img11Lock = false;
|
||||
rebootFile.mechanismNextChip = xsc::Chip::NO_CHIP;
|
||||
rebootFile.mechanismNextCopy = xsc::Copy::NO_COPY;
|
||||
rebootFile.bootFlag = false;
|
||||
rewriteRebootFile(rebootFile);
|
||||
} else {
|
||||
if (not parseRebootFile(path, rebootFile)) {
|
||||
performRebootFileHandling(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (CURRENT_CHIP == xsc::CHIP_0) {
|
||||
if (CURRENT_COPY == xsc::COPY_0) {
|
||||
rebootFile.img00Cnt++;
|
||||
} else {
|
||||
rebootFile.img01Cnt++;
|
||||
}
|
||||
} else {
|
||||
if (CURRENT_COPY == xsc::COPY_0) {
|
||||
rebootFile.img10Cnt++;
|
||||
} else {
|
||||
rebootFile.img11Cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
if (rebootFile.bootFlag) {
|
||||
// Trigger event to inform ground that a reboot was triggered
|
||||
uint32_t p1 = rebootFile.lastChip << 16 | rebootFile.lastCopy;
|
||||
uint32_t p2 = rebootFile.img00Cnt << 24 | rebootFile.img01Cnt << 16 | rebootFile.img10Cnt << 8 |
|
||||
rebootFile.img11Cnt;
|
||||
triggerEvent(REBOOT_MECHANISM_TRIGGERED, p1, p2);
|
||||
// Clear the boot flag
|
||||
rebootFile.bootFlag = false;
|
||||
}
|
||||
|
||||
if (rebootFile.mechanismNextChip != xsc::NO_CHIP and
|
||||
rebootFile.mechanismNextCopy != xsc::NO_COPY) {
|
||||
if (CURRENT_CHIP != rebootFile.mechanismNextChip or
|
||||
CURRENT_COPY != rebootFile.mechanismNextCopy) {
|
||||
std::string infoString = std::to_string(rebootFile.mechanismNextChip) + " " +
|
||||
std::to_string(rebootFile.mechanismNextCopy);
|
||||
sif::warning << "CoreController::performRebootFileHandling: Expected to be on image "
|
||||
<< infoString << " but currently on other image. Locking " << infoString
|
||||
<< std::endl;
|
||||
// Firmware or other component might be corrupt and we are on another image then the target
|
||||
// image specified by the mechanism. We can't really trust the target image anymore.
|
||||
// Lock it for now
|
||||
if (rebootFile.mechanismNextChip == xsc::CHIP_0) {
|
||||
if (rebootFile.mechanismNextCopy == xsc::COPY_0) {
|
||||
rebootFile.img00Lock = true;
|
||||
} else {
|
||||
rebootFile.img01Lock = true;
|
||||
}
|
||||
} else {
|
||||
if (rebootFile.mechanismNextCopy == xsc::COPY_0) {
|
||||
rebootFile.img10Lock = true;
|
||||
} else {
|
||||
rebootFile.img11Lock = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rebootFile.lastChip = CURRENT_CHIP;
|
||||
rebootFile.lastCopy = CURRENT_COPY;
|
||||
// Only reboot if the reboot functionality is enabled.
|
||||
// The handler will still increment the boot counts
|
||||
if (rebootFile.enabled and (*rebootFile.relevantBootCnt >= rebootFile.maxCount)) {
|
||||
// Reboot to other image
|
||||
bool doReboot = false;
|
||||
xsc::Chip tgtChip = xsc::NO_CHIP;
|
||||
xsc::Copy tgtCopy = xsc::NO_COPY;
|
||||
determineAndExecuteReboot(rebootFile, doReboot, tgtChip, tgtCopy);
|
||||
if (doReboot) {
|
||||
rebootFile.bootFlag = true;
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Boot counter for image " << CURRENT_CHIP << " " << CURRENT_COPY
|
||||
<< " too high. Rebooting to " << tgtChip << " " << tgtCopy << std::endl;
|
||||
#endif
|
||||
rebootFile.mechanismNextChip = tgtChip;
|
||||
rebootFile.mechanismNextCopy = tgtCopy;
|
||||
rewriteRebootFile(rebootFile);
|
||||
xsc_boot_copy(static_cast<xsc_libnor_chip_t>(tgtChip),
|
||||
static_cast<xsc_libnor_copy_t>(tgtCopy));
|
||||
}
|
||||
} else {
|
||||
rebootFile.mechanismNextChip = xsc::NO_CHIP;
|
||||
rebootFile.mechanismNextCopy = xsc::NO_COPY;
|
||||
}
|
||||
rewriteRebootFile(rebootFile);
|
||||
}
|
||||
|
||||
void CoreController::determineAndExecuteReboot(RebootFile &rf, bool &needsReboot,
|
||||
xsc::Chip &tgtChip, xsc::Copy &tgtCopy) {
|
||||
tgtChip = xsc::CHIP_0;
|
||||
tgtCopy = xsc::COPY_0;
|
||||
needsReboot = false;
|
||||
if ((CURRENT_CHIP == xsc::CHIP_0) and (CURRENT_COPY == xsc::COPY_0) and
|
||||
(rf.img00Cnt >= rf.maxCount)) {
|
||||
needsReboot = true;
|
||||
if (rf.img01Cnt < rf.maxCount and not rf.img01Lock) {
|
||||
tgtCopy = xsc::COPY_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img10Cnt < rf.maxCount and not rf.img10Lock) {
|
||||
tgtChip = xsc::CHIP_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img11Cnt < rf.maxCount and not rf.img11Lock) {
|
||||
tgtChip = xsc::CHIP_1;
|
||||
tgtCopy = xsc::COPY_1;
|
||||
return;
|
||||
}
|
||||
// Can't really do much here. Stay on image
|
||||
sif::warning
|
||||
<< "All reboot counts too high or all fallback images locked, already on fallback image"
|
||||
<< std::endl;
|
||||
needsReboot = false;
|
||||
return;
|
||||
}
|
||||
if ((CURRENT_CHIP == xsc::CHIP_0) and (CURRENT_COPY == xsc::COPY_1) and
|
||||
(rf.img01Cnt >= rf.maxCount)) {
|
||||
needsReboot = true;
|
||||
if (rf.img00Cnt < rf.maxCount and not rf.img00Lock) {
|
||||
// Reboot on fallback image
|
||||
return;
|
||||
}
|
||||
if (rf.img10Cnt < rf.maxCount and not rf.img10Lock) {
|
||||
tgtChip = xsc::CHIP_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img11Cnt < rf.maxCount and not rf.img11Lock) {
|
||||
tgtChip = xsc::CHIP_1;
|
||||
tgtCopy = xsc::COPY_1;
|
||||
}
|
||||
if (rf.img00Lock) {
|
||||
needsReboot = false;
|
||||
}
|
||||
// Reboot to fallback image
|
||||
}
|
||||
if ((CURRENT_CHIP == xsc::CHIP_1) and (CURRENT_COPY == xsc::COPY_0) and
|
||||
(rf.img10Cnt >= rf.maxCount)) {
|
||||
needsReboot = true;
|
||||
if (rf.img11Cnt < rf.maxCount and not rf.img11Lock) {
|
||||
tgtChip = xsc::CHIP_1;
|
||||
tgtCopy = xsc::COPY_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img00Cnt < rf.maxCount and not rf.img00Lock) {
|
||||
return;
|
||||
}
|
||||
if (rf.img01Cnt < rf.maxCount and not rf.img01Lock) {
|
||||
tgtCopy = xsc::COPY_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img00Lock) {
|
||||
needsReboot = false;
|
||||
}
|
||||
// Reboot to fallback image
|
||||
}
|
||||
if ((CURRENT_CHIP == xsc::CHIP_1) and (CURRENT_COPY == xsc::COPY_1) and
|
||||
(rf.img11Cnt >= rf.maxCount)) {
|
||||
needsReboot = true;
|
||||
if (rf.img10Cnt < rf.maxCount and not rf.img10Lock) {
|
||||
tgtChip = xsc::CHIP_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img00Cnt < rf.maxCount and not rf.img00Lock) {
|
||||
return;
|
||||
}
|
||||
if (rf.img01Cnt < rf.maxCount and not rf.img01Lock) {
|
||||
tgtCopy = xsc::COPY_1;
|
||||
return;
|
||||
}
|
||||
if (rf.img00Lock) {
|
||||
needsReboot = false;
|
||||
}
|
||||
// Reboot to fallback image
|
||||
}
|
||||
}
|
||||
|
||||
bool CoreController::parseRebootFile(std::string path, RebootFile &rf) {
|
||||
using namespace std;
|
||||
std::string selfMatch;
|
||||
if (CURRENT_CHIP == xsc::CHIP_0) {
|
||||
if (CURRENT_COPY == xsc::COPY_0) {
|
||||
selfMatch = "00";
|
||||
} else {
|
||||
selfMatch = "01";
|
||||
}
|
||||
} else {
|
||||
if (CURRENT_COPY == xsc::COPY_0) {
|
||||
selfMatch = "10";
|
||||
} else {
|
||||
selfMatch = "11";
|
||||
}
|
||||
}
|
||||
ifstream file(path);
|
||||
string word;
|
||||
string line;
|
||||
uint8_t lineIdx = 0;
|
||||
while (std::getline(file, line)) {
|
||||
istringstream iss(line);
|
||||
switch (lineIdx) {
|
||||
case 0: {
|
||||
iss >> word;
|
||||
if (word.find("on:") == string::npos) {
|
||||
// invalid file
|
||||
return false;
|
||||
}
|
||||
iss >> rf.enabled;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
iss >> word;
|
||||
if (word.find("maxcnt:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.maxCount;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
iss >> word;
|
||||
if (word.find("img00:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img00Cnt;
|
||||
if (word.find(selfMatch) != string::npos) {
|
||||
rf.relevantBootCnt = &rf.img00Cnt;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
iss >> word;
|
||||
if (word.find("img01:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img01Cnt;
|
||||
if (word.find(selfMatch) != string::npos) {
|
||||
rf.relevantBootCnt = &rf.img01Cnt;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
iss >> word;
|
||||
if (word.find("img10:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img10Cnt;
|
||||
if (word.find(selfMatch) != string::npos) {
|
||||
rf.relevantBootCnt = &rf.img10Cnt;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
iss >> word;
|
||||
if (word.find("img11:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img11Cnt;
|
||||
if (word.find(selfMatch) != string::npos) {
|
||||
rf.relevantBootCnt = &rf.img11Cnt;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
iss >> word;
|
||||
if (word.find("img00lock:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img00Lock;
|
||||
break;
|
||||
}
|
||||
case 7: {
|
||||
iss >> word;
|
||||
if (word.find("img01lock:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img01Lock;
|
||||
break;
|
||||
}
|
||||
case 8: {
|
||||
iss >> word;
|
||||
if (word.find("img10lock:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img10Lock;
|
||||
break;
|
||||
}
|
||||
case 9: {
|
||||
iss >> word;
|
||||
if (word.find("img11lock:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.img11Lock;
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
iss >> word;
|
||||
if (word.find("bootflag:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> rf.bootFlag;
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
iss >> word;
|
||||
int copyRaw = 0;
|
||||
int chipRaw = 0;
|
||||
if (word.find("last:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> chipRaw;
|
||||
if (iss.fail()) {
|
||||
return false;
|
||||
}
|
||||
iss >> copyRaw;
|
||||
if (iss.fail()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chipRaw > 1 or copyRaw > 1) {
|
||||
return false;
|
||||
}
|
||||
rf.lastChip = static_cast<xsc::Chip>(chipRaw);
|
||||
rf.lastCopy = static_cast<xsc::Copy>(copyRaw);
|
||||
break;
|
||||
}
|
||||
case 12: {
|
||||
iss >> word;
|
||||
int copyRaw = 0;
|
||||
int chipRaw = 0;
|
||||
if (word.find("next:") == string::npos) {
|
||||
return false;
|
||||
}
|
||||
iss >> chipRaw;
|
||||
if (iss.fail()) {
|
||||
return false;
|
||||
}
|
||||
iss >> copyRaw;
|
||||
if (iss.fail()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chipRaw > 2 or copyRaw > 2) {
|
||||
return false;
|
||||
}
|
||||
rf.mechanismNextChip = static_cast<xsc::Chip>(chipRaw);
|
||||
rf.mechanismNextCopy = static_cast<xsc::Copy>(copyRaw);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (iss.fail()) {
|
||||
return false;
|
||||
}
|
||||
lineIdx++;
|
||||
}
|
||||
if (lineIdx < 12) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void CoreController::resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (tgtChip == xsc::ALL_CHIP and tgtCopy == xsc::ALL_COPY) {
|
||||
rebootFile.img00Cnt = 0;
|
||||
rebootFile.img01Cnt = 0;
|
||||
rebootFile.img10Cnt = 0;
|
||||
rebootFile.img11Cnt = 0;
|
||||
} else {
|
||||
if (tgtChip == xsc::CHIP_0) {
|
||||
if (tgtCopy == xsc::COPY_0) {
|
||||
rebootFile.img00Cnt = 0;
|
||||
} else {
|
||||
rebootFile.img01Cnt = 0;
|
||||
}
|
||||
} else {
|
||||
if (tgtCopy == xsc::COPY_0) {
|
||||
rebootFile.img10Cnt = 0;
|
||||
} else {
|
||||
rebootFile.img11Cnt = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
rewriteRebootFile(rebootFile);
|
||||
}
|
||||
|
||||
void CoreController::rewriteRebootFile(RebootFile file) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
std::ofstream rebootFile(path);
|
||||
if (rebootFile.is_open()) {
|
||||
// Initiate reboot file first. Reboot handling will be on on initialization
|
||||
rebootFile << "on: " << file.enabled << "\nmaxcnt: " << file.maxCount
|
||||
<< "\nimg00: " << file.img00Cnt << "\nimg01: " << file.img01Cnt
|
||||
<< "\nimg10: " << file.img10Cnt << "\nimg11: " << file.img11Cnt
|
||||
<< "\nimg00lock: " << file.img00Lock << "\nimg01lock: " << file.img01Lock
|
||||
<< "\nimg10lock: " << file.img10Lock << "\nimg11lock: " << file.img11Lock
|
||||
<< "\nbootflag: " << file.bootFlag << "\nlast: " << static_cast<int>(file.lastChip)
|
||||
<< " " << static_cast<int>(file.lastCopy)
|
||||
<< "\nnext: " << static_cast<int>(file.mechanismNextChip) << " "
|
||||
<< static_cast<int>(file.mechanismNextCopy) << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::Copy tgtCopy) {
|
||||
std::string path = sdcMan->getCurrentMountPrefix(sdInfo.pref) + REBOOT_FILE;
|
||||
// Disable the reboot file mechanism
|
||||
parseRebootFile(path, rebootFile);
|
||||
if (tgtChip == xsc::CHIP_0) {
|
||||
if (tgtCopy == xsc::COPY_0) {
|
||||
rebootFile.img00Lock = lock;
|
||||
} else {
|
||||
rebootFile.img01Lock = lock;
|
||||
}
|
||||
} else {
|
||||
if (tgtCopy == xsc::COPY_0) {
|
||||
rebootFile.img10Lock = lock;
|
||||
} else {
|
||||
rebootFile.img11Lock = lock;
|
||||
}
|
||||
}
|
||||
rewriteRebootFile(rebootFile);
|
||||
}
|
||||
|
@ -2,6 +2,9 @@
|
||||
#define BSP_Q7S_CORE_CORECONTROLLER_H_
|
||||
|
||||
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||
#include <libxiphos.h>
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "bsp_q7s/memory/SdCardManager.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
@ -10,24 +13,72 @@
|
||||
class Timer;
|
||||
class SdCardManager;
|
||||
|
||||
namespace xsc {
|
||||
|
||||
enum Chip : int { CHIP_0, CHIP_1, NO_CHIP, SELF_CHIP, ALL_CHIP };
|
||||
enum Copy : int { COPY_0, COPY_1, NO_COPY, SELF_COPY, ALL_COPY };
|
||||
|
||||
} // namespace xsc
|
||||
|
||||
struct RebootFile {
|
||||
static constexpr uint8_t DEFAULT_MAX_BOOT_CNT = 10;
|
||||
|
||||
bool enabled = true;
|
||||
size_t maxCount = DEFAULT_MAX_BOOT_CNT;
|
||||
uint32_t img00Cnt = 0;
|
||||
uint32_t img01Cnt = 0;
|
||||
uint32_t img10Cnt = 0;
|
||||
uint32_t img11Cnt = 0;
|
||||
bool img00Lock = false;
|
||||
bool img01Lock = false;
|
||||
bool img10Lock = false;
|
||||
bool img11Lock = false;
|
||||
uint32_t* relevantBootCnt = &img00Cnt;
|
||||
bool bootFlag = false;
|
||||
xsc::Chip lastChip = xsc::Chip::CHIP_0;
|
||||
xsc::Copy lastCopy = xsc::Copy::COPY_0;
|
||||
xsc::Chip mechanismNextChip = xsc::Chip::NO_CHIP;
|
||||
xsc::Copy mechanismNextCopy = xsc::Copy::NO_COPY;
|
||||
};
|
||||
|
||||
class CoreController : public ExtendedControllerBase {
|
||||
public:
|
||||
enum Chip : uint8_t { CHIP_0, CHIP_1, NO_CHIP, SELF_CHIP, ALL_CHIP };
|
||||
|
||||
enum Copy : uint8_t { COPY_0, COPY_1, NO_COPY, SELF_COPY, ALL_COPY };
|
||||
static xsc::Chip CURRENT_CHIP;
|
||||
static xsc::Copy CURRENT_COPY;
|
||||
|
||||
static constexpr char CHIP_PROT_SCRIPT[] = "/home/root/scripts/get-chip-prot-status.sh";
|
||||
static constexpr char CHIP_STATE_FILE[] = "/tmp/chip_prot_status.txt";
|
||||
static constexpr char CURR_COPY_FILE[] = "/tmp/curr_copy.txt";
|
||||
static constexpr char VERSION_FILE[] = "/conf/sd_status";
|
||||
static constexpr char CONF_FOLDER[] = "conf";
|
||||
static constexpr char VERSION_FILE_NAME[] = "version.txt";
|
||||
static constexpr char REBOOT_FILE_NAME[] = "reboot.txt";
|
||||
const std::string VERSION_FILE =
|
||||
"/" + std::string(CONF_FOLDER) + "/" + std::string(VERSION_FILE_NAME);
|
||||
const std::string REBOOT_FILE =
|
||||
"/" + std::string(CONF_FOLDER) + "/" + std::string(REBOOT_FILE_NAME);
|
||||
|
||||
static constexpr ActionId_t LIST_DIRECTORY_INTO_FILE = 0;
|
||||
static constexpr ActionId_t SWITCH_REBOOT_FILE_HANDLING = 5;
|
||||
static constexpr ActionId_t RESET_REBOOT_COUNTERS = 6;
|
||||
static constexpr ActionId_t SWITCH_IMG_LOCK = 7;
|
||||
static constexpr ActionId_t SET_MAX_REBOOT_CNT = 8;
|
||||
|
||||
static constexpr ActionId_t REBOOT_OBC = 32;
|
||||
static constexpr ActionId_t MOUNT_OTHER_COPY = 33;
|
||||
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CORE;
|
||||
|
||||
static constexpr Event ALLOC_FAILURE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
|
||||
//! [EXPORT] : [COMMENT] Software reboot occured. Can also be a systemd reboot.
|
||||
//! P1: Current Chip, P2: Current Copy
|
||||
static constexpr Event REBOOT_SW = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM);
|
||||
//! [EXPORT] : [COMMENT] The reboot mechanism was triggered.
|
||||
//! P1: First 16 bits: Last Chip, Last 16 bits: Last Copy,
|
||||
//! P2: Each byte is the respective reboot count for the slots
|
||||
static constexpr Event REBOOT_MECHANISM_TRIGGERED =
|
||||
event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
|
||||
//! Trying to find a way how to determine that the reboot came from ProASIC3 or PCDU..
|
||||
static constexpr Event REBOOT_HW = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM);
|
||||
|
||||
CoreController(object_id_t objectId);
|
||||
virtual ~CoreController();
|
||||
@ -48,7 +99,7 @@ class CoreController : public ExtendedControllerBase {
|
||||
*/
|
||||
static ReturnValue_t generateChipStateFile();
|
||||
static ReturnValue_t incrementAllocationFailureCount();
|
||||
static void getCurrentBootCopy(Chip& chip, Copy& copy);
|
||||
static void getCurrentBootCopy(xsc::Chip& chip, xsc::Copy& copy);
|
||||
|
||||
ReturnValue_t updateProtInfo(bool regenerateChipStateFile = true);
|
||||
|
||||
@ -63,15 +114,12 @@ class CoreController : public ExtendedControllerBase {
|
||||
* @param updateProtFile Specify whether the protection info file is updated
|
||||
* @return
|
||||
*/
|
||||
ReturnValue_t setBootCopyProtection(Chip targetChip, Copy targetCopy, bool protect,
|
||||
ReturnValue_t setBootCopyProtection(xsc::Chip targetChip, xsc::Copy targetCopy, bool protect,
|
||||
bool& protOperationPerformed, bool updateProtFile = true);
|
||||
|
||||
bool sdInitFinished() const;
|
||||
|
||||
private:
|
||||
static Chip CURRENT_CHIP;
|
||||
static Copy CURRENT_COPY;
|
||||
|
||||
// Designated value for rechecking FIFO open
|
||||
static constexpr int RETRY_FIFO_OPEN = -2;
|
||||
int watchdogFifoFd = 0;
|
||||
@ -120,8 +168,9 @@ class CoreController : public ExtendedControllerBase {
|
||||
sd::SdState currentlyCommandedState = sd::SdState::OFF;
|
||||
sd::SdCard commandedCard = sd::SdCard::NONE;
|
||||
sd::SdState commandedState = sd::SdState::OFF;
|
||||
};
|
||||
SdInfo sdInfo;
|
||||
} sdInfo;
|
||||
RebootFile rebootFile = {};
|
||||
bool doPerformMountedSdCardOps = true;
|
||||
|
||||
/**
|
||||
* Index 0: Chip 0 Copy 0
|
||||
@ -136,7 +185,7 @@ class CoreController : public ExtendedControllerBase {
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, uint32_t* msToReachTheMode);
|
||||
|
||||
void performMountedSdCardOperations();
|
||||
ReturnValue_t initVersionFile();
|
||||
ReturnValue_t initBootCopy();
|
||||
ReturnValue_t initWatchdogFifo();
|
||||
@ -148,10 +197,12 @@ class CoreController : public ExtendedControllerBase {
|
||||
ReturnValue_t sdCardSetup(sd::SdCard sdCard, sd::SdState targetState, std::string sdChar,
|
||||
bool printOutput = true);
|
||||
ReturnValue_t sdColdRedundantBlockingInit();
|
||||
|
||||
void currentStateSetter(sd::SdCard sdCard, sd::SdState newState);
|
||||
void determinePreferredSdCard();
|
||||
void executeNextExternalSdCommand();
|
||||
void checkExternalSdCommandStatus();
|
||||
void performRebootFileHandling(bool recreateFile);
|
||||
|
||||
ReturnValue_t actionListDirectoryIntoFile(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
const uint8_t* data, size_t size);
|
||||
@ -160,9 +211,15 @@ class CoreController : public ExtendedControllerBase {
|
||||
void performWatchdogControlOperation();
|
||||
|
||||
ReturnValue_t handleProtInfoUpdateLine(std::string nextLine);
|
||||
int handleBootCopyProtAtIndex(Chip targetChip, Copy targetCopy, bool protect,
|
||||
int handleBootCopyProtAtIndex(xsc::Chip targetChip, xsc::Copy targetCopy, bool protect,
|
||||
bool& protOperationPerformed, bool selfChip, bool selfCopy,
|
||||
bool allChips, bool allCopies, uint8_t arrIdx);
|
||||
void determineAndExecuteReboot(RebootFile& rf, bool& needsReboot, xsc::Chip& tgtChip,
|
||||
xsc::Copy& tgtCopy);
|
||||
void resetRebootCount(xsc::Chip tgtChip, xsc::Copy tgtCopy);
|
||||
void setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::Copy tgtCopy);
|
||||
bool parseRebootFile(std::string path, RebootFile& file);
|
||||
void rewriteRebootFile(RebootFile file);
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */
|
||||
|
@ -86,7 +86,7 @@ void initmission::initTasks() {
|
||||
"TCPIP_TMTC_BRIDGE", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = tmtcBridgeTask->addComponent(objects::TMTC_BRIDGE);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("UDP_BRIDGE", objects::TMTC_BRIDGE);
|
||||
initmission::printAddObjectError("TMTC_BRIDGE", objects::TMTC_BRIDGE);
|
||||
}
|
||||
PeriodicTaskIF* tmtcPollingTask = factory->createPeriodicTask(
|
||||
"TMTC_POLLING", 80, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
@ -135,9 +135,9 @@ void initmission::initTasks() {
|
||||
}
|
||||
|
||||
#if OBSW_ADD_STAR_TRACKER == 1
|
||||
PeriodicTaskIF* strImgLoaderTask = factory->createPeriodicTask(
|
||||
PeriodicTaskIF* strHelperTask = factory->createPeriodicTask(
|
||||
"STR_HELPER", 20, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, missedDeadlineFunc);
|
||||
result = strImgLoaderTask->addComponent(objects::STR_HELPER);
|
||||
result = strHelperTask->addComponent(objects::STR_HELPER);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
initmission::printAddObjectError("STR_HELPER", objects::STR_HELPER);
|
||||
}
|
||||
@ -204,7 +204,7 @@ void initmission::initTasks() {
|
||||
#if BOARD_TE0720 == 0
|
||||
fsTask->startTask();
|
||||
#if OBSW_ADD_STAR_TRACKER == 1
|
||||
strImgLoaderTask->startTask();
|
||||
strHelperTask > startTask();
|
||||
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,6 +13,8 @@ void produce(void* args);
|
||||
|
||||
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF,
|
||||
SpiComIF** spiComIF, I2cComIF** i2cComIF);
|
||||
|
||||
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF);
|
||||
void createTmpComponents();
|
||||
void createPcduComponents(LinuxLibgpioIF* gpioComIF);
|
||||
void createRadSensorComponent(LinuxLibgpioIF* gpioComIF);
|
||||
|
@ -3,5 +3,3 @@ target_sources(${OBSW_NAME} PRIVATE
|
||||
PlocUpdater.cpp
|
||||
PlocMemoryDumper.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(startracker)
|
@ -10,7 +10,9 @@
|
||||
|
||||
PlocMemoryDumper::PlocMemoryDumper(object_id_t objectId)
|
||||
: SystemObject(objectId), commandActionHelper(this), actionHelper(this, nullptr) {
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE);
|
||||
auto mqArgs = MqArgs(this->getObjectId());
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
||||
QUEUE_SIZE, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
|
||||
PlocMemoryDumper::~PlocMemoryDumper() {}
|
||||
|
@ -8,7 +8,9 @@
|
||||
|
||||
PlocUpdater::PlocUpdater(object_id_t objectId)
|
||||
: SystemObject(objectId), commandActionHelper(this), actionHelper(this, nullptr) {
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE);
|
||||
auto mqArgs = MqArgs(this->getObjectId());
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
||||
QUEUE_SIZE, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
|
||||
PlocUpdater::~PlocUpdater() {}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,3 +0,0 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
gpioCallbacks.cpp
|
||||
)
|
@ -11,7 +11,9 @@
|
||||
|
||||
FileSystemHandler::FileSystemHandler(object_id_t fileSystemHandler)
|
||||
: SystemObject(fileSystemHandler) {
|
||||
mq = QueueFactory::instance()->createMessageQueue(FS_MAX_QUEUE_SIZE);
|
||||
auto mqArgs = MqArgs(this->getObjectId());
|
||||
mq = QueueFactory::instance()->createMessageQueue(FS_MAX_QUEUE_SIZE,
|
||||
MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
|
||||
FileSystemHandler::~FileSystemHandler() { QueueFactory::instance()->deleteMessageQueue(mq); }
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
|
||||
#include "common/config/commonObjects.h"
|
||||
#include "fsfw/ipc/MutexFactory.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "linux/utility/utility.h"
|
||||
@ -14,7 +15,7 @@
|
||||
|
||||
SdCardManager* SdCardManager::factoryInstance = nullptr;
|
||||
|
||||
SdCardManager::SdCardManager() : cmdExecutor(256) {}
|
||||
SdCardManager::SdCardManager() : SystemObject(objects::SDC_MANAGER), cmdExecutor(256) {}
|
||||
|
||||
SdCardManager::~SdCardManager() {}
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef BSP_Q7S_MEMORY_SDCARDACCESSMANAGER_H_
|
||||
#define BSP_Q7S_MEMORY_SDCARDACCESSMANAGER_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <poll.h>
|
||||
|
||||
#include <array>
|
||||
@ -22,7 +23,7 @@ class MutexIF;
|
||||
* @brief Manages handling of SD cards like switching them on or off or getting the current
|
||||
* state
|
||||
*/
|
||||
class SdCardManager {
|
||||
class SdCardManager : public SystemObject {
|
||||
friend class SdCardAccess;
|
||||
|
||||
public:
|
||||
@ -54,6 +55,7 @@ class SdCardManager {
|
||||
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::FILE_SYSTEM;
|
||||
|
||||
static constexpr Event SANITIZATION_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::LOW);
|
||||
static constexpr Event MOUNTED_SD_CARD = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO);
|
||||
|
||||
// C++17 does not support constexpr std::string yet
|
||||
static constexpr char SD_0_DEV_NAME[] = "/dev/mmcblk0p1";
|
||||
@ -183,7 +185,7 @@ class SdCardManager {
|
||||
/**
|
||||
* @brief Checks if an SD card is mounted
|
||||
*
|
||||
* @param sdCard The SD crad to check
|
||||
* @param sdCard The SD card to check
|
||||
*
|
||||
* @return true if mounted, otherwise false
|
||||
*/
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "simple.h"
|
||||
|
||||
#include "iostream"
|
||||
|
||||
#include "q7sConfig.h"
|
||||
|
||||
#if Q7S_SIMPLE_ADD_FILE_SYSTEM_TEST == 1
|
||||
|
@ -41,12 +41,12 @@ add_compile_options(
|
||||
$<$<COMPILE_LANGUAGE:ASM>:${ASM_FLAGS}>
|
||||
)
|
||||
|
||||
set(STRIPPED_OBSW_NAME ${OBSW_NAME}-stripped)
|
||||
set(STRIPPED_OBSW_NAME ${OBSW_BIN_NAME}-stripped)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${OBSW_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_STRIP} --strip-all ${OBSW_NAME} -o ${STRIPPED_OBSW_NAME}
|
||||
COMMAND ${CMAKE_STRIP} --strip-all ${OBSW_BIN_NAME} -o ${STRIPPED_OBSW_NAME}
|
||||
BYPRODUCTS ${STRIPPED_OBSW_NAME}
|
||||
COMMENT "Generating stripped executable ${STRIPPED_OBSW_NAME}.."
|
||||
)
|
||||
|
@ -47,7 +47,7 @@ if(CMAKE_CROSSCOMPILING)
|
||||
|
||||
set_property(CACHE TGT_BSP
|
||||
PROPERTY STRINGS
|
||||
"arm/q7s" "arm/raspberrypi"
|
||||
"arm/q7s" "arm/raspberrypi" "arm/egse"
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -57,6 +57,8 @@ if(TGT_BSP)
|
||||
set(BSP_PATH "bsp_linux_board")
|
||||
elseif(TGT_BSP MATCHES "arm/q7s")
|
||||
set(BSP_PATH "bsp_q7s")
|
||||
elseif(TGT_BSP MATCHES "arm/egse")
|
||||
set(BSP_PATH "bsp_egse")
|
||||
else()
|
||||
message(WARNING "CMake not configured for this target!")
|
||||
message(FATAL_ERROR "Target: ${TGT_BSP}!")
|
||||
|
@ -17,8 +17,7 @@ if(FSFW_OSAL MATCHES linux AND TGT_BSP)
|
||||
"${CMAKE_SCRIPT_PATH}/Q7SCrossCompileConfig.cmake"
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
elseif(TGT_BSP MATCHES "arm/raspberrypi")
|
||||
elseif(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/egse")
|
||||
if(NOT DEFINED ENV{LINUX_ROOTFS})
|
||||
if(NOT DEFINED LINUX_ROOTFS)
|
||||
message(WARNING "No LINUX_ROOTFS environmental or CMake variable set!")
|
||||
|
@ -81,8 +81,19 @@ set(CMAKE_PREFIX_PATH
|
||||
# "${SYSROOT_PATH}/usr/lib/${CROSS_COMPILE}"
|
||||
)
|
||||
|
||||
set(C_FLAGS
|
||||
-mcpu=cortex-a9
|
||||
-mfpu=neon-vfpv3
|
||||
-mfloat-abi=hard
|
||||
${COMMON_FLAGS}
|
||||
-lgpiod
|
||||
-lxiphos
|
||||
)
|
||||
|
||||
string (REPLACE ";" " " C_FLAGS "${C_FLAGS}")
|
||||
|
||||
set(CMAKE_C_FLAGS
|
||||
"-mcpu=cortex-a9 -mfpu=neon-vfpv3 -mfloat-abi=hard ${COMMON_FLAGS} -lgpiod"
|
||||
${C_FLAGS}
|
||||
CACHE STRING "C flags for Q7S"
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS
|
||||
|
@ -1,5 +1,49 @@
|
||||
#!/bin/sh
|
||||
export PATH=$PATH:"/c/Xilinx/SDK/2018.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
# Run with: source q7s-env-win-sh [OPTIONS]
|
||||
function help () {
|
||||
echo "source q7s-env-win-sh [options] -t|--toolchain=<toolchain path> -s|--sysroot=<sysroot path>"
|
||||
}
|
||||
|
||||
export Q7S_SYSROOT="/c/Users/${USER}/Documents/EIVE/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
TOOLCHAIN_PATH="/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
SYSROOT="/c/Users/${USER}/eive-software/cortexa9hf-neon-xiphos-linux-gnueabi"
|
||||
|
||||
for i in "$@"; do
|
||||
case $i in
|
||||
-t=*|--toolchain=*)
|
||||
TOOLCHAIN_PATH="${i#*=}"
|
||||
shift
|
||||
;;
|
||||
-s=*|--sysroot=*)
|
||||
SYSROOT="${i#*=}"
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
help
|
||||
shift
|
||||
;;
|
||||
-*|--*)
|
||||
echo "Unknown option $i"
|
||||
help
|
||||
return
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -d "$TOOLCHAIN_PATH" ]; then
|
||||
export PATH=$PATH:"/c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
echo "Set toolchain path to /c/Xilinx/Vitis/2019.2/gnu/aarch32/nt/gcc-arm-linux-gnueabi/bin"
|
||||
else
|
||||
echo "Toolchain path $TOOLCHAIN_PATH does not exist"
|
||||
return
|
||||
fi
|
||||
|
||||
if [ -d "$SYSROOT" ]; then
|
||||
export Q7S_SYSROOT=$SYSROOT
|
||||
echo "Set sysroot path to $SYSROOT"
|
||||
else
|
||||
echo "Sysroot path $SYSROOT does not exist"
|
||||
return
|
||||
fi
|
13
cmake/scripts/egse/egse_path_helper_win.sh
Normal file
13
cmake/scripts/egse/egse_path_helper_win.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Script to set path to raspberry pi toolchain
|
||||
# Run script with: source egse_path_helper_win.sh
|
||||
TOOLCHAIN_PATH="/c/SysGCC/raspberry/bin"
|
||||
if [ $# -eq 1 ];then
|
||||
export PATH=$PATH:"$1"
|
||||
else
|
||||
export PATH=$PATH:$TOOLCHAIN_PATH
|
||||
fi
|
||||
|
||||
echo "Path of toolchain set to $TOOLCHAIN_PATH"
|
||||
export CROSS_COMPILE="arm-linux-gnueabihf"
|
||||
export RASPBERRY_VERSION="4"
|
34
cmake/scripts/egse/make-debug-cfg.sh
Normal file
34
cmake/scripts/egse/make-debug-cfg.sh
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
cfg_script_name="cmake-build-cfg.py"
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f ${cfg_script_name} ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "${cfg_script_name} not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/egse"
|
||||
build_generator="make"
|
||||
build_dir="build-Debug-egse"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} ${cfg_script_name} -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
@ -11,6 +11,7 @@ enum commonObjects: uint32_t {
|
||||
TMTC_BRIDGE = 0x50000300,
|
||||
TMTC_POLLING_TASK = 0x50000400,
|
||||
FILE_SYSTEM_HANDLER = 0x50000500,
|
||||
SDC_MANAGER = 0x50000550,
|
||||
PTME = 0x50000600,
|
||||
PDEC_HANDLER = 0x50000700,
|
||||
CCSDS_HANDLER = 0x50000800,
|
||||
@ -36,6 +37,7 @@ enum commonObjects: uint32_t {
|
||||
GYRO_1_L3G_HANDLER = 0x44120111,
|
||||
GYRO_2_ADIS_HANDLER = 0x44120212,
|
||||
GYRO_3_L3G_HANDLER = 0x44120313,
|
||||
PLPCDU_HANDLER = 0x44300000,
|
||||
|
||||
IMTQ_HANDLER = 0x44140014,
|
||||
PLOC_MPSOC_HANDLER = 0x44330015,
|
||||
@ -62,19 +64,18 @@ enum commonObjects: uint32_t {
|
||||
RTD_IC_17 = 0x44420030,
|
||||
RTD_IC_18 = 0x44420031,
|
||||
|
||||
SUS_1 = 0x44120032,
|
||||
SUS_2 = 0x44120033,
|
||||
SUS_3 = 0x44120034,
|
||||
SUS_4 = 0x44120035,
|
||||
SUS_5 = 0x44120036,
|
||||
SUS_6 = 0x44120037,
|
||||
SUS_7 = 0x44120038,
|
||||
SUS_8 = 0x44120039,
|
||||
SUS_9 = 0x44120040,
|
||||
SUS_10 = 0x44120041,
|
||||
SUS_11 = 0x44120042,
|
||||
SUS_12 = 0x44120043,
|
||||
SUS_13 = 0x44120044,
|
||||
SUS_0 = 0x44120032,
|
||||
SUS_1 = 0x44120033,
|
||||
SUS_2 = 0x44120034,
|
||||
SUS_3 = 0x44120035,
|
||||
SUS_4 = 0x44120036,
|
||||
SUS_5 = 0x44120037,
|
||||
SUS_6 = 0x44120038,
|
||||
SUS_7 = 0x44120039,
|
||||
SUS_8 = 0x44120040,
|
||||
SUS_9 = 0x44120041,
|
||||
SUS_10 = 0x44120042,
|
||||
SUS_11 = 0x44120043,
|
||||
|
||||
GPS_CONTROLLER = 0x44130045,
|
||||
|
||||
|
@ -19,6 +19,7 @@ enum: uint8_t {
|
||||
PLOC_MEMORY_DUMPER = 118,
|
||||
PDEC_HANDLER = 119,
|
||||
STR_HELPER = 120,
|
||||
PL_PCDU_HANDLER = 121,
|
||||
COMMON_SUBSYSTEM_ID_END
|
||||
};
|
||||
}
|
||||
|
@ -23,7 +23,13 @@ static constexpr uint32_t DEFAULT_L3G_SPEED = 976'000;
|
||||
static constexpr uint32_t L3G_TRANSITION_DELAY = 5000;
|
||||
static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3;
|
||||
|
||||
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 3'900'000;
|
||||
/**
|
||||
* Some MAX1227 could not be reached with frequencies around 4 MHz. Maybe this is caused by
|
||||
* the decoder and buffer circuits. Thus frequency is here defined to 1 MHz.
|
||||
*/
|
||||
static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000;
|
||||
|
||||
static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000;
|
||||
static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3;
|
||||
|
||||
static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000;
|
||||
@ -42,9 +48,9 @@ namespace uart {
|
||||
static constexpr size_t HYPERION_GPS_REPLY_MAX_BUFFER = 1024;
|
||||
static constexpr uint32_t SYRLINKS_BAUD = 38400;
|
||||
static constexpr uint32_t GNSS_BAUD = 9600;
|
||||
static constexpr uint32_t PLOC_MPSOC_BAUD = 115200;
|
||||
static constexpr uint32_t PLOC_MPSOC_BAUD = 921600;
|
||||
static constexpr uint32_t PLOC_SUPERVISOR_BAUD = 115200;
|
||||
static constexpr uint32_t STAR_TRACKER_BAUD = 115200;
|
||||
static constexpr uint32_t STAR_TRACKER_BAUD = 921600;
|
||||
|
||||
}
|
||||
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 32a9e0c7044665f0265c10108c8d62d45c047769
|
||||
Subproject commit 6e0b90696da2dfd2ec4749dfdb73950be2283c25
|
@ -6,9 +6,9 @@
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="SDK_HOME" value="C:\Users\jakob\AppData\Local\Programs\Python\Python39\python.exe" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
|
@ -1,140 +1,139 @@
|
||||
2200;STORE_SEND_WRITE_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2201;STORE_WRITE_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2202;STORE_SEND_READ_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2203;STORE_READ_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2204;UNEXPECTED_MSG;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2205;STORING_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2206;TM_DUMP_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2207;STORE_INIT_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2208;STORE_INIT_EMPTY;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2209;STORE_CONTENT_CORRUPTED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2210;STORE_INITIALIZE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2211;INIT_DONE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2212;DUMP_FINISHED;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2213;DELETION_FINISHED;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2214;DELETION_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2215;AUTO_CATALOGS_SENDING_FAILED;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2600;GET_DATA_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h
|
||||
2601;STORE_DATA_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h
|
||||
2800;DEVICE_BUILDING_COMMAND_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2801;DEVICE_SENDING_COMMAND_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2802;DEVICE_REQUESTING_REPLY_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2803;DEVICE_READING_REPLY_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2804;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2805;DEVICE_MISSED_REPLY;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2806;DEVICE_UNKNOWN_REPLY;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2807;DEVICE_UNREQUESTED_REPLY;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2808;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2809;MONITORING_LIMIT_EXCEEDED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2810;MONITORING_AMBIGUOUS;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2811;DEVICE_WANTS_HARD_REBOOT;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
4201;FUSE_CURRENT_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4202;FUSE_WENT_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4204;POWER_ABOVE_HIGH_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4205;POWER_BELOW_LOW_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4300;SWITCH_WENT_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/power/PowerSwitchIF.h
|
||||
5000;HEATER_ON;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5001;HEATER_OFF;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5002;HEATER_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5003;HEATER_STAYED_ON;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5004;HEATER_STAYED_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5200;TEMP_SENSOR_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
||||
5201;TEMP_SENSOR_LOW;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
||||
5202;TEMP_SENSOR_GRADIENT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
||||
5901;COMPONENT_TEMP_LOW;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5902;COMPONENT_TEMP_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5903;COMPONENT_TEMP_OOL_LOW;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5904;COMPONENT_TEMP_OOL_HIGH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5905;TEMP_NOT_IN_OP_RANGE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
7101;FDIR_CHANGED_STATE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
||||
7102;FDIR_STARTS_RECOVERY;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
||||
7103;FDIR_TURNS_OFF_DEVICE;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
||||
7201;MONITOR_CHANGED_STATE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7202;VALUE_BELOW_LOW_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7203;VALUE_ABOVE_HIGH_LIMIT;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7204;VALUE_OUT_OF_RANGE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7400;CHANGING_MODE;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7401;MODE_INFO;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7402;FALLBACK_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7403;MODE_TRANSITION_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7404;CANT_KEEP_MODE;HIGH;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7405;OBJECT_IN_INVALID_MODE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7406;FORCING_MODE;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7407;MODE_CMD_REJECTED;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7506;HEALTH_INFO;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7507;CHILD_CHANGED_HEALTH;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7508;CHILD_PROBLEMS;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7509;OVERWRITING_HEALTH;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7510;TRYING_RECOVERY;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7511;RECOVERY_STEP;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7512;RECOVERY_DONE;MEDIUM;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7900;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7901;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7902;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7903;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7905;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
8900;CLOCK_SET;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||
8901;CLOCK_SET_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||
9700;TEST;INFO;;/home/rmueller/EIVE/eive-obsw/fsfw/src/fsfw/pus/Service17Test.h
|
||||
10600;CHANGE_OF_SETUP_PARAMETER;LOW;;/home/rmueller/EIVE/eive-obsw/fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
||||
10900;GPIO_PULL_HIGH_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h
|
||||
10901;GPIO_PULL_LOW_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h
|
||||
10902;SWITCH_ALREADY_ON;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h
|
||||
10903;SWITCH_ALREADY_OFF;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h
|
||||
10904;MAIN_SWITCH_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/HeaterHandler.h
|
||||
11000;MAIN_SWITCH_ON_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h
|
||||
11001;MAIN_SWITCH_OFF_TIMEOUT;LOW;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h
|
||||
11002;DEPLOYMENT_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h
|
||||
11003;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h
|
||||
11004;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/devices/SolarArrayDeploymentHandler.h
|
||||
11101;MEMORY_READ_RPT_CRC_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11102;ACK_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11103;EXE_FAILURE;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11104;CRC_FAILURE_EVENT;LOW;;/home/rmueller/EIVE/eive-obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11201;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11202;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11203;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11204;SELF_TEST_PWM_FAILURE;LOW;Get self test result returns PWM failure which concerns the coil actuation. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11205;SELF_TEST_TC_FAILURE;LOW;Get self test result returns TC failure (system failure) P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11206;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11207;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11208;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;/home/rmueller/EIVE/eive-obsw/mission/devices/IMTQHandler.h
|
||||
11301;ERROR_STATE;HIGH;Reaction wheel signals an error state;/home/rmueller/EIVE/eive-obsw/mission/devices/RwHandler.h
|
||||
11501;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11502;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11503;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11504;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11600;SANITIZATION_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/memory/SdCardManager.h
|
||||
11700;UPDATE_FILE_NOT_EXISTS;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11701;ACTION_COMMANDING_FAILED;LOW;Failed to send command to supervisor handler P1: Return value of CommandActionHelper::commandAction P2: Action ID of command to send;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11702;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11703;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11704;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11705;UPDATE_FINISHED;INFO;MPSoC update successful completed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11800;SEND_MRAM_DUMP_FAILED;LOW;Failed to send mram dump command to supervisor handler P1: Return value of commandAction function P2: Start address of MRAM to dump with this command;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocMemoryDumper.h
|
||||
11801;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocMemoryDumper.h
|
||||
11802;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/PlocMemoryDumper.h
|
||||
11901;INVALID_TC_FRAME;HIGH;;/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h
|
||||
11902;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h
|
||||
11903;CARRIER_LOCK;INFO;Carrier lock detected;/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h
|
||||
11904;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);/home/rmueller/EIVE/eive-obsw/linux/obc/PdecHandler.h
|
||||
12000;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12001;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12002;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12003;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12004;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12005;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12006;FLASH_WRITE_FAILED;LOW;Flash write procedure failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12007;FLASH_READ_FAILED;LOW;Flash read procedure failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12008;FPGA_DOWNLOAD_SUCCESSFUL;LOW;Download of FPGA image successful;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12009;FPGA_DOWNLOAD_FAILED;LOW;Download of FPGA image failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12010;FPGA_UPLOAD_SUCCESSFUL;LOW;Upload of FPGA image successful;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12011;FPGA_UPLOAD_FAILED;LOW;Upload of FPGA image failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12012;STR_HELPER_READING_REPLY_FAILED;LOW;Failed to read communication interface reply data P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12013;STR_HELPER_COM_ERROR;LOW;Unexpected stop of decoding sequence P1: Return code of failed communication interface read call P1: Upload/download position for which the read call failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12014;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12015;STR_HELPER_DEC_ERROR;LOW;Error during decoding of received reply occurred P1: Return value of decoding function P2: Position of upload/download packet, or address of flash write/read request;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12016;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12017;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12018;STR_HELPER_SENDING_PACKET_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
12019;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;/home/rmueller/EIVE/eive-obsw/bsp_q7s/devices/startracker/StrHelper.h
|
||||
2200;STORE_SEND_WRITE_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2201;STORE_WRITE_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2202;STORE_SEND_READ_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2203;STORE_READ_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2204;UNEXPECTED_MSG;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2205;STORING_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2206;TM_DUMP_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2207;STORE_INIT_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2208;STORE_INIT_EMPTY;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2209;STORE_CONTENT_CORRUPTED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2210;STORE_INITIALIZE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2211;INIT_DONE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2212;DUMP_FINISHED;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2213;DELETION_FINISHED;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2214;DELETION_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2215;AUTO_CATALOGS_SENDING_FAILED;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/tmstorage/TmStoreBackendIF.h
|
||||
2600;GET_DATA_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h
|
||||
2601;STORE_DATA_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/storagemanager/StorageManagerIF.h
|
||||
2800;DEVICE_BUILDING_COMMAND_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2801;DEVICE_SENDING_COMMAND_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2802;DEVICE_REQUESTING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2803;DEVICE_READING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2804;DEVICE_INTERPRETING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2805;DEVICE_MISSED_REPLY;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2806;DEVICE_UNKNOWN_REPLY;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2807;DEVICE_UNREQUESTED_REPLY;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2808;INVALID_DEVICE_COMMAND;LOW;Indicates a SW bug in child class.;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2809;MONITORING_LIMIT_EXCEEDED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2810;MONITORING_AMBIGUOUS;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
2811;DEVICE_WANTS_HARD_REBOOT;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/devicehandlers/DeviceHandlerIF.h
|
||||
4201;FUSE_CURRENT_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4202;FUSE_WENT_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4204;POWER_ABOVE_HIGH_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4205;POWER_BELOW_LOW_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/Fuse.h
|
||||
4300;SWITCH_WENT_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/power/PowerSwitchIF.h
|
||||
5000;HEATER_ON;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5001;HEATER_OFF;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5002;HEATER_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5003;HEATER_STAYED_ON;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5004;HEATER_STAYED_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/Heater.h
|
||||
5200;TEMP_SENSOR_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
||||
5201;TEMP_SENSOR_LOW;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
||||
5202;TEMP_SENSOR_GRADIENT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/AbstractTemperatureSensor.h
|
||||
5901;COMPONENT_TEMP_LOW;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5902;COMPONENT_TEMP_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5903;COMPONENT_TEMP_OOL_LOW;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5904;COMPONENT_TEMP_OOL_HIGH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
5905;TEMP_NOT_IN_OP_RANGE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/thermal/ThermalComponentIF.h
|
||||
7101;FDIR_CHANGED_STATE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
||||
7102;FDIR_STARTS_RECOVERY;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
||||
7103;FDIR_TURNS_OFF_DEVICE;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/fdir/FailureIsolationBase.h
|
||||
7201;MONITOR_CHANGED_STATE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7202;VALUE_BELOW_LOW_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7203;VALUE_ABOVE_HIGH_LIMIT;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7204;VALUE_OUT_OF_RANGE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/monitoring/MonitoringIF.h
|
||||
7400;CHANGING_MODE;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7401;MODE_INFO;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7402;FALLBACK_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7403;MODE_TRANSITION_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7404;CANT_KEEP_MODE;HIGH;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7405;OBJECT_IN_INVALID_MODE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7406;FORCING_MODE;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7407;MODE_CMD_REJECTED;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/modes/HasModesIF.h
|
||||
7506;HEALTH_INFO;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7507;CHILD_CHANGED_HEALTH;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7508;CHILD_PROBLEMS;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7509;OVERWRITING_HEALTH;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7510;TRYING_RECOVERY;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7511;RECOVERY_STEP;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7512;RECOVERY_DONE;MEDIUM;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/health/HasHealthIF.h
|
||||
7900;RF_AVAILABLE;INFO;A RF available signal was detected. P1: raw RFA state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7901;RF_LOST;INFO;A previously found RF available signal was lost. P1: raw RFA state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7902;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7903;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
7905;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
|
||||
8900;CLOCK_SET;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||
8901;CLOCK_SET_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/pus/Service9TimeManagement.h
|
||||
9700;TEST;INFO;;C:\Users\jakob\eive-software\eive_obsw/fsfw/src/fsfw/pus/Service17Test.h
|
||||
10600;CHANGE_OF_SETUP_PARAMETER;LOW;;C:\Users\jakob\eive-software\eive_obsw/fsfw/hal/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
|
||||
10900;GPIO_PULL_HIGH_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h
|
||||
10901;GPIO_PULL_LOW_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h
|
||||
10902;SWITCH_ALREADY_ON;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h
|
||||
10903;SWITCH_ALREADY_OFF;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h
|
||||
10904;MAIN_SWITCH_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/HeaterHandler.h
|
||||
11000;MAIN_SWITCH_ON_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/SolarArrayDeploymentHandler.h
|
||||
11001;MAIN_SWITCH_OFF_TIMEOUT;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/SolarArrayDeploymentHandler.h
|
||||
11002;DEPLOYMENT_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/SolarArrayDeploymentHandler.h
|
||||
11003;DEPL_SA1_GPIO_SWTICH_ON_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/SolarArrayDeploymentHandler.h
|
||||
11004;DEPL_SA2_GPIO_SWTICH_ON_FAILED;HIGH;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/SolarArrayDeploymentHandler.h
|
||||
11101;MEMORY_READ_RPT_CRC_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11102;ACK_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11103;EXE_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11104;CRC_FAILURE_EVENT;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/PlocMPSoCHandler.h
|
||||
11201;SELF_TEST_I2C_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11202;SELF_TEST_SPI_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11203;SELF_TEST_ADC_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11204;SELF_TEST_PWM_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11205;SELF_TEST_TC_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11206;SELF_TEST_MTM_RANGE_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11207;SELF_TEST_COIL_CURRENT_FAILURE;LOW;;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11208;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;C:\Users\jakob\eive-software\eive_obsw/mission/devices/IMTQHandler.h
|
||||
11301;ERROR_STATE;HIGH;Reaction wheel signals an error state;C:\Users\jakob\eive-software\eive_obsw/mission/devices/RwHandler.h
|
||||
11401;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StarTrackerHandler.h
|
||||
11402;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StarTrackerHandler.h
|
||||
11501;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11502;SUPV_ACK_FAILURE;LOW;PLOC supervisor received acknowledgment failure report;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11503;SUPV_EXE_FAILURE;LOW;PLOC received execution failure report;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11504;SUPV_CRC_FAILURE_EVENT;LOW;PLOC supervisor reply has invalid crc;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocSupervisorHandler.h
|
||||
11600;SANITIZATION_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/memory/SdCardManager.h
|
||||
11700;UPDATE_FILE_NOT_EXISTS;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11701;ACTION_COMMANDING_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11702;UPDATE_AVAILABLE_FAILED;LOW;Supervisor handler replied action message indicating a command execution failure of the update available command;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11703;UPDATE_TRANSFER_FAILED;LOW;Supervisor handler failed to transfer an update space packet. P1: Parameter holds the number of update packets already sent (inclusive the failed packet);C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11704;UPDATE_VERIFY_FAILED;LOW;Supervisor failed to execute the update verify command.;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11705;UPDATE_FINISHED;INFO;MPSoC update successful completed;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocUpdater.h
|
||||
11800;SEND_MRAM_DUMP_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h
|
||||
11801;MRAM_DUMP_FAILED;LOW;Received completion failure report form PLOC supervisor handler P1: MRAM start address of failing dump command;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h
|
||||
11802;MRAM_DUMP_FINISHED;LOW;MRAM dump finished successfully;C:\Users\jakob\eive-software\eive_obsw/bsp_q7s/devices/PlocMemoryDumper.h
|
||||
11901;INVALID_TC_FRAME;HIGH;;C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h
|
||||
11902;INVALID_FAR;HIGH;Read invalid FAR from PDEC after startup;C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h
|
||||
11903;CARRIER_LOCK;INFO;Carrier lock detected;C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h
|
||||
11904;BIT_LOCK_PDEC;INFO;Bit lock detected (data valid);C:\Users\jakob\eive-software\eive_obsw/linux/obc/PdecHandler.h
|
||||
12000;IMAGE_UPLOAD_FAILED;LOW;Image upload failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12001;IMAGE_DOWNLOAD_FAILED;LOW;Image download failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12002;IMAGE_UPLOAD_SUCCESSFUL;LOW;Uploading image to star tracker was successfulop;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12003;IMAGE_DOWNLOAD_SUCCESSFUL;LOW;Image download was successful;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12004;FLASH_WRITE_SUCCESSFUL;LOW;Finished flash write procedure successfully;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12005;FLASH_READ_SUCCESSFUL;LOW;Finished flash read procedure successfully;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12006;FLASH_READ_FAILED;LOW;Flash read procedure failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12007;FIRMWARE_UPDATE_SUCCESSFUL;LOW;Firmware update was successful;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12008;FIRMWARE_UPDATE_FAILED;LOW;Firmware update failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12009;STR_HELPER_READING_REPLY_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12010;STR_HELPER_COM_ERROR;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12011;STR_HELPER_NO_REPLY;LOW;Star tracker did not send replies (maybe device is powered off) P1: Position of upload or download packet for which no reply was sent;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12012;STR_HELPER_DEC_ERROR;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12013;POSITION_MISMATCH;LOW;Position mismatch P1: The expected position and thus the position for which the image upload/download failed;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12014;STR_HELPER_FILE_NOT_EXISTS;LOW;Specified file does not exist P1: Internal state of str helper;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12015;STR_HELPER_SENDING_PACKET_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
12016;STR_HELPER_REQUESTING_MSG_FAILED;LOW;;C:\Users\jakob\eive-software\eive_obsw/linux/devices/startracker/StrHelper.h
|
||||
|
|
@ -4,19 +4,18 @@
|
||||
0x43400001;THERMAL_CONTROLLER
|
||||
0x44120006;MGM_0_LIS3_HANDLER
|
||||
0x44120010;GYRO_0_ADIS_HANDLER
|
||||
0x44120032;SUS_1
|
||||
0x44120033;SUS_2
|
||||
0x44120034;SUS_3
|
||||
0x44120035;SUS_4
|
||||
0x44120036;SUS_5
|
||||
0x44120037;SUS_6
|
||||
0x44120038;SUS_7
|
||||
0x44120039;SUS_8
|
||||
0x44120040;SUS_9
|
||||
0x44120041;SUS_10
|
||||
0x44120042;SUS_11
|
||||
0x44120043;SUS_12
|
||||
0x44120044;SUS_13
|
||||
0x44120032;SUS_0
|
||||
0x44120033;SUS_1
|
||||
0x44120034;SUS_2
|
||||
0x44120035;SUS_3
|
||||
0x44120036;SUS_4
|
||||
0x44120037;SUS_5
|
||||
0x44120038;SUS_6
|
||||
0x44120039;SUS_7
|
||||
0x44120040;SUS_8
|
||||
0x44120041;SUS_9
|
||||
0x44120042;SUS_10
|
||||
0x44120043;SUS_11
|
||||
0x44120047;RW1
|
||||
0x44120107;MGM_1_RM3100_HANDLER
|
||||
0x44120111;GYRO_1_L3G_HANDLER
|
||||
@ -36,6 +35,7 @@
|
||||
0x44250002;PDU2_HANDLER
|
||||
0x44250003;ACU_HANDLER
|
||||
0x44260000;BPX_BATT_HANDLER
|
||||
0x44300000;PLPCDU_HANDLER
|
||||
0x443200A5;RAD_SENSOR
|
||||
0x44330000;PLOC_UPDATER
|
||||
0x44330001;PLOC_MEMORY_DUMPER
|
||||
@ -74,6 +74,7 @@
|
||||
0x50000300;TMTC_BRIDGE
|
||||
0x50000400;TMTC_POLLING_TASK
|
||||
0x50000500;FILE_SYSTEM_HANDLER
|
||||
0x50000550;SDC_MANAGER
|
||||
0x50000600;PTME
|
||||
0x50000700;PDEC_HANDLER
|
||||
0x50000800;CCSDS_HANDLER
|
||||
@ -101,6 +102,7 @@
|
||||
0x53ffffff;FSFW_OBJECTS_END
|
||||
0x54000010;SPI_TEST
|
||||
0x54000020;UART_TEST
|
||||
0x54000030;I2C_TEST
|
||||
0x5400AFFE;DUMMY_HANDLER
|
||||
0x5400CAFE;DUMMY_INTERFACE
|
||||
0x54123456;LIBGPIOD_TEST
|
||||
|
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 140 translations.
|
||||
* @brief Auto-generated event translation file. Contains 139 translations.
|
||||
* @details
|
||||
* Generated on: 2022-02-03 17:30:40
|
||||
* Generated on: 2022-02-27 15:36:42
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@ -107,6 +107,8 @@ const char *SELF_TEST_MTM_RANGE_FAILURE_STRING = "SELF_TEST_MTM_RANGE_FAILURE";
|
||||
const char *SELF_TEST_COIL_CURRENT_FAILURE_STRING = "SELF_TEST_COIL_CURRENT_FAILURE";
|
||||
const char *INVALID_ERROR_BYTE_STRING = "INVALID_ERROR_BYTE";
|
||||
const char *ERROR_STATE_STRING = "ERROR_STATE";
|
||||
const char *BOOTING_FIRMWARE_FAILED_STRING = "BOOTING_FIRMWARE_FAILED";
|
||||
const char *BOOTING_BOOTLOADER_FAILED_STRING = "BOOTING_BOOTLOADER_FAILED";
|
||||
const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE";
|
||||
const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE";
|
||||
const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE";
|
||||
@ -131,12 +133,9 @@ const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL";
|
||||
const char *IMAGE_DOWNLOAD_SUCCESSFUL_STRING = "IMAGE_DOWNLOAD_SUCCESSFUL";
|
||||
const char *FLASH_WRITE_SUCCESSFUL_STRING = "FLASH_WRITE_SUCCESSFUL";
|
||||
const char *FLASH_READ_SUCCESSFUL_STRING = "FLASH_READ_SUCCESSFUL";
|
||||
const char *FLASH_WRITE_FAILED_STRING = "FLASH_WRITE_FAILED";
|
||||
const char *FLASH_READ_FAILED_STRING = "FLASH_READ_FAILED";
|
||||
const char *FPGA_DOWNLOAD_SUCCESSFUL_STRING = "FPGA_DOWNLOAD_SUCCESSFUL";
|
||||
const char *FPGA_DOWNLOAD_FAILED_STRING = "FPGA_DOWNLOAD_FAILED";
|
||||
const char *FPGA_UPLOAD_SUCCESSFUL_STRING = "FPGA_UPLOAD_SUCCESSFUL";
|
||||
const char *FPGA_UPLOAD_FAILED_STRING = "FPGA_UPLOAD_FAILED";
|
||||
const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL";
|
||||
const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED";
|
||||
const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED";
|
||||
const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR";
|
||||
const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY";
|
||||
@ -352,6 +351,10 @@ const char * translateEvents(Event event) {
|
||||
return INVALID_ERROR_BYTE_STRING;
|
||||
case(11301):
|
||||
return ERROR_STATE_STRING;
|
||||
case(11401):
|
||||
return BOOTING_FIRMWARE_FAILED_STRING;
|
||||
case(11402):
|
||||
return BOOTING_BOOTLOADER_FAILED_STRING;
|
||||
case(11501):
|
||||
return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING;
|
||||
case(11502):
|
||||
@ -401,32 +404,26 @@ const char * translateEvents(Event event) {
|
||||
case(12005):
|
||||
return FLASH_READ_SUCCESSFUL_STRING;
|
||||
case(12006):
|
||||
return FLASH_WRITE_FAILED_STRING;
|
||||
case(12007):
|
||||
return FLASH_READ_FAILED_STRING;
|
||||
case(12007):
|
||||
return FIRMWARE_UPDATE_SUCCESSFUL_STRING;
|
||||
case(12008):
|
||||
return FPGA_DOWNLOAD_SUCCESSFUL_STRING;
|
||||
return FIRMWARE_UPDATE_FAILED_STRING;
|
||||
case(12009):
|
||||
return FPGA_DOWNLOAD_FAILED_STRING;
|
||||
case(12010):
|
||||
return FPGA_UPLOAD_SUCCESSFUL_STRING;
|
||||
case(12011):
|
||||
return FPGA_UPLOAD_FAILED_STRING;
|
||||
case(12012):
|
||||
return STR_HELPER_READING_REPLY_FAILED_STRING;
|
||||
case(12013):
|
||||
case(12010):
|
||||
return STR_HELPER_COM_ERROR_STRING;
|
||||
case(12014):
|
||||
case(12011):
|
||||
return STR_HELPER_NO_REPLY_STRING;
|
||||
case(12015):
|
||||
case(12012):
|
||||
return STR_HELPER_DEC_ERROR_STRING;
|
||||
case(12016):
|
||||
case(12013):
|
||||
return POSITION_MISMATCH_STRING;
|
||||
case(12017):
|
||||
case(12014):
|
||||
return STR_HELPER_FILE_NOT_EXISTS_STRING;
|
||||
case(12018):
|
||||
case(12015):
|
||||
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
|
||||
case(12019):
|
||||
case(12016):
|
||||
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
|
||||
default:
|
||||
return "UNKNOWN_EVENT";
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 24fa9a3fe3f5c6157b4c48e867e22bd2d335d18a
|
||||
Subproject commit bd76760052482f6f8fcdd84b88da963e61c9a48c
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 110 translations.
|
||||
* Generated on: 2022-02-03 12:01:36
|
||||
* Contains 112 translations.
|
||||
* Generated on: 2022-02-27 15:36:48
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
@ -12,6 +12,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER";
|
||||
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
||||
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
||||
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
||||
const char *SUS_0_STRING = "SUS_0";
|
||||
const char *SUS_1_STRING = "SUS_1";
|
||||
const char *SUS_2_STRING = "SUS_2";
|
||||
const char *SUS_3_STRING = "SUS_3";
|
||||
@ -23,8 +24,6 @@ const char *SUS_8_STRING = "SUS_8";
|
||||
const char *SUS_9_STRING = "SUS_9";
|
||||
const char *SUS_10_STRING = "SUS_10";
|
||||
const char *SUS_11_STRING = "SUS_11";
|
||||
const char *SUS_12_STRING = "SUS_12";
|
||||
const char *SUS_13_STRING = "SUS_13";
|
||||
const char *RW1_STRING = "RW1";
|
||||
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
||||
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
||||
@ -44,6 +43,7 @@ const char *PDU1_HANDLER_STRING = "PDU1_HANDLER";
|
||||
const char *PDU2_HANDLER_STRING = "PDU2_HANDLER";
|
||||
const char *ACU_HANDLER_STRING = "ACU_HANDLER";
|
||||
const char *BPX_BATT_HANDLER_STRING = "BPX_BATT_HANDLER";
|
||||
const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
|
||||
const char *RAD_SENSOR_STRING = "RAD_SENSOR";
|
||||
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
||||
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
||||
@ -82,6 +82,7 @@ const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR";
|
||||
const char *TMTC_BRIDGE_STRING = "TMTC_BRIDGE";
|
||||
const char *TMTC_POLLING_TASK_STRING = "TMTC_POLLING_TASK";
|
||||
const char *FILE_SYSTEM_HANDLER_STRING = "FILE_SYSTEM_HANDLER";
|
||||
const char *SDC_MANAGER_STRING = "SDC_MANAGER";
|
||||
const char *PTME_STRING = "PTME";
|
||||
const char *PDEC_HANDLER_STRING = "PDEC_HANDLER";
|
||||
const char *CCSDS_HANDLER_STRING = "CCSDS_HANDLER";
|
||||
@ -109,6 +110,7 @@ const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||
const char *SPI_TEST_STRING = "SPI_TEST";
|
||||
const char *UART_TEST_STRING = "UART_TEST";
|
||||
const char *I2C_TEST_STRING = "I2C_TEST";
|
||||
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||
@ -132,31 +134,29 @@ const char* translateObject(object_id_t object) {
|
||||
case 0x44120010:
|
||||
return GYRO_0_ADIS_HANDLER_STRING;
|
||||
case 0x44120032:
|
||||
return SUS_1_STRING;
|
||||
return SUS_0_STRING;
|
||||
case 0x44120033:
|
||||
return SUS_2_STRING;
|
||||
return SUS_1_STRING;
|
||||
case 0x44120034:
|
||||
return SUS_3_STRING;
|
||||
return SUS_2_STRING;
|
||||
case 0x44120035:
|
||||
return SUS_4_STRING;
|
||||
return SUS_3_STRING;
|
||||
case 0x44120036:
|
||||
return SUS_5_STRING;
|
||||
return SUS_4_STRING;
|
||||
case 0x44120037:
|
||||
return SUS_6_STRING;
|
||||
return SUS_5_STRING;
|
||||
case 0x44120038:
|
||||
return SUS_7_STRING;
|
||||
return SUS_6_STRING;
|
||||
case 0x44120039:
|
||||
return SUS_8_STRING;
|
||||
return SUS_7_STRING;
|
||||
case 0x44120040:
|
||||
return SUS_9_STRING;
|
||||
return SUS_8_STRING;
|
||||
case 0x44120041:
|
||||
return SUS_10_STRING;
|
||||
return SUS_9_STRING;
|
||||
case 0x44120042:
|
||||
return SUS_11_STRING;
|
||||
return SUS_10_STRING;
|
||||
case 0x44120043:
|
||||
return SUS_12_STRING;
|
||||
case 0x44120044:
|
||||
return SUS_13_STRING;
|
||||
return SUS_11_STRING;
|
||||
case 0x44120047:
|
||||
return RW1_STRING;
|
||||
case 0x44120107:
|
||||
@ -195,6 +195,8 @@ const char* translateObject(object_id_t object) {
|
||||
return ACU_HANDLER_STRING;
|
||||
case 0x44260000:
|
||||
return BPX_BATT_HANDLER_STRING;
|
||||
case 0x44300000:
|
||||
return PLPCDU_HANDLER_STRING;
|
||||
case 0x443200A5:
|
||||
return RAD_SENSOR_STRING;
|
||||
case 0x44330000:
|
||||
@ -271,6 +273,8 @@ const char* translateObject(object_id_t object) {
|
||||
return TMTC_POLLING_TASK_STRING;
|
||||
case 0x50000500:
|
||||
return FILE_SYSTEM_HANDLER_STRING;
|
||||
case 0x50000550:
|
||||
return SDC_MANAGER_STRING;
|
||||
case 0x50000600:
|
||||
return PTME_STRING;
|
||||
case 0x50000700:
|
||||
@ -325,6 +329,8 @@ const char* translateObject(object_id_t object) {
|
||||
return SPI_TEST_STRING;
|
||||
case 0x54000020:
|
||||
return UART_TEST_STRING;
|
||||
case 0x54000030:
|
||||
return I2C_TEST_STRING;
|
||||
case 0x5400AFFE:
|
||||
return DUMMY_HANDLER_STRING;
|
||||
case 0x5400CAFE:
|
||||
|
@ -15,16 +15,20 @@
|
||||
|
||||
#include <bitset>
|
||||
|
||||
#if defined(XIPHOS_Q7S)
|
||||
#include "busConf.h"
|
||||
#endif
|
||||
#include "devices/gpioIds.h"
|
||||
#include "mission/devices/max1227.h"
|
||||
|
||||
SpiTestClass::SpiTestClass(object_id_t objectId, GpioIF *gpioIF)
|
||||
: TestTask(objectId), gpioIF(gpioIF) {
|
||||
if (gpioIF == nullptr) {
|
||||
sif::error << "SpiTestClass::SpiTestClass: Invalid GPIO ComIF!" << std::endl;
|
||||
}
|
||||
testMode = TestModes::MGM_LIS3MDL;
|
||||
spiTransferStruct.rx_buf = reinterpret_cast<__u64>(recvBuffer.data());
|
||||
spiTransferStruct.tx_buf = reinterpret_cast<__u64>(sendBuffer.data());
|
||||
testMode = TestModes::MAX1227;
|
||||
spiTransferStruct[0].rx_buf = reinterpret_cast<__u64>(recvBuffer.data());
|
||||
setSendBuffer();
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTestClass::performOneShotAction() {
|
||||
@ -44,11 +48,25 @@ ReturnValue_t SpiTestClass::performOneShotAction() {
|
||||
performL3gTest(gyro1L3gd20ChipSelect);
|
||||
break;
|
||||
}
|
||||
case (TestModes::MAX1227): {
|
||||
performOneShotMax1227Test();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTestClass::performPeriodicAction() { return HasReturnvaluesIF::RETURN_OK; }
|
||||
ReturnValue_t SpiTestClass::performPeriodicAction() {
|
||||
switch (testMode) {
|
||||
case (TestModes::MAX1227): {
|
||||
performPeriodicMax1227Test();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void SpiTestClass::performRm3100Test(uint8_t mgmId) {
|
||||
/* Configure all SPI chip selects and pull them high */
|
||||
@ -180,7 +198,7 @@ void SpiTestClass::performLis3MdlTest(uint8_t lis3Id) {
|
||||
return;
|
||||
}
|
||||
setSpiSpeedAndMode(fileDescriptor, spiMode, spiSpeed);
|
||||
spiTransferStruct.delay_usecs = 0;
|
||||
spiTransferStruct[0].delay_usecs = 0;
|
||||
|
||||
uint8_t whoAmIRegVal = readStmRegister(fileDescriptor, currentGpioId, whoAmIReg, false);
|
||||
sif::info << "SpiTestClass::performLis3MdlTest: WHO AM I register 0b"
|
||||
@ -273,73 +291,422 @@ void SpiTestClass::performL3gTest(uint8_t l3gId) {
|
||||
sif::info << "Z: " << angVelocZ << std::endl;
|
||||
}
|
||||
|
||||
void SpiTestClass::performOneShotMax1227Test() {
|
||||
using namespace max1227;
|
||||
adcCfg.testRadSensorExtConvWithDelay = false;
|
||||
adcCfg.testRadSensorIntConv = false;
|
||||
|
||||
bool setAllSusOn = false;
|
||||
bool susIntConv = false;
|
||||
bool susExtConv = false;
|
||||
if (setAllSusOn) {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].doTest = true;
|
||||
}
|
||||
} else {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].doTest = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (susIntConv) {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].intConv = true;
|
||||
}
|
||||
}
|
||||
if (susExtConv) {
|
||||
for (uint8_t idx = 0; idx < 12; idx++) {
|
||||
adcCfg.testSus[idx].extConv = true;
|
||||
}
|
||||
}
|
||||
|
||||
adcCfg.plPcduAdcExtConv = true;
|
||||
adcCfg.plPcduAdcIntConv = false;
|
||||
// Is problematic, don't know why
|
||||
adcCfg.plPcduAdcExtConvAsOne = false;
|
||||
performMax1227Test();
|
||||
}
|
||||
|
||||
void SpiTestClass::performPeriodicMax1227Test() {
|
||||
using namespace max1227;
|
||||
performMax1227Test();
|
||||
}
|
||||
|
||||
void SpiTestClass::performMax1227Test() {
|
||||
#ifdef XIPHOS_Q7S
|
||||
std::string deviceName = q7s::SPI_DEFAULT_DEV;
|
||||
#elif defined(RASPBERRY_PI)
|
||||
std::string deviceName = "";
|
||||
#elif defined(EGSE)
|
||||
std::string deviceName = "";
|
||||
#endif
|
||||
int fd = 0;
|
||||
UnixFileGuard fileHelper(deviceName, &fd, O_RDWR, "SpiComIF::initializeInterface");
|
||||
if (fileHelper.getOpenResult()) {
|
||||
sif::error << "SpiTestClass::performLis3Mdl3100Test: File descriptor could not be opened!"
|
||||
<< std::endl;
|
||||
return;
|
||||
}
|
||||
uint32_t spiSpeed = 976'000;
|
||||
spi::SpiModes spiMode = spi::SpiModes::MODE_3;
|
||||
setSpiSpeedAndMode(fd, spiMode, spiSpeed);
|
||||
|
||||
max1227RadSensorTest(fd);
|
||||
int idx = 0;
|
||||
bool firstTest = true;
|
||||
for (auto &susCfg : adcCfg.testSus) {
|
||||
if (susCfg.doTest) {
|
||||
if (firstTest) {
|
||||
firstTest = false;
|
||||
sif::info << "---------- SUS ADC Values -----------" << std::endl;
|
||||
}
|
||||
sif::info << "SUS " << std::setw(2) << idx << ": ";
|
||||
max1227SusTest(fd, susCfg);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
max1227PlPcduTest(fd);
|
||||
}
|
||||
|
||||
void SpiTestClass::max1227RadSensorTest(int fd) {
|
||||
using namespace max1227;
|
||||
if (adcCfg.testRadSensorExtConvWithDelay) {
|
||||
sendBuffer[0] = max1227::buildResetByte(true);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
usleep(200);
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::EXT_CONV_EXT_TIMED, RefSel::INT_REF_WITH_WAKEUP,
|
||||
DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), 7, spiTransferStruct[0].len);
|
||||
size_t tmpLen = spiTransferStruct[0].len;
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
std::memcpy(sendBuffer.data(), sendBuffer.data() + 1, tmpLen - 1);
|
||||
spiTransferStruct[0].len = tmpLen - 1;
|
||||
usleep(65);
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
arrayprinter::print(recvBuffer.data(), 13, OutputType::HEX);
|
||||
uint16_t adcRaw[8] = {};
|
||||
adcRaw[0] = (recvBuffer[0] << 8) | recvBuffer[1];
|
||||
adcRaw[1] = (recvBuffer[2] << 8) | recvBuffer[3];
|
||||
adcRaw[2] = (recvBuffer[4] << 8) | recvBuffer[5];
|
||||
adcRaw[3] = (recvBuffer[6] << 8) | recvBuffer[7];
|
||||
adcRaw[4] = (recvBuffer[8] << 8) | recvBuffer[9];
|
||||
adcRaw[5] = (recvBuffer[10] << 8) | recvBuffer[11];
|
||||
adcRaw[6] = (recvBuffer[12] << 8) | recvBuffer[13];
|
||||
adcRaw[7] = (recvBuffer[14] << 8) | recvBuffer[15];
|
||||
arrayprinter::print(recvBuffer.data(), 17, OutputType::HEX);
|
||||
for (int idx = 0; idx < 8; idx++) {
|
||||
sif::info << "ADC raw " << idx << ": " << adcRaw[idx] << std::endl;
|
||||
}
|
||||
max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data(), spiTransferStruct[0].len);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
usleep(65);
|
||||
spiTransferStruct[0].len = 24;
|
||||
std::memcpy(sendBuffer.data(), sendBuffer.data() + 1, 24);
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
int16_t tempRaw = ((recvBuffer[22] & 0x0f) << 8) | recvBuffer[23];
|
||||
float temp = max1227::getTemperature(tempRaw);
|
||||
sif::info << "Temperature: " << temp << std::endl;
|
||||
}
|
||||
if (adcCfg.testRadSensorIntConv) {
|
||||
sendBuffer[0] = max1227::buildResetByte(false);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
usleep(5);
|
||||
// Now use internal conversion
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::INT_CONV_INT_TIMED_CNVST_AS_AIN,
|
||||
RefSel::INT_REF_NO_WAKEUP, DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
usleep(10);
|
||||
sendBuffer[0] = buildConvByte(ScanModes::CHANNELS_0_TO_N, 7, true);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
|
||||
usleep(65);
|
||||
spiTransferStruct[0].len = 18;
|
||||
// Shift out zeros
|
||||
shiftOutZeros();
|
||||
transfer(fd, gpioIds::CS_RAD_SENSOR);
|
||||
setSendBuffer();
|
||||
|
||||
arrayprinter::print(recvBuffer.data(), 14);
|
||||
uint16_t adcRaw[8] = {};
|
||||
int16_t tempRaw = ((recvBuffer[0] & 0x0f) << 8) | recvBuffer[1];
|
||||
sif::info << "Temperature: " << tempRaw * 0.125 << " C" << std::endl;
|
||||
adcRaw[0] = (recvBuffer[2] << 8) | recvBuffer[3];
|
||||
adcRaw[1] = (recvBuffer[4] << 8) | recvBuffer[5];
|
||||
adcRaw[2] = (recvBuffer[6] << 8) | recvBuffer[7];
|
||||
adcRaw[3] = (recvBuffer[8] << 8) | recvBuffer[9];
|
||||
adcRaw[4] = (recvBuffer[10] << 8) | recvBuffer[11];
|
||||
adcRaw[5] = (recvBuffer[12] << 8) | recvBuffer[13];
|
||||
adcRaw[6] = (recvBuffer[14] << 8) | recvBuffer[15];
|
||||
adcRaw[7] = (recvBuffer[16] << 8) | recvBuffer[17];
|
||||
for (int idx = 0; idx < 8; idx++) {
|
||||
sif::info << "ADC raw " << idx << ": " << adcRaw[idx] << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SpiTestClass::max1227SusTest(int fd, SusTestCfg &cfg) {
|
||||
using namespace max1227;
|
||||
if (cfg.extConv) {
|
||||
sendBuffer[0] = max1227::buildResetByte(false);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, cfg.gpioId);
|
||||
|
||||
usleep(65);
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::EXT_CONV_EXT_TIMED, RefSel::INT_REF_NO_WAKEUP,
|
||||
DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, cfg.gpioId);
|
||||
|
||||
max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), 5, spiTransferStruct[0].len);
|
||||
transfer(fd, cfg.gpioId);
|
||||
uint16_t adcRaw[6] = {};
|
||||
adcRaw[0] = (recvBuffer[1] << 8) | recvBuffer[2];
|
||||
adcRaw[1] = (recvBuffer[3] << 8) | recvBuffer[4];
|
||||
adcRaw[2] = (recvBuffer[5] << 8) | recvBuffer[6];
|
||||
adcRaw[3] = (recvBuffer[7] << 8) | recvBuffer[8];
|
||||
adcRaw[4] = (recvBuffer[9] << 8) | recvBuffer[10];
|
||||
adcRaw[5] = (recvBuffer[11] << 8) | recvBuffer[12];
|
||||
sif::info << "Ext Conv [" << std::hex << std::setw(3);
|
||||
for (int idx = 0; idx < 5; idx++) {
|
||||
sif::info << adcRaw[idx];
|
||||
if (idx < 6) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << std::dec << "]" << std::endl; // | Temperature: " << temp << " C" << std::endl;
|
||||
}
|
||||
if (cfg.intConv) {
|
||||
sendBuffer[0] = max1227::buildResetByte(false);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, cfg.gpioId);
|
||||
usleep(65);
|
||||
// Now use internal conversion
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::INT_CONV_INT_TIMED_CNVST_AS_AIN,
|
||||
RefSel::INT_REF_NO_WAKEUP, DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, cfg.gpioId);
|
||||
usleep(10);
|
||||
sendBuffer[0] = buildConvByte(ScanModes::CHANNELS_0_TO_N, 5, true);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, cfg.gpioId);
|
||||
|
||||
usleep(65);
|
||||
spiTransferStruct[0].len = 14;
|
||||
// Shift out zeros
|
||||
shiftOutZeros();
|
||||
transfer(fd, cfg.gpioId);
|
||||
setSendBuffer();
|
||||
// arrayprinter::print(recvBuffer.data(), 14);
|
||||
float temp = static_cast<int16_t>(((recvBuffer[0] & 0x0f) << 8) | recvBuffer[1]) * 0.125;
|
||||
uint16_t adcRaw[6] = {};
|
||||
adcRaw[0] = (recvBuffer[2] << 8) | recvBuffer[3];
|
||||
adcRaw[1] = (recvBuffer[4] << 8) | recvBuffer[5];
|
||||
adcRaw[2] = (recvBuffer[6] << 8) | recvBuffer[7];
|
||||
adcRaw[3] = (recvBuffer[8] << 8) | recvBuffer[9];
|
||||
adcRaw[4] = (recvBuffer[10] << 8) | recvBuffer[11];
|
||||
adcRaw[5] = (recvBuffer[12] << 8) | recvBuffer[13];
|
||||
sif::info << "Int Conv [" << std::hex << std::setw(3);
|
||||
for (int idx = 0; idx < 6; idx++) {
|
||||
sif::info << adcRaw[idx];
|
||||
if (idx < 5) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << std::dec << "] | T[C] " << temp << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void SpiTestClass::max1227PlPcduTest(int fd) {
|
||||
using namespace max1227;
|
||||
if ((adcCfg.plPcduAdcExtConv or adcCfg.plPcduAdcIntConv or adcCfg.plPcduAdcExtConvAsOne) and
|
||||
adcCfg.vbatSwitch) {
|
||||
// This enables the ADC
|
||||
ReturnValue_t result = gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT0);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
result = gpioIF->pullHigh(gpioIds::PLPCDU_ENB_VBAT1);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
adcCfg.vbatSwitch = false;
|
||||
// Takes a bit of time until the ADC is usable
|
||||
TaskFactory::delayTask(50);
|
||||
sendBuffer[0] = max1227::buildResetByte(false);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
}
|
||||
if (adcCfg.plPcduAdcExtConv) {
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::EXT_CONV_EXT_TIMED, RefSel::INT_REF_NO_WAKEUP,
|
||||
DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
uint8_t n = 11;
|
||||
max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), n, spiTransferStruct[0].len);
|
||||
size_t dummy = 0;
|
||||
max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data() + spiTransferStruct[0].len,
|
||||
dummy);
|
||||
// + 1 to account for temp conversion byte
|
||||
spiTransferStruct[0].len += 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
uint16_t adcRaw[n + 1] = {};
|
||||
for (uint8_t idx = 0; idx < n + 1; idx++) {
|
||||
adcRaw[idx] = (recvBuffer[idx * 2 + 1] << 8) | recvBuffer[idx * 2 + 2];
|
||||
}
|
||||
spiTransferStruct[0].len = 24;
|
||||
// Shift out zeros
|
||||
shiftOutZeros();
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
setSendBuffer();
|
||||
int16_t tempRaw = ((recvBuffer[22] & 0x0f) << 8) | recvBuffer[23];
|
||||
sif::info << "PL PCDU ADC ext conv [" << std::hex << std::setfill('0');
|
||||
for (int idx = 0; idx < n + 1; idx++) {
|
||||
sif::info << std::setw(3) << adcRaw[idx];
|
||||
if (idx < n) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << "]" << std::endl;
|
||||
sif::info << "Temperature: " << max1227::getTemperature(tempRaw) << " C" << std::endl;
|
||||
}
|
||||
if (adcCfg.plPcduAdcExtConvAsOne) {
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::EXT_CONV_EXT_TIMED, RefSel::INT_REF_NO_WAKEUP,
|
||||
DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
uint8_t n = 11;
|
||||
max1227::prepareExternallyClockedRead0ToN(sendBuffer.data(), n, spiTransferStruct[0].len);
|
||||
max1227::prepareExternallyClockedTemperatureRead(sendBuffer.data() + spiTransferStruct[0].len,
|
||||
spiTransferStruct[0].len);
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
uint16_t adcRaw[n + 1] = {};
|
||||
for (uint8_t idx = 0; idx < n + 1; idx++) {
|
||||
adcRaw[idx] = (recvBuffer[idx * 2 + 1] << 8) | recvBuffer[idx * 2 + 2];
|
||||
}
|
||||
int16_t tempRaw = ((recvBuffer[spiTransferStruct[0].len - 2] & 0x0f) << 8) |
|
||||
recvBuffer[spiTransferStruct[0].len - 1];
|
||||
sif::info << "PL PCDU ADC ext conv [" << std::hex << std::setfill('0');
|
||||
for (int idx = 0; idx < n + 1; idx++) {
|
||||
sif::info << std::setw(3) << adcRaw[idx];
|
||||
if (idx < n) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << "]" << std::endl;
|
||||
sif::info << "Temperature: " << max1227::getTemperature(tempRaw) << " C" << std::endl;
|
||||
}
|
||||
if (adcCfg.plPcduAdcIntConv) {
|
||||
sendBuffer[0] = max1227::buildResetByte(true);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
// Now use internal conversion
|
||||
sendBuffer[0] = max1227::buildSetupByte(ClkSel::INT_CONV_INT_TIMED_CNVST_AS_AIN,
|
||||
RefSel::INT_REF_NO_WAKEUP, DiffSel::NONE_0);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
usleep(10);
|
||||
uint8_t n = 11;
|
||||
sendBuffer[0] = buildConvByte(ScanModes::CHANNELS_0_TO_N, n, true);
|
||||
spiTransferStruct[0].len = 1;
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
|
||||
usleep(65);
|
||||
spiTransferStruct[0].len = 26;
|
||||
// Shift out zeros
|
||||
shiftOutZeros();
|
||||
transfer(fd, gpioIds::PLPCDU_ADC_CS);
|
||||
setSendBuffer();
|
||||
uint16_t adcRaw[n + 1] = {};
|
||||
int16_t tempRaw = ((recvBuffer[0] & 0x0f) << 8) | recvBuffer[1];
|
||||
sif::info << "PL PCDU ADC int conv [" << std::hex << std::setfill('0');
|
||||
for (int idx = 0; idx < n + 1; idx++) {
|
||||
adcRaw[idx] = (recvBuffer[idx * 2 + 2] << 8) | recvBuffer[idx * 2 + 3];
|
||||
sif::info << std::setw(3) << adcRaw[idx];
|
||||
if (idx < n) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << "]" << std::endl;
|
||||
sif::info << "Temperature: " << max1227::getTemperature(tempRaw) << " C" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void SpiTestClass::acsInit() {
|
||||
using namespace gpio;
|
||||
GpioCookie *gpioCookie = new GpioCookie();
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
GpiodRegularByChip *gpio = nullptr;
|
||||
std::string rpiGpioName = "gpiochip0";
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm0Lis3mdlChipSelect, "MGM_0_LIS3", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm1Rm3100ChipSelect, "MGM_1_RM3100", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm1Rm3100ChipSelect, "MGM_1_RM3100", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, gyro0AdisChipSelect, "GYRO_0_ADIS", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, gyro0AdisChipSelect, "GYRO_0_ADIS", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, gyro1L3gd20ChipSelect, "GYRO_1_L3G", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, gyro1L3gd20ChipSelect, "GYRO_1_L3G", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, gyro3L3gd20ChipSelect, "GYRO_2_L3G", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, gyro3L3gd20ChipSelect, "GYRO_2_L3G", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm2Lis3mdlChipSelect, "MGM_2_LIS3", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByChip(rpiGpioName, mgm3Rm3100ChipSelect, "MGM_3_RM3100", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
GpiodRegularByLineName *gpio = nullptr;
|
||||
gpio =
|
||||
new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", gpio::DIR_OUT, gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_0_CS, "MGM_0_LIS3", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_0_LIS3_CS, gpio);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_1_RM3100", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_1_RM3100_CS, gpio);
|
||||
gpio =
|
||||
new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", gpio::DIR_OUT, gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_2_CS, "MGM_2_LIS3", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_2_LIS3_CS, gpio);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::MGM_1_CS, "MGM_3_RM3100", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::MGM_3_RM3100_CS, gpio);
|
||||
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, "GYRO_0_ADIS", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_1_L3G_CS, "GYRO_1_L3G", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_1_L3G_CS, gpio);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_2_ADIS_CS, "GYRO_2_ADIS", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_2_ADIS_CS, gpio);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", gpio::DIR_OUT,
|
||||
gpio::HIGH);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_3_L3G_CS, "GYRO_3_L3G", Direction::OUT,
|
||||
Levels::HIGH);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_3_L3G_CS, gpio);
|
||||
|
||||
// Enable pins must be pulled low for regular operations
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", gpio::DIR_OUT,
|
||||
gpio::LOW);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_0_ENABLE", Direction::OUT,
|
||||
Levels::LOW);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_0_ENABLE, gpio);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", gpio::DIR_OUT,
|
||||
gpio::LOW);
|
||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ENABLE, "GYRO_2_ENABLE", Direction::OUT,
|
||||
Levels::LOW);
|
||||
gpioCookie->addGpio(gpioIds::GYRO_2_ENABLE, gpio);
|
||||
#endif
|
||||
if (gpioIF != nullptr) {
|
||||
@ -348,8 +715,27 @@ void SpiTestClass::acsInit() {
|
||||
}
|
||||
|
||||
void SpiTestClass::setSpiSpeedAndMode(int spiFd, spi::SpiModes mode, uint32_t speed) {
|
||||
int mode_test = SPI_MODE_3;
|
||||
int retval = ioctl(spiFd, SPI_IOC_WR_MODE, &mode_test); // reinterpret_cast<uint8_t*>(&mode));
|
||||
int modeUnix = 0;
|
||||
switch (mode) {
|
||||
case (spi::SpiModes::MODE_0): {
|
||||
modeUnix = SPI_MODE_0;
|
||||
break;
|
||||
}
|
||||
case (spi::SpiModes::MODE_1): {
|
||||
modeUnix = SPI_MODE_1;
|
||||
break;
|
||||
}
|
||||
case (spi::SpiModes::MODE_2): {
|
||||
modeUnix = SPI_MODE_2;
|
||||
break;
|
||||
}
|
||||
case (spi::SpiModes::MODE_3): {
|
||||
modeUnix = SPI_MODE_3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int retval = ioctl(spiFd, SPI_IOC_WR_MODE, &modeUnix); // reinterpret_cast<uint8_t*>(&mode));
|
||||
if (retval != 0) {
|
||||
utility::handleIoctlError("SpiTestClass::performRm3100Test: Setting SPI mode failed!");
|
||||
}
|
||||
@ -361,7 +747,7 @@ void SpiTestClass::setSpiSpeedAndMode(int spiFd, spi::SpiModes mode, uint32_t sp
|
||||
}
|
||||
|
||||
void SpiTestClass::writeRegister(int fd, gpioId_t chipSelect, uint8_t reg, uint8_t value) {
|
||||
spiTransferStruct.len = 2;
|
||||
spiTransferStruct[0].len = 2;
|
||||
sendBuffer[0] = reg;
|
||||
sendBuffer[1] = value;
|
||||
|
||||
@ -405,7 +791,7 @@ void SpiTestClass::writeMultipleRegisters(int fd, gpioId_t chipSelect, uint8_t r
|
||||
|
||||
sendBuffer[0] = reg;
|
||||
std::memcpy(sendBuffer.data() + 1, values, len);
|
||||
spiTransferStruct.len = len + 1;
|
||||
spiTransferStruct[0].len = len + 1;
|
||||
|
||||
if (gpioIF != nullptr and chipSelect != gpio::NO_GPIO) {
|
||||
gpioIF->pullLow(chipSelect);
|
||||
@ -429,13 +815,19 @@ void SpiTestClass::readMultipleStmRegisters(int fd, gpioId_t chipSelect, uint8_t
|
||||
readMultipleRegisters(fd, chipSelect, reg, reply, len);
|
||||
}
|
||||
|
||||
void SpiTestClass::shiftOutZeros() { spiTransferStruct[0].tx_buf = 0; }
|
||||
|
||||
void SpiTestClass::setSendBuffer() {
|
||||
spiTransferStruct[0].tx_buf = reinterpret_cast<__u64>(sendBuffer.data());
|
||||
}
|
||||
|
||||
void SpiTestClass::readMultipleRegisters(int fd, gpioId_t chipSelect, uint8_t reg, uint8_t *reply,
|
||||
size_t len) {
|
||||
if (reply == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
spiTransferStruct.len = len + 1;
|
||||
spiTransferStruct[0].len = len + 1;
|
||||
sendBuffer[0] = reg | STM_READ_MASK;
|
||||
|
||||
for (uint8_t idx = 0; idx < len; idx++) {
|
||||
@ -465,7 +857,7 @@ uint8_t SpiTestClass::readStmRegister(int fd, gpioId_t chipSelect, uint8_t reg,
|
||||
}
|
||||
|
||||
uint8_t SpiTestClass::readRegister(int fd, gpioId_t chipSelect, uint8_t reg) {
|
||||
spiTransferStruct.len = 2;
|
||||
spiTransferStruct[0].len = 2;
|
||||
sendBuffer[0] = reg;
|
||||
sendBuffer[1] = 0;
|
||||
|
||||
@ -481,3 +873,28 @@ uint8_t SpiTestClass::readRegister(int fd, gpioId_t chipSelect, uint8_t reg) {
|
||||
}
|
||||
return recvBuffer[1];
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTestClass::transfer(int fd, gpioId_t chipSelect = gpio::NO_GPIO) {
|
||||
int retval = 0;
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
if (chipSelect != gpio::NO_GPIO) {
|
||||
result = gpioIF->pullLow(chipSelect);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
retval = ioctl(fd, SPI_IOC_MESSAGE(1), &spiTransferStruct);
|
||||
if (retval < 0) {
|
||||
utility::handleIoctlError("SpiTestClass::transfer: ioctl failed");
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
if (chipSelect != gpio::NO_GPIO) {
|
||||
result = gpioIF->pullHigh(chipSelect);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
@ -6,21 +6,40 @@
|
||||
#if defined(XIPHOS_Q7S)
|
||||
#include "busConf.h"
|
||||
#endif
|
||||
|
||||
#include <fsfw_hal/common/gpio/GpioIF.h>
|
||||
#include <fsfw_hal/linux/spi/SpiCookie.h>
|
||||
#include <test/testtasks/TestTask.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
|
||||
struct SusTestCfg {
|
||||
SusTestCfg(bool doTest, gpioId_t gpioId) : gpioId(gpioId) {}
|
||||
bool doTest = false;
|
||||
const gpioId_t gpioId;
|
||||
bool intConv = true;
|
||||
bool extConv = false;
|
||||
};
|
||||
|
||||
struct Max1227TestCfg {
|
||||
bool testRadSensorExtConvWithDelay = false;
|
||||
bool testRadSensorIntConv = false;
|
||||
bool plPcduAdcExtConv = false;
|
||||
bool plPcduAdcExtConvAsOne = false;
|
||||
bool plPcduAdcIntConv = false;
|
||||
bool vbatSwitch = true;
|
||||
|
||||
SusTestCfg testSus[12] = {
|
||||
{false, gpioIds::CS_SUS_0}, {false, gpioIds::CS_SUS_1}, {false, gpioIds::CS_SUS_2},
|
||||
{false, gpioIds::CS_SUS_3}, {false, gpioIds::CS_SUS_4}, {false, gpioIds::CS_SUS_5},
|
||||
{false, gpioIds::CS_SUS_6}, {false, gpioIds::CS_SUS_7}, {false, gpioIds::CS_SUS_8},
|
||||
{false, gpioIds::CS_SUS_9}, {false, gpioIds::CS_SUS_10}, {false, gpioIds::CS_SUS_11},
|
||||
};
|
||||
};
|
||||
class SpiTestClass : public TestTask {
|
||||
public:
|
||||
enum TestModes {
|
||||
NONE,
|
||||
MGM_LIS3MDL,
|
||||
MGM_RM3100,
|
||||
GYRO_L3GD20H,
|
||||
};
|
||||
enum TestModes { NONE, MGM_LIS3MDL, MGM_RM3100, GYRO_L3GD20H, MAX1227 };
|
||||
|
||||
TestModes testMode;
|
||||
|
||||
@ -31,14 +50,18 @@ class SpiTestClass : public TestTask {
|
||||
|
||||
private:
|
||||
GpioIF* gpioIF;
|
||||
Max1227TestCfg adcCfg = {};
|
||||
|
||||
std::array<uint8_t, 128> recvBuffer;
|
||||
std::array<uint8_t, 128> sendBuffer;
|
||||
struct spi_ioc_transfer spiTransferStruct = {};
|
||||
struct spi_ioc_transfer spiTransferStruct[6] = {};
|
||||
|
||||
void performRm3100Test(uint8_t mgmId);
|
||||
void performLis3MdlTest(uint8_t lis3Id);
|
||||
void performL3gTest(uint8_t l3gId);
|
||||
void performOneShotMax1227Test();
|
||||
void performPeriodicMax1227Test();
|
||||
void performMax1227Test();
|
||||
|
||||
/* ACS board specific code which pulls all GPIOs high */
|
||||
void acsInit();
|
||||
@ -55,6 +78,7 @@ class SpiTestClass : public TestTask {
|
||||
uint8_t gyro2AdisChipSelect = gpio::GYRO_2_BCM_PIN;
|
||||
uint8_t gyro3L3gd20ChipSelect = gpio::GYRO_3_BCM_PIN;
|
||||
#else
|
||||
|
||||
uint8_t mgm0Lis3mdlChipSelect = 0;
|
||||
uint8_t mgm1Rm3100ChipSelect = 0;
|
||||
uint8_t gyro0AdisResetLine = 0;
|
||||
@ -69,6 +93,13 @@ class SpiTestClass : public TestTask {
|
||||
static constexpr uint8_t RM3100_READ_MASK = STM_READ_MASK;
|
||||
static constexpr uint8_t STM_AUTO_INCR_MASK = 0b0100'0000;
|
||||
|
||||
void shiftOutZeros();
|
||||
void setSendBuffer();
|
||||
|
||||
void max1227RadSensorTest(int fd);
|
||||
void max1227SusTest(int fd, SusTestCfg& cfg);
|
||||
void max1227PlPcduTest(int fd);
|
||||
|
||||
void setSpiSpeedAndMode(int spiFd, spi::SpiModes mode, uint32_t speed);
|
||||
|
||||
void writeStmRegister(int fd, gpioId_t chipSelect, uint8_t reg, uint8_t value,
|
||||
@ -78,6 +109,7 @@ class SpiTestClass : public TestTask {
|
||||
void writeMultipleRegisters(int fd, gpioId_t chipSelect, uint8_t reg, uint8_t* values,
|
||||
size_t len);
|
||||
void writeRegister(int fd, gpioId_t chipSelect, uint8_t reg, uint8_t value);
|
||||
ReturnValue_t transfer(int fd, gpioId_t chipSelect);
|
||||
|
||||
uint8_t readRm3100Register(int fd, gpioId_t chipSelect, uint8_t reg);
|
||||
uint8_t readStmRegister(int fd, gpioId_t chipSelect, uint8_t reg, bool autoIncrement);
|
||||
|
@ -1,16 +1,11 @@
|
||||
#include "UartTestClass.h"
|
||||
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#if defined(RASPBERRY_PI)
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#include <errno.h> // Error integer and strerror() function
|
||||
#include <fcntl.h> // Contains file controls like O_RDWR
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include <unistd.h> // write(), read(), close()
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/globalfunctions/CRC.h"
|
||||
#include "fsfw/globalfunctions/DleEncoder.h"
|
||||
#include "fsfw/globalfunctions/arrayprinter.h"
|
||||
@ -42,7 +37,7 @@ ReturnValue_t UartTestClass::performPeriodicAction() {
|
||||
}
|
||||
|
||||
void UartTestClass::gpsInit() {
|
||||
#if RPI_TEST_GPS_DEVICE == 1
|
||||
#if RPI_TEST_GPS_HANDLER == 1
|
||||
int result = lwgps_init(&gpsData);
|
||||
if (result == 0) {
|
||||
sif::warning << "lwgps_init error: " << result << std::endl;
|
||||
@ -90,7 +85,7 @@ void UartTestClass::gpsInit() {
|
||||
}
|
||||
|
||||
void UartTestClass::gpsPeriodic() {
|
||||
#if RPI_TEST_GPS_DEVICE == 1
|
||||
#if RPI_TEST_GPS_HANDLER == 1
|
||||
int bytesRead = 0;
|
||||
do {
|
||||
bytesRead = read(serialPort, reinterpret_cast<void*>(recBuf.data()),
|
||||
@ -129,7 +124,7 @@ void UartTestClass::gpsPeriodic() {
|
||||
|
||||
void UartTestClass::scexInit() {
|
||||
#if defined(RASPBERRY_PI)
|
||||
std::string devname = "/dev/ttyUSB1";
|
||||
std::string devname = "/dev/serial0";
|
||||
#else
|
||||
std::string devname = "/dev/ul-scex";
|
||||
#endif
|
||||
@ -156,6 +151,13 @@ void UartTestClass::scexInit() {
|
||||
tty.c_cc[VTIME] = 1; // In units of 0.1 seconds
|
||||
tty.c_cc[VMIN] = 255; // Read up to 255 bytes
|
||||
|
||||
// Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here.
|
||||
#if !defined(XIPHOS_Q7S)
|
||||
if (cfsetispeed(&tty, B57600) != 0) {
|
||||
sif::warning << "UartTestClass::scexInit: Setting baud rate failed" << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
|
||||
sif::warning << "tcsetattr call failed with error [" << errno << ", " << strerror(errno)
|
||||
<< std::endl;
|
||||
@ -165,37 +167,12 @@ void UartTestClass::scexInit() {
|
||||
}
|
||||
|
||||
void UartTestClass::scexPeriodic() {
|
||||
auto dleEncoder = DleEncoder();
|
||||
std::array<uint8_t, 128> tmpCmdBuf = {};
|
||||
// Send ping command
|
||||
tmpCmdBuf[0] = scex::CMD_PING;
|
||||
// These two fields are the packet counter and the total packet count. Those are 1 and 1 for each
|
||||
// telecommand so far
|
||||
tmpCmdBuf[1] = 1;
|
||||
tmpCmdBuf[2] = 1;
|
||||
uint16_t userDataLen = 0;
|
||||
tmpCmdBuf[3] = (userDataLen >> 8) & 0xff;
|
||||
tmpCmdBuf[4] = userDataLen & 0xff;
|
||||
uint16_t crc = CRC::crc16ccitt(tmpCmdBuf.data(), 5);
|
||||
tmpCmdBuf[5] = (crc >> 8) & 0xff;
|
||||
tmpCmdBuf[6] = crc & 0xff;
|
||||
|
||||
size_t encodedLen = 0;
|
||||
ReturnValue_t result =
|
||||
dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), cmdBuf.size(), &encodedLen, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl;
|
||||
sif::info << "UartTestClass::scexInit: Sending ping command to SCEX" << std::endl;
|
||||
int result = prepareScexPing();
|
||||
if (result != 0) {
|
||||
return;
|
||||
}
|
||||
arrayprinter::print(cmdBuf.data(), 9);
|
||||
};
|
||||
size_t bytesWritten = write(serialPort, cmdBuf.data(), encodedLen);
|
||||
|
||||
if (bytesWritten != encodedLen) {
|
||||
sif::warning << "Sending ping command to solar experiment failed" << std::endl;
|
||||
}
|
||||
|
||||
TaskFactory::delayTask(20);
|
||||
bytesWritten = write(serialPort, cmdBuf.data(), encodedLen);
|
||||
if (bytesWritten != encodedLen) {
|
||||
sif::warning << "Sending ping command to solar experiment failed" << std::endl;
|
||||
}
|
||||
@ -210,12 +187,35 @@ void UartTestClass::scexPeriodic() {
|
||||
<< ", " << strerror(errno) << "]" << std::endl;
|
||||
break;
|
||||
} else if (bytesRead >= static_cast<int>(recBuf.size())) {
|
||||
sif::debug << "UartTestClass::performPeriodicAction: "
|
||||
"recv buffer might not be large enough"
|
||||
sif::debug << "UartTestClass::performPeriodicAction: recv buffer might not be large enough"
|
||||
<< std::endl;
|
||||
} else if (bytesRead > 0) {
|
||||
sif::info << "Received " << bytesRead << " from the Solar Cell Experiment:" << std::endl;
|
||||
arrayprinter::print(recBuf.data(), bytesRead);
|
||||
sif::info << "Received " << bytesRead
|
||||
<< " bytes from the Solar Cell Experiment:" << std::endl;
|
||||
arrayprinter::print(recBuf.data(), bytesRead, OutputType::HEX, false);
|
||||
}
|
||||
} while (bytesRead > 0);
|
||||
}
|
||||
|
||||
int UartTestClass::prepareScexPing() {
|
||||
std::array<uint8_t, 128> tmpCmdBuf = {};
|
||||
// Send ping command
|
||||
tmpCmdBuf[0] = scex::CMD_PING;
|
||||
// These two fields are the packet counter and the total packet count. Those are 1 and 1 for each
|
||||
// telecommand so far
|
||||
tmpCmdBuf[1] = 1;
|
||||
tmpCmdBuf[2] = 1;
|
||||
uint16_t userDataLen = 0;
|
||||
tmpCmdBuf[3] = (userDataLen >> 8) & 0xff;
|
||||
tmpCmdBuf[4] = userDataLen & 0xff;
|
||||
uint16_t crc = CRC::crc16ccitt(tmpCmdBuf.data(), 5);
|
||||
tmpCmdBuf[5] = (crc >> 8) & 0xff;
|
||||
tmpCmdBuf[6] = crc & 0xff;
|
||||
ReturnValue_t result =
|
||||
dleEncoder.encode(tmpCmdBuf.data(), 7, cmdBuf.data(), cmdBuf.size(), &encodedLen, true);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "UartTestClass::scexInit: Encoding failed" << std::endl;
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef LINUX_BOARDTEST_UARTTESTCLASS_H_
|
||||
#define LINUX_BOARDTEST_UARTTESTCLASS_H_
|
||||
|
||||
#include <fsfw/globalfunctions/DleEncoder.h>
|
||||
#include <termios.h> // Contains POSIX terminal control definitions
|
||||
|
||||
#include <array>
|
||||
@ -28,7 +29,10 @@ class UartTestClass : public TestTask {
|
||||
|
||||
void scexInit();
|
||||
void scexPeriodic();
|
||||
int prepareScexPing();
|
||||
TestModes mode = TestModes::GPS;
|
||||
DleEncoder dleEncoder = DleEncoder();
|
||||
size_t encodedLen = 0;
|
||||
lwgps_t gpsData = {};
|
||||
struct termios tty = {};
|
||||
int serialPort = 0;
|
||||
|
@ -1,4 +1,7 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
SolarArrayDeploymentHandler.cpp
|
||||
SusHandler.cpp
|
||||
)
|
||||
if(EIVE_BUILD_GPSD_GPS_HANDLER)
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
GPSHyperionLinuxController.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
add_subdirectory(startracker)
|
||||
|
@ -1,8 +1,5 @@
|
||||
#include "GPSHyperionLinuxController.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "devicedefinitions/GPSDefinitions.h"
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
#include "fsfw/timemanager/Clock.h"
|
||||
|
||||
@ -10,6 +7,7 @@
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#endif
|
||||
#include <cmath>
|
||||
|
||||
GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, object_id_t parentId,
|
||||
bool debugHyperionGps)
|
@ -1,10 +1,10 @@
|
||||
#ifndef MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
#define MISSION_DEVICES_GPSHYPERIONHANDLER_H_
|
||||
|
||||
#include "devicedefinitions/GPSDefinitions.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/controller/ExtendedControllerBase.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "mission/devices/devicedefinitions/GPSDefinitions.h"
|
||||
|
||||
#ifdef FSFW_OSAL_LINUX
|
||||
#include <gps.h>
|
@ -1,214 +0,0 @@
|
||||
#include "SusHandler.h"
|
||||
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
SusHandler::SusHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
LinuxLibgpioIF *gpioComIF, gpioId_t chipSelectId)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie),
|
||||
gpioComIF(gpioComIF),
|
||||
chipSelectId(chipSelectId),
|
||||
dataset(this) {
|
||||
if (comCookie == NULL) {
|
||||
sif::error << "SusHandler: Invalid com cookie" << std::endl;
|
||||
}
|
||||
if (gpioComIF == NULL) {
|
||||
sif::error << "SusHandler: Invalid GpioComIF" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
SusHandler::~SusHandler() {}
|
||||
|
||||
ReturnValue_t SusHandler::performOperation(uint8_t counter) {
|
||||
if (counter != FIRST_WRITE) {
|
||||
DeviceHandlerBase::performOperation(counter);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
if (mode != MODE_NORMAL) {
|
||||
DeviceHandlerBase::performOperation(DeviceHandlerIF::SEND_WRITE);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
/* If device is in normale mode the communication sequence is initiated here */
|
||||
if (communicationStep == CommunicationStep::IDLE) {
|
||||
communicationStep = CommunicationStep::WRITE_SETUP;
|
||||
}
|
||||
|
||||
DeviceHandlerBase::performOperation(DeviceHandlerIF::SEND_WRITE);
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::initialize() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = DeviceHandlerBase::initialize();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
auto spiComIF = dynamic_cast<SpiComIF *>(communicationInterface);
|
||||
if (spiComIF == nullptr) {
|
||||
sif::debug << "SusHandler::initialize: Invalid communication interface" << std::endl;
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
spiMutex = spiComIF->getMutex();
|
||||
if (spiMutex == nullptr) {
|
||||
sif::debug << "SusHandler::initialize: Failed to get spi mutex" << std::endl;
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void SusHandler::doStartUp() {
|
||||
#if OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP == 1
|
||||
setMode(MODE_NORMAL);
|
||||
#else
|
||||
setMode(_MODE_TO_ON);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SusHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
||||
|
||||
ReturnValue_t SusHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||
if (communicationStep == CommunicationStep::IDLE) {
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
|
||||
if (communicationStep == CommunicationStep::WRITE_SETUP) {
|
||||
*id = SUS::WRITE_SETUP;
|
||||
communicationStep = CommunicationStep::START_CONVERSIONS;
|
||||
} else if (communicationStep == CommunicationStep::START_CONVERSIONS) {
|
||||
*id = SUS::START_CONVERSIONS;
|
||||
communicationStep = CommunicationStep::READ_CONVERSIONS;
|
||||
} else if (communicationStep == CommunicationStep::READ_CONVERSIONS) {
|
||||
*id = SUS::READ_CONVERSIONS;
|
||||
communicationStep = CommunicationStep::IDLE;
|
||||
}
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||
const uint8_t *commandData,
|
||||
size_t commandDataLen) {
|
||||
switch (deviceCommand) {
|
||||
case (SUS::WRITE_SETUP): {
|
||||
/**
|
||||
* The sun sensor ADC is shutdown when CS is pulled high, so each time requesting a
|
||||
* measurement the setup has to be rewritten. There must also be a little delay between
|
||||
* the transmission of the setup byte and the first conversion. Thus the conversion
|
||||
* will be performed in an extra step.
|
||||
* Because the chip select is driven manually by the SusHandler the SPI bus must be
|
||||
* protected with a mutex here.
|
||||
*/
|
||||
ReturnValue_t result = spiMutex->lockMutex(timeoutType, timeoutMs);
|
||||
if (result == MutexIF::MUTEX_TIMEOUT) {
|
||||
sif::error << "SusHandler::buildCommandFromCommand: Mutex timeout" << std::endl;
|
||||
return ERROR_LOCK_MUTEX;
|
||||
} else if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "SusHandler::buildCommandFromCommand: Failed to lock spi mutex" << std::endl;
|
||||
return ERROR_LOCK_MUTEX;
|
||||
}
|
||||
|
||||
gpioComIF->pullLow(chipSelectId);
|
||||
cmdBuffer[0] = SUS::SETUP;
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = 1;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SUS::START_CONVERSIONS): {
|
||||
std::memset(cmdBuffer, 0, sizeof(cmdBuffer));
|
||||
cmdBuffer[0] = SUS::CONVERSION;
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = 2;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SUS::READ_CONVERSIONS): {
|
||||
std::memset(cmdBuffer, 0, sizeof(cmdBuffer));
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = SUS::SIZE_READ_CONVERSIONS;
|
||||
return RETURN_OK;
|
||||
}
|
||||
default:
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
|
||||
void SusHandler::fillCommandAndReplyMap() {
|
||||
this->insertInCommandMap(SUS::WRITE_SETUP);
|
||||
this->insertInCommandMap(SUS::START_CONVERSIONS);
|
||||
this->insertInCommandAndReplyMap(SUS::READ_CONVERSIONS, 1, &dataset, SUS::SIZE_READ_CONVERSIONS);
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::scanForReply(const uint8_t *start, size_t remainingSize,
|
||||
DeviceCommandId_t *foundId, size_t *foundLen) {
|
||||
*foundId = this->getPendingCommand();
|
||||
*foundLen = remainingSize;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||
switch (id) {
|
||||
case SUS::READ_CONVERSIONS: {
|
||||
PoolReadGuard readSet(&dataset);
|
||||
dataset.temperatureCelcius = (*(packet) << 8 | *(packet + 1)) * 0.125;
|
||||
dataset.ain0 = (*(packet + 2) << 8 | *(packet + 3));
|
||||
dataset.ain1 = (*(packet + 4) << 8 | *(packet + 5));
|
||||
dataset.ain2 = (*(packet + 6) << 8 | *(packet + 7));
|
||||
dataset.ain3 = (*(packet + 8) << 8 | *(packet + 9));
|
||||
dataset.ain4 = (*(packet + 10) << 8 | *(packet + 11));
|
||||
dataset.ain5 = (*(packet + 12) << 8 | *(packet + 13));
|
||||
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SUS
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId()
|
||||
<< ", Temperature: " << dataset.temperatureCelcius << " °C" << std::endl;
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN0: " << std::dec
|
||||
<< dataset.ain0 << std::endl;
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN1: " << std::dec
|
||||
<< dataset.ain1 << std::endl;
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN2: " << std::dec
|
||||
<< dataset.ain2 << std::endl;
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN3: " << std::dec
|
||||
<< dataset.ain3 << std::endl;
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN4: " << std::dec
|
||||
<< dataset.ain4 << std::endl;
|
||||
sif::info << "SUS object id 0x" << std::hex << this->getObjectId() << ", AIN5: " << std::dec
|
||||
<< dataset.ain5 << std::endl;
|
||||
#endif
|
||||
/** SUS can now be shutdown and thus the SPI bus released again */
|
||||
gpioComIF->pullHigh(chipSelectId);
|
||||
ReturnValue_t result = spiMutex->unlockMutex();
|
||||
if (result != RETURN_OK) {
|
||||
sif::error << "SusHandler::interpretDeviceReply: Failed to unlock spi mutex" << std::endl;
|
||||
return ERROR_UNLOCK_MUTEX;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
sif::debug << "SusHandler::interpretDeviceReply: Unknown reply id" << std::endl;
|
||||
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void SusHandler::setNormalDatapoolEntriesInvalid() {}
|
||||
|
||||
uint32_t SusHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 1000; }
|
||||
|
||||
ReturnValue_t SusHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
localDataPoolMap.emplace(SUS::TEMPERATURE_C, new PoolEntry<float>({0.0}));
|
||||
localDataPoolMap.emplace(SUS::AIN0, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(SUS::AIN1, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(SUS::AIN2, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(SUS::AIN3, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(SUS::AIN4, new PoolEntry<uint16_t>({0}));
|
||||
localDataPoolMap.emplace(SUS::AIN5, new PoolEntry<uint16_t>({0}));
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@ ArcsecDatalinkLayer::~ArcsecDatalinkLayer() {}
|
||||
|
||||
void ArcsecDatalinkLayer::slipInit() {
|
||||
slipInfo.buffer = rxBuffer;
|
||||
slipInfo.maxlength = StarTracker::MAX_FRAME_SIZE;
|
||||
slipInfo.maxlength = startracker::MAX_FRAME_SIZE;
|
||||
slipInfo.length = 0;
|
||||
slipInfo.unescape_next = 0;
|
||||
slipInfo.prev_state = SLIP_COMPLETE;
|
@ -1,8 +1,8 @@
|
||||
#ifndef BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_
|
||||
#define BSP_Q7S_DEVICES_ARCSECDATALINKLAYER_H_
|
||||
|
||||
#include "StarTrackerDefinitions.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||
|
||||
extern "C" {
|
||||
#include "common/misc.h"
|
||||
@ -79,12 +79,12 @@ class ArcsecDatalinkLayer : public HasReturnvaluesIF {
|
||||
static const uint8_t STATUS_OFFSET = 2;
|
||||
|
||||
// Used by arcsec slip decoding function process received data
|
||||
uint8_t rxBuffer[StarTracker::MAX_FRAME_SIZE];
|
||||
uint8_t rxBuffer[startracker::MAX_FRAME_SIZE];
|
||||
// Decoded frame will be copied to this buffer
|
||||
uint8_t decodedFrame[StarTracker::MAX_FRAME_SIZE];
|
||||
uint8_t decodedFrame[startracker::MAX_FRAME_SIZE];
|
||||
// Buffer where encoded frames will be stored. First byte of encoded frame represents type of
|
||||
// reply
|
||||
uint8_t encBuffer[StarTracker::MAX_FRAME_SIZE * 2 + 2];
|
||||
uint8_t encBuffer[startracker::MAX_FRAME_SIZE * 2 + 2];
|
||||
// Size of decoded frame
|
||||
uint32_t decFrameSize = 0;
|
||||
// Size of encoded frame
|
@ -28,6 +28,13 @@ static const char qx[] = "qx";
|
||||
static const char qy[] = "qy";
|
||||
static const char qz[] = "qz";
|
||||
|
||||
static const char IMAGE_PROCESSOR[] = "imageprocessor";
|
||||
static const char IMAGE_PROCESSOR_MODE[] = "mode";
|
||||
static const char STORE[] = "store";
|
||||
static const char SIGNAL_THRESHOLD[] = "signalThreshold";
|
||||
static const char IMAGE_PROCESSOR_DARK_THRESHOLD[] = "darkThreshold";
|
||||
static const char BACKGROUND_COMPENSATION[] = "backgroundcompensation";
|
||||
|
||||
static const char CAMERA[] = "camera";
|
||||
static const char MODE[] = "mode";
|
||||
static const char FOCALLENGTH[] = "focallength";
|
||||
@ -53,7 +60,6 @@ static const char VAL_7[] = "val7";
|
||||
static const char REG_8[] = "reg8";
|
||||
static const char VAL_8[] = "val8";
|
||||
static const char FREQ_1[] = "freq1";
|
||||
static const char FREQ_2[] = "freq2";
|
||||
|
||||
static const char BLOB[] = "blob";
|
||||
static const char MIN_VALUE[] = "minValue";
|
||||
@ -65,8 +71,8 @@ static const char MAX_TOTAL_VALUE[] = "maxTotalValue";
|
||||
static const char MIN_BRIGHT_NEIGHBOURS[] = "minBrightNeighbours";
|
||||
static const char MAX_BRIGHT_NEIGHBOURS[] = "maxBrightNeighbours";
|
||||
static const char MAX_PIXEL_TO_CONSIDER[] = "maxPixelsToConsider";
|
||||
static const char SIGNAL_THRESHOLD[] = "signalThreshold";
|
||||
static const char DARK_THRESHOLD[] = "darkThreshold";
|
||||
// static const char SIGNAL_THRESHOLD[] = "signalThreshold";
|
||||
static const char BLOB_DARK_THRESHOLD[] = "darkThreshold";
|
||||
static const char ENABLE_HISTOGRAM[] = "enableHistogram";
|
||||
static const char ENABLE_CONTRAST[] = "enableContrast";
|
||||
static const char BIN_MODE[] = "binMode";
|
||||
@ -74,6 +80,7 @@ static const char BIN_MODE[] = "binMode";
|
||||
static const char CENTROIDING[] = "centroiding";
|
||||
static const char ENABLE_FILTER[] = "enableFilter";
|
||||
static const char MAX_QUALITY[] = "maxquality";
|
||||
static const char DARK_THRESHOLD[] = "darkthreshold";
|
||||
static const char MIN_QUALITY[] = "minquality";
|
||||
static const char MAX_INTENSITY[] = "maxintensity";
|
||||
static const char MIN_INTENSITY[] = "minintensity";
|
||||
@ -86,6 +93,7 @@ static const char TRANSMATRIX_10[] = "transmatrix10";
|
||||
static const char TRANSMATRIX_11[] = "transmatrix11";
|
||||
|
||||
static const char LISA[] = "lisa";
|
||||
static const char LISA_MODE[] = "mode";
|
||||
static const char PREFILTER_DIST_THRESHOLD[] = "prefilterDistThreshold";
|
||||
static const char PREFILTER_ANGLE_THRESHOLD[] = "prefilterAngleThreshold";
|
||||
static const char FOV_WIDTH[] = "fov_width";
|
||||
@ -118,9 +126,56 @@ static const char TRACKER_CHOICE[] = "trackerChoice";
|
||||
|
||||
static const char ALGO[] = "algo";
|
||||
static const char L2T_MIN_CONFIDENCE[] = "l2t_minConfidence";
|
||||
static const char L2T_MIN_MATCHED[] = "l2t_minConfidence";
|
||||
static const char L2T_MIN_MATCHED[] = "l2t_minMatched";
|
||||
static const char T2L_MIN_CONFIDENCE[] = "t2l_minConfidence";
|
||||
static const char T2L_MIN_MATCHED[] = "t2l_minMatched";
|
||||
|
||||
static const char LOGLEVEL[] = "loglevel";
|
||||
static const char LOGLEVEL1[] = "loglevel1";
|
||||
static const char LOGLEVEL2[] = "loglevel2";
|
||||
static const char LOGLEVEL3[] = "loglevel3";
|
||||
static const char LOGLEVEL4[] = "loglevel4";
|
||||
static const char LOGLEVEL5[] = "loglevel5";
|
||||
static const char LOGLEVEL6[] = "loglevel6";
|
||||
static const char LOGLEVEL7[] = "loglevel7";
|
||||
static const char LOGLEVEL8[] = "loglevel8";
|
||||
static const char LOGLEVEL9[] = "loglevel9";
|
||||
static const char LOGLEVEL10[] = "loglevel10";
|
||||
static const char LOGLEVEL11[] = "loglevel11";
|
||||
static const char LOGLEVEL12[] = "loglevel12";
|
||||
static const char LOGLEVEL13[] = "loglevel13";
|
||||
static const char LOGLEVEL14[] = "loglevel14";
|
||||
static const char LOGLEVEL15[] = "loglevel15";
|
||||
static const char LOGLEVEL16[] = "loglevel16";
|
||||
|
||||
static const char SUBSCRIPTION[] = "subscription";
|
||||
static const char TELEMETRY_1[] = "telemetry1";
|
||||
static const char TELEMETRY_2[] = "telemetry2";
|
||||
static const char TELEMETRY_3[] = "telemetry3";
|
||||
static const char TELEMETRY_4[] = "telemetry4";
|
||||
static const char TELEMETRY_5[] = "telemetry5";
|
||||
static const char TELEMETRY_6[] = "telemetry6";
|
||||
static const char TELEMETRY_7[] = "telemetry7";
|
||||
static const char TELEMETRY_8[] = "telemetry8";
|
||||
static const char TELEMETRY_9[] = "telemetry9";
|
||||
static const char TELEMETRY_10[] = "telemetry10";
|
||||
static const char TELEMETRY_11[] = "telemetry11";
|
||||
static const char TELEMETRY_12[] = "telemetry12";
|
||||
static const char TELEMETRY_13[] = "telemetry13";
|
||||
static const char TELEMETRY_14[] = "telemetry14";
|
||||
static const char TELEMETRY_15[] = "telemetry15";
|
||||
static const char TELEMETRY_16[] = "telemetry16";
|
||||
|
||||
static const char LOG_SUBSCRIPTION[] = "logsubscription";
|
||||
static const char LEVEL1[] = "level1";
|
||||
static const char MODULE1[] = "module1";
|
||||
static const char LEVEL2[] = "level2";
|
||||
static const char MODULE2[] = "module2";
|
||||
|
||||
static const char DEBUG_CAMERA[] = "debugcamera";
|
||||
static const char TIMING[] = "timing";
|
||||
static const char TEST[] = "test";
|
||||
|
||||
} // namespace arcseckeys
|
||||
|
||||
#endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_ARCSECJSONKEYS_H_ */
|
@ -8,9 +8,15 @@ ReturnValue_t ArcsecJsonParamBase::create(std::string fullname, uint8_t* buffer)
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = init(fullname);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "ArcsecJsonParamBase::create: Failed to init parameter command for set "
|
||||
<< setName << std::endl;
|
||||
return result;
|
||||
}
|
||||
result = createCommand(buffer);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "ArcsecJsonParamBase::create: Failed to create parameter command for set "
|
||||
<< setName << std::endl;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -91,5 +97,7 @@ ReturnValue_t ArcsecJsonParamBase::initSet() {
|
||||
return RETURN_OK;
|
||||
}
|
||||
}
|
||||
sif::warning << "ArcsecJsonParamBase::initSet: Set " << setName << "not present in json file"
|
||||
<< std::endl;
|
||||
return SET_NOT_EXISTS;
|
||||
}
|
@ -5,8 +5,8 @@
|
||||
#include <fstream>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "StarTrackerDefinitions.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||
|
||||
extern "C" {
|
||||
#include "thirdparty/arcsec_star_tracker/common/generated/tmtcstructs.h"
|
2074
linux/devices/startracker/StarTrackerHandler.cpp
Normal file
2074
linux/devices/startracker/StarTrackerHandler.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,11 +5,12 @@
|
||||
|
||||
#include "ArcsecDatalinkLayer.h"
|
||||
#include "ArcsecJsonParamBase.h"
|
||||
#include "StarTrackerDefinitions.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "StrHelper.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
|
||||
#include "fsfw/timemanager/Countdown.h"
|
||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||
#include "thirdparty/arcsec_star_tracker/common/SLIP.h"
|
||||
|
||||
/**
|
||||
@ -47,6 +48,11 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
|
||||
void performOperationHook() override;
|
||||
|
||||
Submode_t getInitialSubmode() override;
|
||||
|
||||
static const Submode_t SUBMODE_BOOTLOADER = 1;
|
||||
static const Submode_t SUBMODE_FIRMWARE = 2;
|
||||
|
||||
protected:
|
||||
void doStartUp() override;
|
||||
void doShutDown() override;
|
||||
@ -56,6 +62,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
void fillCommandAndReplyMap() override;
|
||||
ReturnValue_t buildCommandFromCommand(DeviceCommandId_t deviceCommand, const uint8_t* commandData,
|
||||
size_t commandDataLen) override;
|
||||
ReturnValue_t isModeCombinationValid(Mode_t mode, Submode_t submode) override;
|
||||
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
|
||||
size_t* foundLen) override;
|
||||
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
|
||||
@ -68,78 +75,76 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
*/
|
||||
virtual size_t getNextReplyLength(DeviceCommandId_t deviceCommand) override;
|
||||
virtual ReturnValue_t doSendReadHook() override;
|
||||
virtual void doTransition(Mode_t modeFrom, Submode_t subModeFrom) override;
|
||||
|
||||
private:
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::STR_HANDLER;
|
||||
|
||||
//! [EXPORT] : [COMMENT] Received reply is too short
|
||||
static const ReturnValue_t REPLY_TOO_SHORT = MAKE_RETURN_CODE(0xB0);
|
||||
//! [EXPORT] : [COMMENT] Received reply with invalid CRC
|
||||
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xB1);
|
||||
//! [EXPORT] : [COMMENT] Image loader executing
|
||||
static const ReturnValue_t IMAGE_LOADER_EXECUTING = MAKE_RETURN_CODE(0xB2);
|
||||
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HANDLER;
|
||||
|
||||
//! [EXPORT] : [COMMENT] Status in temperature reply signals error
|
||||
static const ReturnValue_t TEMPERATURE_REQ_FAILED = MAKE_RETURN_CODE(0xA0);
|
||||
//! [EXPORT] : [COMMENT] Ping command failed
|
||||
static const ReturnValue_t PING_FAILED = MAKE_RETURN_CODE(0xA1);
|
||||
//! [EXPORT] : [COMMENT] Status in version reply signals error
|
||||
static const ReturnValue_t VERSION_REQ_FAILED = MAKE_RETURN_CODE(0xA3);
|
||||
static const ReturnValue_t VERSION_REQ_FAILED = MAKE_RETURN_CODE(0xA2);
|
||||
//! [EXPORT] : [COMMENT] Status in interface reply signals error
|
||||
static const ReturnValue_t INTERFACE_REQ_FAILED = MAKE_RETURN_CODE(0xA4);
|
||||
static const ReturnValue_t INTERFACE_REQ_FAILED = MAKE_RETURN_CODE(0xA3);
|
||||
//! [EXPORT] : [COMMENT] Status in power reply signals error
|
||||
static const ReturnValue_t POWER_REQ_FAILED = MAKE_RETURN_CODE(0xA5);
|
||||
static const ReturnValue_t POWER_REQ_FAILED = MAKE_RETURN_CODE(0xA4);
|
||||
//! [EXPORT] : [COMMENT] Status of reply to parameter set command signals error
|
||||
static const ReturnValue_t SET_PARAM_FAILED = MAKE_RETURN_CODE(0xA6);
|
||||
static const ReturnValue_t SET_PARAM_FAILED = MAKE_RETURN_CODE(0xA5);
|
||||
//! [EXPORT] : [COMMENT] Status of reply to action command signals error
|
||||
static const ReturnValue_t ACTION_FAILED = MAKE_RETURN_CODE(0xA7);
|
||||
//! [EXPORT] : [COMMENT] Received upload image command with invalid length
|
||||
static const ReturnValue_t UPLOAD_TOO_SHORT = MAKE_RETURN_CODE(0xA8);
|
||||
//! [EXPORT] : [COMMENT] Received upload image command with invalid position field
|
||||
static const ReturnValue_t UPLOAD_INVALID_POSITION = MAKE_RETURN_CODE(0xA8);
|
||||
//! [EXPORT] : [COMMENT] Position value in upload image reply not matching sent position
|
||||
static const ReturnValue_t UPLOAD_IMAGE_FAILED = MAKE_RETURN_CODE(0xA9);
|
||||
//! [EXPORT] : [COMMENT] Received upload image command with invalid length
|
||||
static const ReturnValue_t INVALID_UPLOAD_COMMAND = MAKE_RETURN_CODE(0xAA);
|
||||
static const ReturnValue_t ACTION_FAILED = MAKE_RETURN_CODE(0xA6);
|
||||
//! [EXPORT] : [COMMENT] Received invalid path string. Exceeds allowed length
|
||||
static const ReturnValue_t FILE_PATH_TOO_LONG = MAKE_RETURN_CODE(0xAB);
|
||||
static const ReturnValue_t FILE_PATH_TOO_LONG = MAKE_RETURN_CODE(0xA7);
|
||||
//! [EXPORT] : [COMMENT] Name of file received with command is too long
|
||||
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xAC);
|
||||
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xA8);
|
||||
//! [EXPORT] : [COMMENT] Received version reply with invalid program ID
|
||||
static const ReturnValue_t INVALID_PROGRAM = MAKE_RETURN_CODE(0xAD);
|
||||
static const ReturnValue_t INVALID_PROGRAM = MAKE_RETURN_CODE(0xA9);
|
||||
//! [EXPORT] : [COMMENT] Status field reply signals error
|
||||
static const ReturnValue_t REPLY_ERROR = MAKE_RETURN_CODE(0xAE);
|
||||
//! [EXPORT] : [COMMENT] Status field of contrast reply signals error
|
||||
static const ReturnValue_t CONTRAST_REQ_FAILED = MAKE_RETURN_CODE(0xAE);
|
||||
static const ReturnValue_t REPLY_ERROR = MAKE_RETURN_CODE(0xAA);
|
||||
//! [EXPORT] : [COMMENT] Received command which is too short (some data is missing for proper
|
||||
//! execution)
|
||||
static const ReturnValue_t COMMAND_TOO_SHORT = MAKE_RETURN_CODE(0xAF);
|
||||
static const ReturnValue_t COMMAND_TOO_SHORT = MAKE_RETURN_CODE(0xAB);
|
||||
//! [EXPORT] : [COMMENT] Received command with invalid length (too few or too many parameters)
|
||||
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xB0);
|
||||
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xAC);
|
||||
//! [EXPORT] : [COMMENT] Region mismatch between send and received data
|
||||
static const ReturnValue_t REGION_MISMATCH = MAKE_RETURN_CODE(0xB1);
|
||||
static const ReturnValue_t REGION_MISMATCH = MAKE_RETURN_CODE(0xAD);
|
||||
//! [EXPORT] : [COMMENT] Address mismatch between send and received data
|
||||
static const ReturnValue_t ADDRESS_MISMATCH = MAKE_RETURN_CODE(0xB2);
|
||||
static const ReturnValue_t ADDRESS_MISMATCH = MAKE_RETURN_CODE(0xAE);
|
||||
//! [EXPORT] : [COMMENT] Length field mismatch between send and received data
|
||||
static const ReturnValue_t lENGTH_MISMATCH = MAKE_RETURN_CODE(0xB3);
|
||||
static const ReturnValue_t lENGTH_MISMATCH = MAKE_RETURN_CODE(0xAF);
|
||||
//! [EXPORT] : [COMMENT] Specified file does not exist
|
||||
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xB4);
|
||||
//! [EXPORT] : [COMMENT] Reply to upload centroid does not match commanded centroid id
|
||||
static const ReturnValue_t UPLOAD_CENTROID_ID_MISMATCH = MAKE_RETURN_CODE(0xB5);
|
||||
static const ReturnValue_t FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xB0);
|
||||
//! [EXPORT] : [COMMENT] Download blob pixel command has invalid type field
|
||||
static const ReturnValue_t INVALID_TYPE = MAKE_RETURN_CODE(0xB6);
|
||||
static const ReturnValue_t INVALID_TYPE = MAKE_RETURN_CODE(0xB1);
|
||||
//! [EXPORT] : [COMMENT] Received FPGA action command with invalid ID
|
||||
static const ReturnValue_t INVALID_ID = MAKE_RETURN_CODE(0xB7);
|
||||
static const ReturnValue_t INVALID_ID = MAKE_RETURN_CODE(0xB2);
|
||||
//! [EXPORT] : [COMMENT] Received reply is too short
|
||||
static const ReturnValue_t REPLY_TOO_SHORT = MAKE_RETURN_CODE(0xB3);
|
||||
//! [EXPORT] : [COMMENT] Received reply with invalid CRC
|
||||
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xB4);
|
||||
//! [EXPORT] : [COMMENT] Star tracker handler currently executing a command and using the
|
||||
//! communication interface
|
||||
static const ReturnValue_t STR_HELPER_EXECUTING = MAKE_RETURN_CODE(0xB5);
|
||||
//! [EXPORT] : [COMMENT] Star tracker is already in firmware mode
|
||||
static const ReturnValue_t STARTRACKER_ALREADY_BOOTED = MAKE_RETURN_CODE(0xB6);
|
||||
//! [EXPORT] : [COMMENT] Star tracker is in firmware mode but must be in bootloader mode to
|
||||
//! execute this command
|
||||
static const ReturnValue_t STARTRACKER_RUNNING_FIRMWARE = MAKE_RETURN_CODE(0xB7);
|
||||
//! [EXPORT] : [COMMENT] Star tracker is in bootloader mode but must be in firmware mode to
|
||||
//! execute this command
|
||||
static const ReturnValue_t STARTRACKER_RUNNING_BOOTLOADER = MAKE_RETURN_CODE(0xB8);
|
||||
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::STR_HANDLER;
|
||||
|
||||
//! [EXPORT] : [COMMENT] Failed to boot firmware
|
||||
static const Event BOOTING_FIRMWARE_FAILED = MAKE_EVENT(1, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Failed to boot star tracker into bootloader mode
|
||||
static const Event BOOTING_BOOTLOADER_FAILED = MAKE_EVENT(2, severity::LOW);
|
||||
|
||||
static const size_t MAX_PATH_SIZE = 50;
|
||||
static const size_t MAX_FILE_NAME = 30;
|
||||
|
||||
// position (uint32) + 1024 image data
|
||||
static const size_t UPLOAD_COMMAND_LEN = 1028;
|
||||
// Max valid position value in upload image command
|
||||
static const uint16_t MAX_POSITION = 4095;
|
||||
static const uint8_t STATUS_OFFSET = 1;
|
||||
static const uint8_t PARAMS_OFFSET = 1;
|
||||
static const uint8_t TICKS_OFFSET = 2;
|
||||
@ -154,37 +159,14 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
static const MutexIF::TimeoutType TIMEOUT_TYPE = MutexIF::TimeoutType::WAITING;
|
||||
static const uint32_t MUTEX_TIMEOUT = 20;
|
||||
static const uint32_t BOOT_TIMEOUT = 1000;
|
||||
static const uint32_t DEFAULT_TRANSITION_DELAY = 15000;
|
||||
|
||||
class WriteCmd {
|
||||
class FlashReadCmd {
|
||||
public:
|
||||
static const uint8_t ADDRESS_OFFSET = 1;
|
||||
static const uint8_t FILE_OFFSET = 5;
|
||||
// Minimum length of a write command (region, address and filename)
|
||||
// Minimum length of a read command (region, length and filename)
|
||||
static const size_t MIN_LENGTH = 7;
|
||||
};
|
||||
|
||||
class ReadCmd {
|
||||
public:
|
||||
static const uint8_t ADDRESS_OFFSET = 1;
|
||||
static const uint8_t LENGTH_OFFSET = 5;
|
||||
static const uint8_t FILE_OFFSET = 9;
|
||||
// Minimum length of a read command (region, address, length and filename)
|
||||
static const size_t MIN_LENGTH = 11;
|
||||
};
|
||||
|
||||
class EraseCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
uint8_t rememberRegion = 0;
|
||||
};
|
||||
|
||||
EraseCmd eraseCmd;
|
||||
|
||||
class UnlockCmd {
|
||||
public:
|
||||
static const uint8_t CODE_OFFSET = 1;
|
||||
};
|
||||
|
||||
class ChecksumCmd {
|
||||
public:
|
||||
static const uint8_t ADDRESS_OFFSET = 1;
|
||||
@ -198,94 +180,69 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
|
||||
ChecksumCmd checksumCmd;
|
||||
|
||||
class SetTimeCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 8;
|
||||
};
|
||||
|
||||
class DownloadCentroidCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
};
|
||||
|
||||
class UploadCentroid {
|
||||
public:
|
||||
uint8_t rememberId = 0;
|
||||
};
|
||||
|
||||
UploadCentroid uploadCentroid;
|
||||
|
||||
class DownloadMatchedStarCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
};
|
||||
|
||||
class DownloadDbImageCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
};
|
||||
|
||||
class DownloadBlobPixCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 2;
|
||||
static const uint8_t NORMAL = 0;
|
||||
static const uint8_t FAST = 1;
|
||||
};
|
||||
|
||||
class FpgaDownloadCmd {
|
||||
public:
|
||||
static const uint8_t MIN_LENGTH = 10;
|
||||
};
|
||||
|
||||
class FpgaActionCmd {
|
||||
public:
|
||||
static const uint8_t LENGTH = 1;
|
||||
static const uint8_t ID = 3;
|
||||
};
|
||||
|
||||
MessageQueueIF* eventQueue = nullptr;
|
||||
|
||||
ArcsecDatalinkLayer dataLinkLayer;
|
||||
|
||||
StarTracker::TemperatureSet temperatureSet;
|
||||
StarTracker::VersionSet versionSet;
|
||||
StarTracker::PowerSet powerSet;
|
||||
StarTracker::InterfaceSet interfaceSet;
|
||||
StarTracker::TimeSet timeSet;
|
||||
StarTracker::SolutionSet solutionSet;
|
||||
StarTracker::HistogramSet histogramSet;
|
||||
StarTracker::ContrastSet contrastSet;
|
||||
StarTracker::ChecksumSet checksumSet;
|
||||
StarTracker::DownloadCentroidSet downloadCentroidSet;
|
||||
StarTracker::DownloadMatchedStar downloadMatchedStar;
|
||||
StarTracker::DownloadDBImage downloadDbImage;
|
||||
StarTracker::DownloadBlobPixel downloadBlobPixel;
|
||||
StarTracker::CameraSet cameraSet;
|
||||
StarTracker::LimitsSet limitsSet;
|
||||
StarTracker::BlobSet blobSet;
|
||||
startracker::TemperatureSet temperatureSet;
|
||||
startracker::VersionSet versionSet;
|
||||
startracker::PowerSet powerSet;
|
||||
startracker::InterfaceSet interfaceSet;
|
||||
startracker::TimeSet timeSet;
|
||||
startracker::SolutionSet solutionSet;
|
||||
startracker::HistogramSet histogramSet;
|
||||
startracker::ChecksumSet checksumSet;
|
||||
startracker::CameraSet cameraSet;
|
||||
startracker::LimitsSet limitsSet;
|
||||
startracker::LogLevelSet loglevelSet;
|
||||
startracker::MountingSet mountingSet;
|
||||
startracker::ImageProcessorSet imageProcessorSet;
|
||||
startracker::CentroidingSet centroidingSet;
|
||||
startracker::LisaSet lisaSet;
|
||||
startracker::MatchingSet matchingSet;
|
||||
startracker::TrackingSet trackingSet;
|
||||
startracker::ValidationSet validationSet;
|
||||
startracker::AlgoSet algoSet;
|
||||
startracker::SubscriptionSet subscriptionSet;
|
||||
startracker::LogSubscriptionSet logSubscriptionSet;
|
||||
startracker::DebugCameraSet debugCameraSet;
|
||||
|
||||
// Pointer to object responsible for uploading and downloading images to/from the star tracker
|
||||
StrHelper* strHelper = nullptr;
|
||||
|
||||
uint8_t commandBuffer[StarTracker::MAX_FRAME_SIZE];
|
||||
uint8_t commandBuffer[startracker::MAX_FRAME_SIZE];
|
||||
|
||||
// Countdown to insert delay for star tracker to switch from bootloader to firmware program
|
||||
// Loading firmware requires some time and the command will not trigger a reply when executed
|
||||
Countdown bootCountdown;
|
||||
|
||||
std::string paramJsonFile = "/mnt/sd0/startracker/full.json";
|
||||
#ifdef EGSE
|
||||
std::string paramJsonFile = "/home/pi/arcsec/json/flight-config.json";
|
||||
#else
|
||||
#if OBSW_STAR_TRACKER_GROUND_CONFIG == 1
|
||||
std::string paramJsonFile = "/mnt/sd0/startracker/ground-config.json";
|
||||
#else
|
||||
std::string paramJsonFile = "/mnt/sd0/startracker/flight-config.json";
|
||||
#endif
|
||||
#endif
|
||||
|
||||
enum class InternalState { TEMPERATURE_REQUEST };
|
||||
enum class NormalState { TEMPERATURE_REQUEST, SOLUTION_REQUEST };
|
||||
|
||||
InternalState internalState = InternalState::TEMPERATURE_REQUEST;
|
||||
NormalState normalState = NormalState::TEMPERATURE_REQUEST;
|
||||
|
||||
enum class StartupState {
|
||||
enum class InternalState {
|
||||
IDLE,
|
||||
CHECK_BOOT_STATE,
|
||||
BOOT,
|
||||
REQ_VERSION,
|
||||
VERIFY_BOOT,
|
||||
STARTUP_CHECK,
|
||||
BOOT_DELAY,
|
||||
FIRMWARE_CHECK,
|
||||
LOGLEVEL,
|
||||
LIMITS,
|
||||
TRACKING,
|
||||
MOUNTING,
|
||||
IMAGE_PROCESSOR,
|
||||
CAMERA,
|
||||
BLOB,
|
||||
CENTROIDING,
|
||||
@ -293,10 +250,20 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
MATCHING,
|
||||
VALIDATION,
|
||||
ALGO,
|
||||
LOG_SUBSCRIPTION,
|
||||
DEBUG_CAMERA,
|
||||
WAIT_FOR_EXECUTION,
|
||||
DONE
|
||||
DONE,
|
||||
FAILED_FIRMWARE_BOOT,
|
||||
BOOT_BOOTLOADER,
|
||||
BOOTLOADER_CHECK,
|
||||
BOOTING_BOOTLOADER_FAILED
|
||||
};
|
||||
|
||||
InternalState internalState = InternalState::IDLE;
|
||||
|
||||
enum class StartupState { IDLE, CHECK_PROGRAM, WAIT_CHECK_PROGRAM, BOOT_BOOTLOADER, DONE };
|
||||
|
||||
StartupState startupState = StartupState::IDLE;
|
||||
|
||||
bool strHelperExecuting = false;
|
||||
@ -338,24 +305,6 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
*/
|
||||
void handleEvent(EventMessage* eventMessage);
|
||||
|
||||
/**
|
||||
* @brief Executes the write command
|
||||
*
|
||||
* @param commandData Pointer to received command data
|
||||
* @param commandDataLen Size of received command data
|
||||
*
|
||||
* @return RETURN_OK if start of execution was successful, otherwise error return value
|
||||
*/
|
||||
ReturnValue_t executeWriteCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Starts the execution of the fpga download command
|
||||
*
|
||||
* @param commandData Pointer to buffer with command data
|
||||
* @param commandDataLen Size of received command
|
||||
*/
|
||||
ReturnValue_t executeFpgaDownloadCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Extracts information for flash-read-command from TC data and starts execution of
|
||||
* flash-read-procedure
|
||||
@ -365,7 +314,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
*
|
||||
* @return RETURN_OK if start of execution was successful, otherwise error return value
|
||||
*/
|
||||
ReturnValue_t executeReadCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t executeFlashReadCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with data to boot image (works only when star tracker is
|
||||
@ -373,36 +322,11 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
*/
|
||||
void prepareBootCommand();
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to erase a flash region
|
||||
*/
|
||||
ReturnValue_t prepareEraseCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to unlock flash region
|
||||
*/
|
||||
ReturnValue_t prepareUnlockCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to get the checksum of a flash part
|
||||
*/
|
||||
ReturnValue_t prepareChecksumCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to set the unix time
|
||||
*/
|
||||
ReturnValue_t prepareSetTimeCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to request a centroid
|
||||
*/
|
||||
ReturnValue_t prepareDownloadCentroidCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to upload a centroid for testing purpose
|
||||
*/
|
||||
ReturnValue_t prepareUploadCentroidCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills the command buffer with the command to take an image.
|
||||
*/
|
||||
@ -426,7 +350,7 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
/**
|
||||
* @brief Fills command buffer with data to reboot star tracker.
|
||||
*/
|
||||
void prepareRebootCommand();
|
||||
void prepareSwitchToBootloaderCmd();
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with data to subscribe to a telemetry packet.
|
||||
@ -451,13 +375,6 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
*/
|
||||
void prepareHistogramRequest();
|
||||
|
||||
void prepareContrastRequest();
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with command to reset the error signal of the star tracker
|
||||
*/
|
||||
void prepareErrorResetRequest();
|
||||
|
||||
/**
|
||||
* @brief Reads parameters from json file specified by string in commandData and
|
||||
* prepares the command to apply the parameter set to the star tracker
|
||||
@ -472,40 +389,23 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
ArcsecJsonParamBase& paramSet);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with data to request matched star.
|
||||
*/
|
||||
ReturnValue_t prepareDownloadMatchedStarCommand(const uint8_t* commandData,
|
||||
size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with data to request matched star coordinates.
|
||||
*/
|
||||
ReturnValue_t prepareDownloadDbImageCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Fills command buffer with data to request output of the blob filter algorithm.
|
||||
*/
|
||||
ReturnValue_t prepareDownloadBlobPixelCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief With this command the FPGA update will be applied to the star tracker
|
||||
*/
|
||||
ReturnValue_t prepareFpgaActionCommand(const uint8_t* commandData, size_t commandDataLen);
|
||||
|
||||
/**
|
||||
* @brief Will fill the command buffer with the command to request the set camera parameters.
|
||||
* @brief The following function will fill the command buffer with the command to request
|
||||
* a parameter set.
|
||||
*/
|
||||
ReturnValue_t prepareRequestCameraParams();
|
||||
|
||||
/**
|
||||
* @brief Will fill the command buffer with the command to request the set limits.
|
||||
*/
|
||||
ReturnValue_t prepareRequestLimitsParams();
|
||||
|
||||
/**
|
||||
* @brief Will fill the command buffer with the command to request the set blob parameters.
|
||||
*/
|
||||
ReturnValue_t prepareRequestBlobParams();
|
||||
ReturnValue_t prepareRequestLogLevelParams();
|
||||
ReturnValue_t prepareRequestMountingParams();
|
||||
ReturnValue_t prepareRequestImageProcessorParams();
|
||||
ReturnValue_t prepareRequestCentroidingParams();
|
||||
ReturnValue_t prepareRequestLisaParams();
|
||||
ReturnValue_t prepareRequestMatchingParams();
|
||||
ReturnValue_t prepareRequestTrackingParams();
|
||||
ReturnValue_t prepareRequestValidationParams();
|
||||
ReturnValue_t prepareRequestAlgoParams();
|
||||
ReturnValue_t prepareRequestSubscriptionParams();
|
||||
ReturnValue_t prepareRequestLogSubscriptionParams();
|
||||
ReturnValue_t prepareRequestDebugCameraParams();
|
||||
|
||||
/**
|
||||
* @brief Handles action replies with datasets.
|
||||
@ -522,11 +422,6 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
*/
|
||||
ReturnValue_t handleUploadCentroidReply();
|
||||
|
||||
/**
|
||||
* @brief Handles reply to erase command
|
||||
*/
|
||||
ReturnValue_t handleEraseReply();
|
||||
|
||||
/**
|
||||
* @brief Handles reply to checksum command
|
||||
*/
|
||||
@ -560,6 +455,20 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
||||
* @return RETURN_OK if successful, otherwise error return value
|
||||
*/
|
||||
ReturnValue_t handleTm(LocalPoolDataSetBase& dataset, size_t size);
|
||||
|
||||
/**
|
||||
* @brief Checks if star tracker is in valid mode for executing the received command.
|
||||
*
|
||||
* @param actioId Id of received command
|
||||
*
|
||||
* @return RETURN_OK if star tracker is in valid mode, otherwise error return value
|
||||
*/
|
||||
ReturnValue_t checkCommand(ActionId_t actionId);
|
||||
|
||||
void doOnTransition(Submode_t subModeFrom);
|
||||
void doNormalTransition(Mode_t modeFrom, Submode_t subModeFrom);
|
||||
void bootFirmware(Mode_t toMode);
|
||||
void bootBootloader();
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_STARTRACKERHANDLER_H_ */
|
@ -10,7 +10,7 @@ ReturnValue_t Limits::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::LIMITS);
|
||||
addSetParamHeader(buffer, startracker::ID::LIMITS);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::ACTION, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -88,7 +88,7 @@ ReturnValue_t Tracking::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::TRACKING);
|
||||
addSetParamHeader(buffer, startracker::ID::TRACKING);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::THIN_LIMIT, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -124,7 +124,7 @@ ReturnValue_t Mounting::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::MOUNTING);
|
||||
addSetParamHeader(buffer, startracker::ID::MOUNTING);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::qw, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -152,6 +152,48 @@ ReturnValue_t Mounting::createCommand(uint8_t* buffer) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ImageProcessor::ImageProcessor() : ArcsecJsonParamBase(arcseckeys::IMAGE_PROCESSOR) {}
|
||||
|
||||
size_t ImageProcessor::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t ImageProcessor::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, startracker::ID::IMAGE_PROCESSOR);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::IMAGE_PROCESSOR_MODE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::STORE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::SIGNAL_THRESHOLD, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint16(param, buffer + offset);
|
||||
offset += sizeof(uint16_t);
|
||||
result = getParam(arcseckeys::IMAGE_PROCESSOR_DARK_THRESHOLD, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint16(param, buffer + offset);
|
||||
offset += sizeof(uint16_t);
|
||||
result = getParam(arcseckeys::BACKGROUND_COMPENSATION, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
Camera::Camera() : ArcsecJsonParamBase(arcseckeys::CAMERA) {}
|
||||
|
||||
size_t Camera::getSize() { return COMMAND_SIZE; }
|
||||
@ -160,7 +202,7 @@ ReturnValue_t Camera::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::CAMERA);
|
||||
addSetParamHeader(buffer, startracker::ID::CAMERA);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::MODE, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -304,116 +346,7 @@ ReturnValue_t Camera::createCommand(uint8_t* buffer) {
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::FREQ_2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
Blob::Blob() : ArcsecJsonParamBase(arcseckeys::BLOB) {}
|
||||
|
||||
size_t Blob::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t Blob::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::BLOB);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::MODE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MIN_VALUE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MIN_DISTANCE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::NEIGHBOUR_DISTANCE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::NEIGHBOUR_BRIGHT_PIXELS, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MIN_TOTAL_VALUE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint16(param, buffer + offset);
|
||||
offset += sizeof(uint16_t);
|
||||
result = getParam(arcseckeys::MAX_TOTAL_VALUE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint16(param, buffer + offset);
|
||||
offset += sizeof(uint16_t);
|
||||
result = getParam(arcseckeys::MIN_BRIGHT_NEIGHBOURS, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint16(param, buffer + offset);
|
||||
offset += sizeof(uint16_t);
|
||||
result = getParam(arcseckeys::MAX_BRIGHT_NEIGHBOURS, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint16(param, buffer + offset);
|
||||
offset += sizeof(uint16_t);
|
||||
result = getParam(arcseckeys::MAX_PIXEL_TO_CONSIDER, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint32(param, buffer + offset);
|
||||
offset += sizeof(uint32_t);
|
||||
result = getParam(arcseckeys::SIGNAL_THRESHOLD, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::DARK_THRESHOLD, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::ENABLE_HISTOGRAM, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::ENABLE_CONTRAST, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::BIN_MODE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
@ -425,7 +358,7 @@ ReturnValue_t Centroiding::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::CENTROIDING);
|
||||
addSetParamHeader(buffer, startracker::ID::CENTROIDING);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::ENABLE_FILTER, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -439,6 +372,12 @@ ReturnValue_t Centroiding::createCommand(uint8_t* buffer) {
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::DARK_THRESHOLD, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::MIN_QUALITY, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -509,8 +448,14 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::LISA);
|
||||
addSetParamHeader(buffer, startracker::ID::LISA);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::LISA_MODE, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint32(param, buffer + offset);
|
||||
offset += sizeof(uint32_t);
|
||||
result = getParam(arcseckeys::PREFILTER_DIST_THRESHOLD, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -559,6 +504,12 @@ ReturnValue_t Lisa::createCommand(uint8_t* buffer) {
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::RATING_WEIGHT_MEAN_SUM, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
addfloat(param, buffer + offset);
|
||||
offset += sizeof(float);
|
||||
result = getParam(arcseckeys::RATING_WEIGHT_DB_STAR_COUNT, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
@ -594,7 +545,7 @@ ReturnValue_t Matching::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::MATCHING);
|
||||
addSetParamHeader(buffer, startracker::ID::MATCHING);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::SQUARED_DISTANCE_LIMIT, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -618,7 +569,7 @@ ReturnValue_t Validation::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::VALIDATION);
|
||||
addSetParamHeader(buffer, startracker::ID::VALIDATION);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::STABLE_COUNT, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -654,7 +605,7 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, StarTracker::ID::ALGO);
|
||||
addSetParamHeader(buffer, startracker::ID::ALGO);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::MODE, param);
|
||||
if (result != RETURN_OK) {
|
||||
@ -687,3 +638,280 @@ ReturnValue_t Algo::createCommand(uint8_t* buffer) {
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
LogLevel::LogLevel() : ArcsecJsonParamBase(arcseckeys::LOGLEVEL) {}
|
||||
|
||||
size_t LogLevel::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t LogLevel::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, startracker::ID::LOG_LEVEL);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::LOGLEVEL1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL3, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL4, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL5, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL6, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL7, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL8, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL9, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL10, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL11, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL12, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL13, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL14, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL15, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LOGLEVEL16, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
Subscription::Subscription() : ArcsecJsonParamBase(arcseckeys::SUBSCRIPTION) {}
|
||||
|
||||
size_t Subscription::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t Subscription::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, startracker::ID::SUBSCRIPTION);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::TELEMETRY_1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_3, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_4, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_5, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_6, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_7, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_8, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_9, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_10, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_11, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_12, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_13, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_14, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_15, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::TELEMETRY_16, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
LogSubscription::LogSubscription() : ArcsecJsonParamBase(arcseckeys::LOG_SUBSCRIPTION) {}
|
||||
|
||||
size_t LogSubscription::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t LogSubscription::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, startracker::ID::LOG_SUBSCRIPTION);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::LEVEL1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MODULE1, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::LEVEL2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
offset += sizeof(uint8_t);
|
||||
result = getParam(arcseckeys::MODULE2, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint8(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
DebugCamera::DebugCamera() : ArcsecJsonParamBase(arcseckeys::DEBUG_CAMERA) {}
|
||||
|
||||
size_t DebugCamera::getSize() { return COMMAND_SIZE; }
|
||||
|
||||
ReturnValue_t DebugCamera::createCommand(uint8_t* buffer) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint8_t offset = 0;
|
||||
std::string param;
|
||||
addSetParamHeader(buffer, startracker::ID::DEBUG_CAMERA);
|
||||
offset = 2;
|
||||
result = getParam(arcseckeys::TIMING, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint32(param, buffer + offset);
|
||||
offset += sizeof(uint32_t);
|
||||
result = getParam(arcseckeys::TEST, param);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
adduint32(param, buffer + offset);
|
||||
return RETURN_OK;
|
||||
}
|
@ -60,6 +60,22 @@ class Mounting : public ArcsecJsonParamBase {
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates the command to configure the image processor
|
||||
*
|
||||
*/
|
||||
class ImageProcessor : public ArcsecJsonParamBase {
|
||||
public:
|
||||
ImageProcessor();
|
||||
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 9;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates the command to set the mounting quaternion
|
||||
*
|
||||
@ -71,23 +87,7 @@ class Camera : public ArcsecJsonParamBase {
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 43;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates the command to configure the blob algorithm
|
||||
*
|
||||
*/
|
||||
class Blob : public ArcsecJsonParamBase {
|
||||
public:
|
||||
Blob();
|
||||
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 24;
|
||||
static const size_t COMMAND_SIZE = 39;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
@ -103,7 +103,7 @@ class Centroiding : public ArcsecJsonParamBase {
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 47;
|
||||
static const size_t COMMAND_SIZE = 51;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
@ -119,7 +119,7 @@ class Lisa : public ArcsecJsonParamBase {
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 48;
|
||||
static const size_t COMMAND_SIZE = 52;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
@ -173,4 +173,68 @@ class Algo : public ArcsecJsonParamBase {
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates command to configure the log level parameters.
|
||||
*
|
||||
*/
|
||||
class LogLevel : public ArcsecJsonParamBase {
|
||||
public:
|
||||
LogLevel();
|
||||
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 18;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates command to set subscription parameters.
|
||||
*
|
||||
*/
|
||||
class Subscription : public ArcsecJsonParamBase {
|
||||
public:
|
||||
Subscription();
|
||||
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 18;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates command to set log subscription parameters.
|
||||
*
|
||||
*/
|
||||
class LogSubscription : public ArcsecJsonParamBase {
|
||||
public:
|
||||
LogSubscription();
|
||||
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 6;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Generates command to set debug camera parameters
|
||||
*
|
||||
*/
|
||||
class DebugCamera : public ArcsecJsonParamBase {
|
||||
public:
|
||||
DebugCamera();
|
||||
|
||||
size_t getSize();
|
||||
|
||||
private:
|
||||
static const size_t COMMAND_SIZE = 10;
|
||||
|
||||
ReturnValue_t createCommand(uint8_t* buffer) override;
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_DEVICES_DEVICEDEFINITIONS_STARTRACKERJSONCOMMANDS_H_ */
|
@ -3,18 +3,24 @@
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/timemanager/Countdown.h"
|
||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||
#include "mission/utility/Timestamp.h"
|
||||
#include "mission/utility/ProgressPrinter.h"
|
||||
|
||||
StrHelper::StrHelper(object_id_t objectId) : SystemObject(objectId) {}
|
||||
|
||||
StrHelper::~StrHelper() {}
|
||||
|
||||
ReturnValue_t StrHelper::initialize() {
|
||||
#ifdef XIPHOS_Q7S
|
||||
sdcMan = SdCardManager::instance();
|
||||
if (sdcMan == nullptr) {
|
||||
sif::warning << "StrHelper::initialize: Invalid SD Card Manager" << std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
#endif
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
@ -47,16 +53,6 @@ ReturnValue_t StrHelper::performOperation(uint8_t operationCode) {
|
||||
internalState = InternalState::IDLE;
|
||||
break;
|
||||
}
|
||||
case InternalState::FLASH_WRITE: {
|
||||
result = performFlashWrite();
|
||||
if (result == RETURN_OK) {
|
||||
triggerEvent(FLASH_WRITE_SUCCESSFUL);
|
||||
} else {
|
||||
triggerEvent(FLASH_WRITE_FAILED);
|
||||
}
|
||||
internalState = InternalState::IDLE;
|
||||
break;
|
||||
}
|
||||
case InternalState::FLASH_READ: {
|
||||
result = performFlashRead();
|
||||
if (result == RETURN_OK) {
|
||||
@ -67,22 +63,12 @@ ReturnValue_t StrHelper::performOperation(uint8_t operationCode) {
|
||||
internalState = InternalState::IDLE;
|
||||
break;
|
||||
}
|
||||
case InternalState::DOWNLOAD_FPGA_IMAGE: {
|
||||
result = performFpgaDownload();
|
||||
case InternalState::FIRMWARE_UPDATE: {
|
||||
result = performFirmwareUpdate();
|
||||
if (result == RETURN_OK) {
|
||||
triggerEvent(FPGA_DOWNLOAD_SUCCESSFUL);
|
||||
triggerEvent(FIRMWARE_UPDATE_SUCCESSFUL);
|
||||
} else {
|
||||
triggerEvent(FPGA_DOWNLOAD_FAILED);
|
||||
}
|
||||
internalState = InternalState::IDLE;
|
||||
break;
|
||||
}
|
||||
case InternalState::UPLOAD_FPGA_IMAGE: {
|
||||
result = performFpgaUpload();
|
||||
if (result == RETURN_OK) {
|
||||
triggerEvent(FPGA_UPLOAD_SUCCESSFUL);
|
||||
} else {
|
||||
triggerEvent(FPGA_UPLOAD_FAILED);
|
||||
triggerEvent(FIRMWARE_UPDATE_FAILED);
|
||||
}
|
||||
internalState = InternalState::IDLE;
|
||||
break;
|
||||
@ -106,10 +92,12 @@ ReturnValue_t StrHelper::setComIF(DeviceCommunicationIF* communicationInterface_
|
||||
void StrHelper::setComCookie(CookieIF* comCookie_) { comCookie = comCookie_; }
|
||||
|
||||
ReturnValue_t StrHelper::startImageUpload(std::string fullname) {
|
||||
#ifdef XIPHOS_Q7S
|
||||
ReturnValue_t result = checkPath(fullname);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
uploadImage.uploadFile = fullname;
|
||||
if (not std::filesystem::exists(fullname)) {
|
||||
return FILE_NOT_EXISTS;
|
||||
@ -121,10 +109,12 @@ ReturnValue_t StrHelper::startImageUpload(std::string fullname) {
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::startImageDownload(std::string path) {
|
||||
#ifdef XIPHOS_Q7S
|
||||
ReturnValue_t result = checkPath(path);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
if (not std::filesystem::exists(path)) {
|
||||
return PATH_NOT_EXISTS;
|
||||
}
|
||||
@ -141,37 +131,37 @@ void StrHelper::setDownloadImageName(std::string filename) { downloadImage.filen
|
||||
|
||||
void StrHelper::setFlashReadFilename(std::string filename) { flashRead.filename = filename; }
|
||||
|
||||
void StrHelper::setDownloadFpgaImage(std::string filename) { fpgaDownload.fileName = filename; }
|
||||
|
||||
ReturnValue_t StrHelper::startFlashWrite(std::string fullname, uint8_t region, uint32_t address) {
|
||||
ReturnValue_t StrHelper::startFirmwareUpdate(std::string fullname) {
|
||||
#ifdef XIPHOS_Q7S
|
||||
ReturnValue_t result = checkPath(fullname);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
flashWrite.fullname = fullname;
|
||||
if (not std::filesystem::exists(flashWrite.fullname)) {
|
||||
return FILE_NOT_EXISTS;
|
||||
}
|
||||
flashWrite.address = address;
|
||||
flashWrite.region = region;
|
||||
internalState = InternalState::FLASH_WRITE;
|
||||
flashWrite.firstRegion = static_cast<uint8_t>(startracker::FirmwareRegions::FIRST);
|
||||
flashWrite.lastRegion = static_cast<uint8_t>(startracker::FirmwareRegions::LAST);
|
||||
internalState = InternalState::FIRMWARE_UPDATE;
|
||||
semaphore.release();
|
||||
terminate = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t region, uint32_t address,
|
||||
uint32_t length) {
|
||||
ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t startRegion, uint32_t length) {
|
||||
#ifdef XIPHOS_Q7S
|
||||
ReturnValue_t result = checkPath(path);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
flashRead.path = path;
|
||||
if (not std::filesystem::exists(flashRead.path)) {
|
||||
return FILE_NOT_EXISTS;
|
||||
}
|
||||
flashRead.address = address;
|
||||
flashRead.region = region;
|
||||
flashRead.startRegion = startRegion;
|
||||
flashRead.size = length;
|
||||
internalState = InternalState::FLASH_READ;
|
||||
semaphore.release();
|
||||
@ -179,39 +169,27 @@ ReturnValue_t StrHelper::startFlashRead(std::string path, uint8_t region, uint32
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::startFpgaDownload(std::string path, uint32_t startPosition,
|
||||
uint32_t length) {
|
||||
fpgaDownload.path = path;
|
||||
fpgaDownload.startPosition = startPosition;
|
||||
fpgaDownload.length = length;
|
||||
internalState = InternalState::DOWNLOAD_FPGA_IMAGE;
|
||||
semaphore.release();
|
||||
terminate = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
void StrHelper::disableTimestamping() { timestamping = false; }
|
||||
|
||||
ReturnValue_t StrHelper::startFpgaUpload(std::string uploadFile) {
|
||||
fpgaUpload.uploadFile = uploadFile;
|
||||
internalState = InternalState::UPLOAD_FPGA_IMAGE;
|
||||
semaphore.release();
|
||||
terminate = false;
|
||||
return RETURN_OK;
|
||||
}
|
||||
void StrHelper::enableTimestamping() { timestamping = true; }
|
||||
|
||||
ReturnValue_t StrHelper::performImageDownload() {
|
||||
ReturnValue_t result;
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
ProgressPrinter progressPrinter("Image download", ImageDownload::LAST_POSITION);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
struct DownloadActionRequest downloadReq;
|
||||
uint32_t size = 0;
|
||||
uint32_t retries = 0;
|
||||
Timestamp timestamp;
|
||||
std::string image = downloadImage.path + "/" + timestamp.str() + downloadImage.filename;
|
||||
std::ofstream file(image, std::ios_base::app | std::ios_base::out);
|
||||
std::string image = makeFullFilename(downloadImage.path, downloadImage.filename);
|
||||
std::ofstream file(image, std::ios_base::out);
|
||||
if (not std::filesystem::exists(image)) {
|
||||
return FILE_CREATION_FAILED;
|
||||
}
|
||||
downloadReq.position = 0;
|
||||
while (downloadReq.position < ImageDownload::LAST_POSITION) {
|
||||
if (terminate) {
|
||||
file.close();
|
||||
return RETURN_OK;
|
||||
}
|
||||
arc_pack_download_action_req(&downloadReq, commandBuffer, &size);
|
||||
@ -246,7 +224,10 @@ ReturnValue_t StrHelper::performImageDownload() {
|
||||
return result;
|
||||
}
|
||||
file.write(reinterpret_cast<const char*>(datalinkLayer.getReply() + IMAGE_DATA_OFFSET),
|
||||
IMAGE_DATA_SIZE);
|
||||
CHUNK_SIZE);
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print(downloadReq.position);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
downloadReq.position++;
|
||||
retries = 0;
|
||||
}
|
||||
@ -271,8 +252,12 @@ ReturnValue_t StrHelper::performImageUpload() {
|
||||
file.seekg(0, file.end);
|
||||
// tellg returns position of character in input stream
|
||||
imageSize = file.tellg();
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
ProgressPrinter progressPrinter("Image upload", imageSize);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
while ((uploadReq.position + 1) * SIZE_IMAGE_PART < imageSize) {
|
||||
if (terminate) {
|
||||
file.close();
|
||||
return RETURN_OK;
|
||||
}
|
||||
file.seekg(uploadReq.position * SIZE_IMAGE_PART, file.beg);
|
||||
@ -280,12 +265,17 @@ ReturnValue_t StrHelper::performImageUpload() {
|
||||
arc_pack_upload_action_req(&uploadReq, commandBuffer, &size);
|
||||
result = sendAndRead(size, uploadReq.position);
|
||||
if (result != RETURN_OK) {
|
||||
file.close();
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
result = checkActionReply();
|
||||
if (result != RETURN_OK) {
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print((uploadReq.position + 1) * SIZE_IMAGE_PART);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
uploadReq.position++;
|
||||
}
|
||||
std::memset(uploadReq.data, 0, sizeof(uploadReq.data));
|
||||
@ -303,13 +293,28 @@ ReturnValue_t StrHelper::performImageUpload() {
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print((uploadReq.position + 1) * SIZE_IMAGE_PART);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::performFirmwareUpdate() {
|
||||
using namespace startracker;
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = unlockAndEraseRegions(static_cast<uint32_t>(startracker::FirmwareRegions::FIRST),
|
||||
static_cast<uint32_t>(startracker::FirmwareRegions::LAST));
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = performFlashWrite();
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::performFlashWrite() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint32_t size = 0;
|
||||
uint32_t remainingBytes = 0;
|
||||
uint32_t bytesWritten = 0;
|
||||
uint32_t fileSize = 0;
|
||||
struct WriteActionRequest req;
|
||||
if (not std::filesystem::exists(flashWrite.fullname)) {
|
||||
@ -320,65 +325,97 @@ ReturnValue_t StrHelper::performFlashWrite() {
|
||||
std::ifstream file(flashWrite.fullname, std::ifstream::binary);
|
||||
file.seekg(0, file.end);
|
||||
fileSize = file.tellg();
|
||||
remainingBytes = fileSize;
|
||||
req.region = flashWrite.region;
|
||||
req.address = flashWrite.address;
|
||||
req.length = MAX_FLASH_DATA;
|
||||
while (remainingBytes >= MAX_FLASH_DATA) {
|
||||
if (fileSize > FLASH_REGION_SIZE * (flashWrite.lastRegion - flashWrite.firstRegion)) {
|
||||
sif::warning << "StrHelper::performFlashWrite: Invalid file" << std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
ProgressPrinter progressPrinter("Flash write", fileSize);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
uint32_t fileChunks = fileSize / CHUNK_SIZE;
|
||||
bytesWritten = 0;
|
||||
req.region = flashWrite.firstRegion;
|
||||
req.length = CHUNK_SIZE;
|
||||
for (uint32_t idx = 0; idx < fileChunks; idx++) {
|
||||
if (terminate) {
|
||||
file.close();
|
||||
return RETURN_OK;
|
||||
}
|
||||
file.seekg(fileSize - remainingBytes, file.beg);
|
||||
file.read(reinterpret_cast<char*>(req.data), MAX_FLASH_DATA);
|
||||
file.seekg(idx * CHUNK_SIZE, file.beg);
|
||||
file.read(reinterpret_cast<char*>(req.data), CHUNK_SIZE);
|
||||
if (bytesWritten + CHUNK_SIZE > FLASH_REGION_SIZE) {
|
||||
req.region++;
|
||||
bytesWritten = 0;
|
||||
}
|
||||
req.address = bytesWritten;
|
||||
arc_pack_write_action_req(&req, commandBuffer, &size);
|
||||
result = sendAndRead(size, req.address);
|
||||
if (result != RETURN_OK) {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
result = checkFlashActionReply(req.region, req.address, req.length);
|
||||
if (result != RETURN_OK) {
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
remainingBytes = remainingBytes - MAX_FLASH_DATA;
|
||||
result = checkActionReply();
|
||||
if (result != RETURN_OK) {
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
file.seekg(fileSize - remainingBytes, file.beg);
|
||||
bytesWritten += CHUNK_SIZE;
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print(idx * CHUNK_SIZE);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
}
|
||||
uint32_t remainingBytes = fileSize - fileChunks * CHUNK_SIZE;
|
||||
file.seekg((fileChunks - 1) * CHUNK_SIZE, file.beg);
|
||||
file.read(reinterpret_cast<char*>(req.data), remainingBytes);
|
||||
file.close();
|
||||
if (bytesWritten + CHUNK_SIZE > FLASH_REGION_SIZE) {
|
||||
req.region++;
|
||||
bytesWritten = 0;
|
||||
}
|
||||
req.address = bytesWritten;
|
||||
req.length = remainingBytes;
|
||||
bytesWritten += remainingBytes;
|
||||
arc_pack_write_action_req(&req, commandBuffer, &size);
|
||||
result = sendAndRead(size, req.address);
|
||||
if (result != RETURN_OK) {
|
||||
return RETURN_FAILED;
|
||||
return result;
|
||||
}
|
||||
result = checkFlashActionReply(req.region, req.address, req.length);
|
||||
result = checkActionReply();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print(fileSize);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::performFlashRead() {
|
||||
ReturnValue_t result;
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
ProgressPrinter progressPrinter("Flash read", flashRead.size);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
struct ReadActionRequest req;
|
||||
uint32_t bytesRead = 0;
|
||||
uint32_t size = 0;
|
||||
uint32_t retries = 0;
|
||||
Timestamp timestamp;
|
||||
std::string fullname = flashRead.path + "/" + timestamp.str() + flashRead.filename;
|
||||
std::string fullname = makeFullFilename(flashRead.path, flashRead.filename);
|
||||
std::ofstream file(fullname, std::ios_base::app | std::ios_base::out);
|
||||
if (not std::filesystem::exists(fullname)) {
|
||||
return FILE_CREATION_FAILED;
|
||||
}
|
||||
req.region = flashRead.region;
|
||||
req.region = flashRead.startRegion;
|
||||
req.address = 0;
|
||||
while (bytesRead < flashRead.size) {
|
||||
if (terminate) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
if ((flashRead.size - bytesRead) < MAX_FLASH_DATA) {
|
||||
if ((flashRead.size - bytesRead) < CHUNK_SIZE) {
|
||||
req.length = flashRead.size - bytesRead;
|
||||
} else {
|
||||
req.length = MAX_FLASH_DATA;
|
||||
req.length = CHUNK_SIZE;
|
||||
}
|
||||
req.address = flashRead.address + bytesRead;
|
||||
arc_pack_read_action_req(&req, commandBuffer, &size);
|
||||
result = sendAndRead(size, req.address);
|
||||
if (result != RETURN_OK) {
|
||||
@ -400,117 +437,24 @@ ReturnValue_t StrHelper::performFlashRead() {
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
result = checkFlashActionReply(req.region, req.address, req.length);
|
||||
if (result != RETURN_OK) {
|
||||
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
|
||||
uartComIF->flushUartRxBuffer(comCookie);
|
||||
retries++;
|
||||
continue;
|
||||
}
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
file.write(reinterpret_cast<const char*>(datalinkLayer.getReply() + FLASH_READ_DATA_OFFSET),
|
||||
req.length);
|
||||
bytesRead += req.length;
|
||||
req.address += req.length;
|
||||
if (req.address >= FLASH_REGION_SIZE) {
|
||||
req.address = 0;
|
||||
req.region++;
|
||||
}
|
||||
retries = 0;
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print(bytesRead);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
}
|
||||
file.close();
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::performFpgaDownload() {
|
||||
ReturnValue_t result;
|
||||
struct DownloadFPGAImageActionRequest req;
|
||||
uint32_t size = 0;
|
||||
uint32_t retries = 0;
|
||||
Timestamp timestamp;
|
||||
std::string image = fpgaDownload.path + "/" + timestamp.str() + fpgaDownload.fileName;
|
||||
std::ofstream file(image, std::ios_base::app | std::ios_base::out);
|
||||
if (not std::filesystem::exists(image)) {
|
||||
return FILE_CREATION_FAILED;
|
||||
}
|
||||
req.pos = fpgaDownload.startPosition;
|
||||
while (req.pos < fpgaDownload.length) {
|
||||
if (terminate) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
if (fpgaDownload.length - req.pos >= FpgaDownload::MAX_DATA) {
|
||||
req.length = FpgaDownload::MAX_DATA;
|
||||
} else {
|
||||
req.length = fpgaDownload.length - req.pos;
|
||||
}
|
||||
arc_pack_downloadfpgaimage_action_req(&req, commandBuffer, &size);
|
||||
result = sendAndRead(size, req.pos);
|
||||
if (result != RETURN_OK) {
|
||||
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
|
||||
uartComIF->flushUartRxBuffer(comCookie);
|
||||
retries++;
|
||||
continue;
|
||||
}
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
result = checkFpgaActionReply(req.pos, req.length);
|
||||
if (result != RETURN_OK) {
|
||||
if (retries < CONFIG_MAX_DOWNLOAD_RETRIES) {
|
||||
uartComIF->flushUartRxBuffer(comCookie);
|
||||
retries++;
|
||||
continue;
|
||||
}
|
||||
file.close();
|
||||
return result;
|
||||
}
|
||||
file.write(reinterpret_cast<const char*>(datalinkLayer.getReply() + FpgaDownload::DATA_OFFSET),
|
||||
req.length);
|
||||
req.pos += req.length;
|
||||
retries = 0;
|
||||
}
|
||||
file.close();
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::performFpgaUpload() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
uint32_t commandSize = 0;
|
||||
uint32_t bytesUploaded = 0;
|
||||
uint32_t fileSize = 0;
|
||||
struct UploadFPGAImageActionRequest req;
|
||||
if (not std::filesystem::exists(fpgaUpload.uploadFile)) {
|
||||
triggerEvent(STR_HELPER_FILE_NOT_EXISTS, static_cast<uint32_t>(internalState));
|
||||
internalState = InternalState::IDLE;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
std::ifstream file(flashWrite.fullname, std::ifstream::binary);
|
||||
file.seekg(0, file.end);
|
||||
fileSize = file.tellg();
|
||||
req.pos = 0;
|
||||
while (bytesUploaded <= fileSize) {
|
||||
if (terminate) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
if (fileSize - bytesUploaded > FpgaUpload::MAX_DATA) {
|
||||
req.length = FpgaUpload::MAX_DATA;
|
||||
} else {
|
||||
req.length = fileSize - bytesUploaded;
|
||||
}
|
||||
file.seekg(bytesUploaded, file.beg);
|
||||
file.read(reinterpret_cast<char*>(req.data), req.length);
|
||||
arc_pack_uploadfpgaimage_action_req(&req, commandBuffer, &commandSize);
|
||||
result = sendAndRead(commandSize, req.pos);
|
||||
if (result != RETURN_OK) {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
result = checkFpgaActionReply(req.pos, req.length);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
bytesUploaded += req.length;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::sendAndRead(size_t size, uint32_t parameter) {
|
||||
ReturnValue_t StrHelper::sendAndRead(size_t size, uint32_t parameter, uint32_t delayMs) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t decResult = RETURN_OK;
|
||||
size_t receivedDataLen = 0;
|
||||
@ -527,7 +471,11 @@ ReturnValue_t StrHelper::sendAndRead(size_t size, uint32_t parameter) {
|
||||
}
|
||||
decResult = ArcsecDatalinkLayer::DEC_IN_PROGRESS;
|
||||
while (decResult == ArcsecDatalinkLayer::DEC_IN_PROGRESS) {
|
||||
result = uartComIF->requestReceiveMessage(comCookie, StarTracker::MAX_FRAME_SIZE * 2 + 2);
|
||||
Countdown delay(delayMs);
|
||||
delay.resetTimer();
|
||||
while (delay.isBusy()) {
|
||||
}
|
||||
result = uartComIF->requestReceiveMessage(comCookie, startracker::MAX_FRAME_SIZE * 2 + 2);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::sendAndRead: Failed to request reply" << std::endl;
|
||||
triggerEvent(STR_HELPER_REQUESTING_MSG_FAILED, result, parameter);
|
||||
@ -588,72 +536,7 @@ ReturnValue_t StrHelper::checkReplyPosition(uint32_t expectedPosition) {
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::checkFlashActionReply(uint8_t region_, uint32_t address_,
|
||||
uint16_t length_) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = checkActionReply();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
const uint8_t* data = datalinkLayer.getReply();
|
||||
uint8_t region = *(data + REGION_OFFSET);
|
||||
uint32_t address;
|
||||
const uint8_t* addressData = data + ADDRESS_OFFSET;
|
||||
size_t size = sizeof(address);
|
||||
result =
|
||||
SerializeAdapter::deSerialize(&address, &addressData, &size, SerializeIF::Endianness::LITTLE);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::checkFlashActionReply: Deserialization of address failed"
|
||||
<< std::endl;
|
||||
return result;
|
||||
}
|
||||
uint16_t length = 0;
|
||||
size = sizeof(length);
|
||||
const uint8_t* lengthData = data + LENGTH_OFFSET;
|
||||
result =
|
||||
SerializeAdapter::deSerialize(&length, lengthData, &size, SerializeIF::Endianness::LITTLE);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::checkFlashActionReply: Deserialization of length failed"
|
||||
<< std::endl;
|
||||
}
|
||||
if (region != region_) {
|
||||
return REGION_MISMATCH;
|
||||
}
|
||||
if (address != address_) {
|
||||
return ADDRESS_MISMATCH;
|
||||
}
|
||||
if (length != length_) {
|
||||
return LENGTH_MISMATCH;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t StrHelper::checkFpgaActionReply(uint32_t expectedPosition, uint32_t expectedLength) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = checkActionReply();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
const uint8_t* data = datalinkLayer.getReply() + ACTION_DATA_OFFSET;
|
||||
uint32_t position;
|
||||
size_t size = sizeof(position);
|
||||
result = SerializeAdapter::deSerialize(&position, &data, &size, SerializeIF::Endianness::LITTLE);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::checkFpgaActionReply: Deserialization of position failed"
|
||||
<< std::endl;
|
||||
return result;
|
||||
}
|
||||
uint32_t length;
|
||||
size = sizeof(length);
|
||||
result = SerializeAdapter::deSerialize(&length, &data, &size, SerializeIF::Endianness::LITTLE);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::checkFpgaActionReply: Deserialization of length failed"
|
||||
<< std::endl;
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef XIPHOS_Q7S
|
||||
ReturnValue_t StrHelper::checkPath(std::string name) {
|
||||
if (name.substr(0, sizeof(SdCardManager::SD_0_MOUNT_POINT)) ==
|
||||
std::string(SdCardManager::SD_0_MOUNT_POINT)) {
|
||||
@ -670,3 +553,49 @@ ReturnValue_t StrHelper::checkPath(std::string name) {
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
ReturnValue_t StrHelper::unlockAndEraseRegions(uint32_t from, uint32_t to) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
ProgressPrinter progressPrinter("Unlock and erase", to - from);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
struct UnlockActionRequest unlockReq;
|
||||
struct EraseActionRequest eraseReq;
|
||||
uint32_t size = 0;
|
||||
for (uint32_t idx = from; idx <= to; idx++) {
|
||||
unlockReq.region = idx;
|
||||
unlockReq.code = startracker::region_secrets::secret[idx];
|
||||
arc_pack_unlock_action_req(&unlockReq, commandBuffer, &size);
|
||||
sendAndRead(size, unlockReq.region);
|
||||
result = checkActionReply();
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::unlockAndEraseRegions: Failed to unlock region with id "
|
||||
<< static_cast<unsigned int>(unlockReq.region) << std::endl;
|
||||
return result;
|
||||
}
|
||||
eraseReq.region = idx;
|
||||
arc_pack_erase_action_req(&eraseReq, commandBuffer, &size);
|
||||
result = sendAndRead(size, eraseReq.region, FLASH_ERASE_DELAY);
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "StrHelper::unlockAndEraseRegions: Failed to erase region with id "
|
||||
<< static_cast<unsigned int>(eraseReq.region) << std::endl;
|
||||
return result;
|
||||
}
|
||||
#if OBSW_DEBUG_STARTRACKER == 1
|
||||
progressPrinter.print(idx - from);
|
||||
#endif /* OBSW_DEBUG_STARTRACKER == 1 */
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string StrHelper::makeFullFilename(std::string path, std::string filename) {
|
||||
std::string image;
|
||||
Timestamp timestamp;
|
||||
if (timestamping) {
|
||||
image = path + "/" + timestamp.str() + filename;
|
||||
} else {
|
||||
image = path + "/" + filename;
|
||||
}
|
||||
return image;
|
||||
}
|
@ -4,7 +4,12 @@
|
||||
#include <string>
|
||||
|
||||
#include "ArcsecDatalinkLayer.h"
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
#ifdef XIPHOS_Q7S
|
||||
#include "bsp_q7s/memory/SdCardManager.h"
|
||||
#endif
|
||||
|
||||
#include "fsfw/devicehandlers/CookieIF.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
#include "fsfw/osal/linux/BinarySemaphore.h"
|
||||
@ -19,6 +24,8 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @brief Helper class for the star tracker handler to accelerate large data transfers.
|
||||
*
|
||||
* @author J. Meier
|
||||
*/
|
||||
class StrHelper : public SystemObject, public ExecutableObjectIF, public HasReturnvaluesIF {
|
||||
public:
|
||||
@ -36,49 +43,43 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
static const Event FLASH_WRITE_SUCCESSFUL = MAKE_EVENT(4, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Finished flash read procedure successfully
|
||||
static const Event FLASH_READ_SUCCESSFUL = MAKE_EVENT(5, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Flash write procedure failed
|
||||
static const Event FLASH_WRITE_FAILED = MAKE_EVENT(6, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Flash read procedure failed
|
||||
static const Event FLASH_READ_FAILED = MAKE_EVENT(7, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Download of FPGA image successful
|
||||
static const Event FPGA_DOWNLOAD_SUCCESSFUL = MAKE_EVENT(8, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Download of FPGA image failed
|
||||
static const Event FPGA_DOWNLOAD_FAILED = MAKE_EVENT(9, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Upload of FPGA image successful
|
||||
static const Event FPGA_UPLOAD_SUCCESSFUL = MAKE_EVENT(10, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Upload of FPGA image failed
|
||||
static const Event FPGA_UPLOAD_FAILED = MAKE_EVENT(11, severity::LOW);
|
||||
static const Event FLASH_READ_FAILED = MAKE_EVENT(6, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Firmware update was successful
|
||||
static const Event FIRMWARE_UPDATE_SUCCESSFUL = MAKE_EVENT(7, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Firmware update failed
|
||||
static const Event FIRMWARE_UPDATE_FAILED = MAKE_EVENT(8, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Failed to read communication interface reply data
|
||||
//! P1: Return code of failed communication interface read call
|
||||
//! P1: Upload/download position for which the read call failed
|
||||
static const Event STR_HELPER_READING_REPLY_FAILED = MAKE_EVENT(12, severity::LOW);
|
||||
static const Event STR_HELPER_READING_REPLY_FAILED = MAKE_EVENT(9, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Unexpected stop of decoding sequence
|
||||
//! P1: Return code of failed communication interface read call
|
||||
//! P1: Upload/download position for which the read call failed
|
||||
static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(13, severity::LOW);
|
||||
static const Event STR_HELPER_COM_ERROR = MAKE_EVENT(10, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Star tracker did not send replies (maybe device is powered off)
|
||||
//! P1: Position of upload or download packet for which no reply was sent
|
||||
static const Event STR_HELPER_NO_REPLY = MAKE_EVENT(14, severity::LOW);
|
||||
static const Event STR_HELPER_NO_REPLY = MAKE_EVENT(11, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Error during decoding of received reply occurred
|
||||
// P1: Return value of decoding function
|
||||
// P2: Position of upload/download packet, or address of flash write/read request
|
||||
static const Event STR_HELPER_DEC_ERROR = MAKE_EVENT(15, severity::LOW);
|
||||
static const Event STR_HELPER_DEC_ERROR = MAKE_EVENT(12, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Position mismatch
|
||||
//! P1: The expected position and thus the position for which the image upload/download failed
|
||||
static const Event POSITION_MISMATCH = MAKE_EVENT(16, severity::LOW);
|
||||
static const Event POSITION_MISMATCH = MAKE_EVENT(13, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Specified file does not exist
|
||||
//! P1: Internal state of str helper
|
||||
static const Event STR_HELPER_FILE_NOT_EXISTS = MAKE_EVENT(17, severity::LOW);
|
||||
static const Event STR_HELPER_FILE_NOT_EXISTS = MAKE_EVENT(14, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Sending packet to star tracker failed
|
||||
//! P1: Return code of communication interface sendMessage function
|
||||
//! P2: Position of upload/download packet, or address of flash write/read request for which
|
||||
//! sending failed
|
||||
static const Event STR_HELPER_SENDING_PACKET_FAILED = MAKE_EVENT(18, severity::LOW);
|
||||
static const Event STR_HELPER_SENDING_PACKET_FAILED = MAKE_EVENT(15, severity::LOW);
|
||||
//! [EXPORT] : [COMMENT] Communication interface requesting reply failed
|
||||
//! P1: Return code of failed request
|
||||
//! P1: Upload/download position, or address of flash write/read request for which transmission
|
||||
//! failed
|
||||
static const Event STR_HELPER_REQUESTING_MSG_FAILED = MAKE_EVENT(19, severity::LOW);
|
||||
static const Event STR_HELPER_REQUESTING_MSG_FAILED = MAKE_EVENT(16, severity::LOW);
|
||||
|
||||
StrHelper(object_id_t objectId);
|
||||
virtual ~StrHelper();
|
||||
@ -105,40 +106,21 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
ReturnValue_t startImageDownload(std::string path);
|
||||
|
||||
/**
|
||||
* @brief Starts the flash write procedure
|
||||
* @brief Will start the firmware update
|
||||
*
|
||||
* @param fullname Full name including absolute path of file to write to flash
|
||||
* @param region Region ID of flash region to write to
|
||||
* @param address Start address of flash write procedure
|
||||
* @param fullname Full name including absolute path of file containing firmware
|
||||
* update.
|
||||
*/
|
||||
ReturnValue_t startFlashWrite(std::string fullname, uint8_t region, uint32_t address);
|
||||
ReturnValue_t startFirmwareUpdate(std::string fullname);
|
||||
|
||||
/**
|
||||
* @brief Starts the flash read procedure
|
||||
*
|
||||
* @param path Path where file with read flash data will be created
|
||||
* @param region Region ID of flash region to read from
|
||||
* @param address Start address of flash section to read
|
||||
* @param startRegion Region form where to start reading
|
||||
* @param length Number of bytes to read from flash
|
||||
*/
|
||||
ReturnValue_t startFlashRead(std::string path, uint8_t region, uint32_t address, uint32_t length);
|
||||
|
||||
/**
|
||||
* @brief Starts the download of the FPGA image
|
||||
*
|
||||
* @param path The path where the file with the downloaded data will be created
|
||||
* @param startPosition Offset in fpga image to read from
|
||||
* @param length Number of bytes to dwonload from the FPGA image
|
||||
*
|
||||
*/
|
||||
ReturnValue_t startFpgaDownload(std::string path, uint32_t startPosition, uint32_t length);
|
||||
|
||||
/**
|
||||
* @brief Starts upload of new image to FPGA
|
||||
*
|
||||
* @param uploadFile Full name of file containing FPGA image data
|
||||
*/
|
||||
ReturnValue_t startFpgaUpload(std::string uploadFile);
|
||||
ReturnValue_t startFlashRead(std::string path, uint8_t startRegion, uint32_t length);
|
||||
|
||||
/**
|
||||
* @brief Can be used to interrupt a running data transfer.
|
||||
@ -156,9 +138,14 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
void setFlashReadFilename(std::string filename);
|
||||
|
||||
/**
|
||||
* @brief Set download FPGA image name
|
||||
* @brief Disables timestamp generation when new file is created
|
||||
*/
|
||||
void setDownloadFpgaImage(std::string filename);
|
||||
void disableTimestamping();
|
||||
|
||||
/**
|
||||
* @brief Enables timestamp generation when new file is created
|
||||
*/
|
||||
void enableTimestamping();
|
||||
|
||||
private:
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::STR_HELPER;
|
||||
@ -184,35 +171,13 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
|
||||
// Size of one image part which can be sent per action request
|
||||
static const size_t SIZE_IMAGE_PART = 1024;
|
||||
static const uint32_t FLASH_REGION_SIZE = 0x20000;
|
||||
|
||||
class ImageDownload {
|
||||
public:
|
||||
static const uint32_t LAST_POSITION = 4095;
|
||||
};
|
||||
|
||||
class FpgaDownload {
|
||||
public:
|
||||
static const uint16_t MAX_DATA = 1024;
|
||||
static const uint8_t DATA_OFFSET = 10;
|
||||
// Start position of fpga image part to download
|
||||
uint32_t startPosition = 0;
|
||||
// Length of image part to download
|
||||
uint32_t length = 0;
|
||||
// Path where downloaded FPGA image will be stored
|
||||
std::string path;
|
||||
// Name of file containing downloaded FPGA image
|
||||
std::string fileName = "fpgaimage.bin";
|
||||
};
|
||||
FpgaDownload fpgaDownload;
|
||||
|
||||
class FpgaUpload {
|
||||
public:
|
||||
static const uint32_t MAX_DATA = 1024;
|
||||
// Full name of file to upload
|
||||
std::string uploadFile;
|
||||
};
|
||||
FpgaUpload fpgaUpload;
|
||||
|
||||
static const uint32_t MAX_POLLS = 10000;
|
||||
|
||||
static const uint8_t ACTION_DATA_OFFSET = 2;
|
||||
@ -222,19 +187,11 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
static const uint8_t REGION_OFFSET = 2;
|
||||
static const uint8_t ADDRESS_OFFSET = 3;
|
||||
static const uint8_t LENGTH_OFFSET = 7;
|
||||
static const size_t IMAGE_DATA_SIZE = 1024;
|
||||
static const size_t MAX_FLASH_DATA = 1024;
|
||||
static const size_t CHUNK_SIZE = 1024;
|
||||
static const size_t CONFIG_MAX_DOWNLOAD_RETRIES = 3;
|
||||
static const uint32_t FLASH_ERASE_DELAY = 500;
|
||||
|
||||
enum class InternalState {
|
||||
IDLE,
|
||||
UPLOAD_IMAGE,
|
||||
DOWNLOAD_IMAGE,
|
||||
FLASH_WRITE,
|
||||
FLASH_READ,
|
||||
DOWNLOAD_FPGA_IMAGE,
|
||||
UPLOAD_FPGA_IMAGE
|
||||
};
|
||||
enum class InternalState { IDLE, UPLOAD_IMAGE, DOWNLOAD_IMAGE, FLASH_READ, FIRMWARE_UPDATE };
|
||||
|
||||
InternalState internalState = InternalState::IDLE;
|
||||
|
||||
@ -262,8 +219,10 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
public:
|
||||
// File which contains data to write when executing the flash write command
|
||||
std::string fullname;
|
||||
// Will be set with the flash write command
|
||||
uint8_t region = 0;
|
||||
// The first region to write to
|
||||
uint8_t firstRegion = 0;
|
||||
// Maximum region the flash write command is allowed to write to
|
||||
uint8_t lastRegion = 0;
|
||||
// Will be set with the flash write command and specifies the start address where to write the
|
||||
// flash data to
|
||||
uint32_t address = 0;
|
||||
@ -277,21 +236,26 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
// Default name of file containing the data read from flash, can be changed via command
|
||||
std::string filename = "flashread.bin";
|
||||
// Will be set with the flash read command
|
||||
uint8_t region = 0;
|
||||
// Will be set with the flash read command and specifies the start address of the flash section
|
||||
// to read
|
||||
uint32_t address = 0;
|
||||
uint8_t startRegion = 0;
|
||||
// Number of bytes to read from flash
|
||||
uint32_t size = 0;
|
||||
};
|
||||
FlashRead flashRead;
|
||||
|
||||
#ifdef XIPHOS_Q7S
|
||||
SdCardManager* sdcMan = nullptr;
|
||||
#endif
|
||||
|
||||
uint8_t commandBuffer[StarTracker::MAX_FRAME_SIZE];
|
||||
uint8_t commandBuffer[startracker::MAX_FRAME_SIZE];
|
||||
|
||||
bool terminate = false;
|
||||
|
||||
#ifdef EGSE
|
||||
bool timestamping = false;
|
||||
#else
|
||||
bool timestamping = true;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* UART communication object responsible for low level access of star tracker
|
||||
* Must be set by star tracker handler
|
||||
@ -308,6 +272,13 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
*/
|
||||
ReturnValue_t performImageUpload();
|
||||
|
||||
/**
|
||||
* @brief Performs firmware update
|
||||
*
|
||||
* @return RETURN_OK if successful, otherwise error return value
|
||||
*/
|
||||
ReturnValue_t performFirmwareUpdate();
|
||||
|
||||
/**
|
||||
* @brief Performs download of last taken image from the star tracker.
|
||||
*
|
||||
@ -321,6 +292,8 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
/**
|
||||
* @brief Handles flash write procedure
|
||||
*
|
||||
* @param ID of first region to write to
|
||||
*
|
||||
* @return RETURN_OK if successful, otherwise RETURN_FAILED
|
||||
*/
|
||||
ReturnValue_t performFlashWrite();
|
||||
@ -331,28 +304,17 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
*/
|
||||
ReturnValue_t performFlashRead();
|
||||
|
||||
/**
|
||||
* @brief Performs the download of the FPGA image which requires to be slip over multiple
|
||||
* action requests.
|
||||
*/
|
||||
ReturnValue_t performFpgaDownload();
|
||||
|
||||
/**
|
||||
* @brief Performs upload of new FPGA image. Upload sequence split over multiple commands
|
||||
* because one command can only transport 1024 bytes of image data.
|
||||
*/
|
||||
ReturnValue_t performFpgaUpload();
|
||||
|
||||
/**
|
||||
* @brief Sends packet to the star tracker and reads reply by using the communication
|
||||
* interface
|
||||
*
|
||||
* @param size Size of data beforehand written to the commandBuffer
|
||||
* @param parameter Parameter 2 of trigger event function
|
||||
* @param delayMs Delay in milliseconds between send and receive call
|
||||
*
|
||||
* @return RETURN_OK if successful, otherwise RETURN_FAILED
|
||||
*/
|
||||
ReturnValue_t sendAndRead(size_t size, uint32_t parameter);
|
||||
ReturnValue_t sendAndRead(size_t size, uint32_t parameter, uint32_t delayMs = 0);
|
||||
|
||||
/**
|
||||
* @brief Checks the header (type id and status fields) of the action reply
|
||||
@ -370,28 +332,33 @@ class StrHelper : public SystemObject, public ExecutableObjectIF, public HasRetu
|
||||
*/
|
||||
ReturnValue_t checkReplyPosition(uint32_t expectedPosition);
|
||||
|
||||
/**
|
||||
* @brief Checks the region, address and length value of a flash write or read reply.
|
||||
*
|
||||
* @return RETURN_OK if values match expected values, otherwise appropriate error return
|
||||
* value.
|
||||
*/
|
||||
ReturnValue_t checkFlashActionReply(uint8_t region_, uint32_t address_, uint16_t length_);
|
||||
|
||||
/**
|
||||
* @brief Checks the reply to the fpga download and upload request
|
||||
*
|
||||
* @param expectedPosition The expected position value in the reply
|
||||
* @param expectedLength The expected length field in the reply
|
||||
*/
|
||||
ReturnValue_t checkFpgaActionReply(uint32_t expectedPosition, uint32_t expectedLength);
|
||||
|
||||
#ifdef XIPHOS_Q7S
|
||||
/**
|
||||
* @brief Checks if a path points to an sd card and whether the SD card is monuted.
|
||||
*
|
||||
* @return SD_NOT_MOUNTED id SD card is not mounted, otherwise RETURN_OK
|
||||
*/
|
||||
ReturnValue_t checkPath(std::string name);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Unlocks a range of flash regions
|
||||
*
|
||||
* @param from First region in range to unlock
|
||||
* @param to Last region in range to unlock
|
||||
*
|
||||
*/
|
||||
ReturnValue_t unlockAndEraseRegions(uint32_t from, uint32_t to);
|
||||
|
||||
/**
|
||||
* @brief Creates full filename either with timestamp or without
|
||||
*
|
||||
* @param path Path where to create the file
|
||||
* @param filename Name fo the file
|
||||
*
|
||||
* @return Full filename
|
||||
*/
|
||||
std::string makeFullFilename(std::string path, std::string filename);
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_DEVICES_STRHELPER_H_ */
|
@ -9,6 +9,7 @@
|
||||
#cmakedefine RASPBERRY_PI
|
||||
#cmakedefine XIPHOS_Q7S
|
||||
#cmakedefine BEAGLEBONEBLACK
|
||||
#cmakedefine EGSE
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
@ -35,9 +36,9 @@ debugging. */
|
||||
|
||||
#define OBSW_USE_CCSDS_IP_CORE 1
|
||||
// Set to 1 if all telemetry should be sent to the PTME IP Core
|
||||
#define OBSW_TM_TO_PTME 1
|
||||
#define OBSW_TM_TO_PTME 0
|
||||
// Set to 1 if telecommands are received via the PDEC IP Core
|
||||
#define OBSW_TC_FROM_PDEC 1
|
||||
#define OBSW_TC_FROM_PDEC 0
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_MGT 1
|
||||
@ -52,17 +53,24 @@ debugging. */
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef EGSE
|
||||
#define OBSW_ADD_STAR_TRACKER 1
|
||||
#endif
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
//! /* Can be used to switch device to NORMAL mode immediately */
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
@ -76,9 +84,17 @@ debugging. */
|
||||
#define OBSW_ADD_I2C_TEST_CODE 0
|
||||
#define OBSW_ADD_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_RADIATION_SENSOR_HANDLER 0
|
||||
#define OBSW_TEST_SUS_HANDLER 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
@ -86,7 +102,6 @@ debugging. */
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
@ -95,15 +110,17 @@ debugging. */
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
|
||||
#ifdef EGSE
|
||||
#define OBSW_DEBUG_STARTRACKER 1
|
||||
#else
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#endif
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
|
@ -1,7 +1 @@
|
||||
/**
|
||||
* \file logicalAddresses.cpp
|
||||
*
|
||||
* \date 06.11.2019
|
||||
*/
|
||||
|
||||
#include "addresses.h"
|
||||
|
@ -24,6 +24,7 @@ enum logicalAddresses : address_t {
|
||||
|
||||
RAD_SENSOR = objects::RAD_SENSOR,
|
||||
|
||||
SUS_0 = objects::SUS_0,
|
||||
SUS_1 = objects::SUS_1,
|
||||
SUS_2 = objects::SUS_2,
|
||||
SUS_3 = objects::SUS_3,
|
||||
@ -35,8 +36,6 @@ enum logicalAddresses : address_t {
|
||||
SUS_9 = objects::SUS_9,
|
||||
SUS_10 = objects::SUS_10,
|
||||
SUS_11 = objects::SUS_11,
|
||||
SUS_12 = objects::SUS_12,
|
||||
SUS_13 = objects::SUS_13,
|
||||
|
||||
/* Dummy and Test Addresses */
|
||||
DUMMY_ECHO = 129,
|
||||
@ -71,7 +70,8 @@ enum spiAddresses : address_t {
|
||||
RW1,
|
||||
RW2,
|
||||
RW3,
|
||||
RW4
|
||||
RW4,
|
||||
PLPCDU_ADC
|
||||
};
|
||||
|
||||
/* Addresses of devices supporting the CSP protocol */
|
||||
|
@ -54,6 +54,7 @@ enum gpioId_t {
|
||||
RTD_IC_17,
|
||||
RTD_IC_18,
|
||||
|
||||
CS_SUS_0,
|
||||
CS_SUS_1,
|
||||
CS_SUS_2,
|
||||
CS_SUS_3,
|
||||
@ -65,17 +66,16 @@ enum gpioId_t {
|
||||
CS_SUS_9,
|
||||
CS_SUS_10,
|
||||
CS_SUS_11,
|
||||
CS_SUS_12,
|
||||
CS_SUS_13,
|
||||
|
||||
SPI_MUX_BIT_0,
|
||||
SPI_MUX_BIT_1,
|
||||
SPI_MUX_BIT_2,
|
||||
SPI_MUX_BIT_3,
|
||||
SPI_MUX_BIT_4,
|
||||
SPI_MUX_BIT_5,
|
||||
SPI_MUX_BIT_6,
|
||||
|
||||
CS_RAD_SENSOR,
|
||||
ENABLE_RADFET,
|
||||
|
||||
PAPB_BUSY_N,
|
||||
PAPB_EMPTY,
|
||||
@ -110,7 +110,16 @@ enum gpioId_t {
|
||||
RS485_EN_RX_DATA,
|
||||
RS485_EN_RX_CLOCK,
|
||||
|
||||
BIT_RATE_SEL
|
||||
BIT_RATE_SEL,
|
||||
|
||||
PLPCDU_ENB_VBAT0,
|
||||
PLPCDU_ENB_VBAT1,
|
||||
PLPCDU_ENB_DRO,
|
||||
PLPCDU_ENB_X8,
|
||||
PLPCDU_ENB_TX,
|
||||
PLPCDU_ENB_HPA,
|
||||
PLPCDU_ENB_MPA,
|
||||
PLPCDU_ADC_CS
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @brief Auto-generated event translation file. Contains 140 translations.
|
||||
* @brief Auto-generated event translation file. Contains 139 translations.
|
||||
* @details
|
||||
* Generated on: 2022-02-03 17:30:40
|
||||
* Generated on: 2022-02-27 15:36:42
|
||||
*/
|
||||
#include "translateEvents.h"
|
||||
|
||||
@ -107,6 +107,8 @@ const char *SELF_TEST_MTM_RANGE_FAILURE_STRING = "SELF_TEST_MTM_RANGE_FAILURE";
|
||||
const char *SELF_TEST_COIL_CURRENT_FAILURE_STRING = "SELF_TEST_COIL_CURRENT_FAILURE";
|
||||
const char *INVALID_ERROR_BYTE_STRING = "INVALID_ERROR_BYTE";
|
||||
const char *ERROR_STATE_STRING = "ERROR_STATE";
|
||||
const char *BOOTING_FIRMWARE_FAILED_STRING = "BOOTING_FIRMWARE_FAILED";
|
||||
const char *BOOTING_BOOTLOADER_FAILED_STRING = "BOOTING_BOOTLOADER_FAILED";
|
||||
const char *SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING = "SUPV_MEMORY_READ_RPT_CRC_FAILURE";
|
||||
const char *SUPV_ACK_FAILURE_STRING = "SUPV_ACK_FAILURE";
|
||||
const char *SUPV_EXE_FAILURE_STRING = "SUPV_EXE_FAILURE";
|
||||
@ -131,12 +133,9 @@ const char *IMAGE_UPLOAD_SUCCESSFUL_STRING = "IMAGE_UPLOAD_SUCCESSFUL";
|
||||
const char *IMAGE_DOWNLOAD_SUCCESSFUL_STRING = "IMAGE_DOWNLOAD_SUCCESSFUL";
|
||||
const char *FLASH_WRITE_SUCCESSFUL_STRING = "FLASH_WRITE_SUCCESSFUL";
|
||||
const char *FLASH_READ_SUCCESSFUL_STRING = "FLASH_READ_SUCCESSFUL";
|
||||
const char *FLASH_WRITE_FAILED_STRING = "FLASH_WRITE_FAILED";
|
||||
const char *FLASH_READ_FAILED_STRING = "FLASH_READ_FAILED";
|
||||
const char *FPGA_DOWNLOAD_SUCCESSFUL_STRING = "FPGA_DOWNLOAD_SUCCESSFUL";
|
||||
const char *FPGA_DOWNLOAD_FAILED_STRING = "FPGA_DOWNLOAD_FAILED";
|
||||
const char *FPGA_UPLOAD_SUCCESSFUL_STRING = "FPGA_UPLOAD_SUCCESSFUL";
|
||||
const char *FPGA_UPLOAD_FAILED_STRING = "FPGA_UPLOAD_FAILED";
|
||||
const char *FIRMWARE_UPDATE_SUCCESSFUL_STRING = "FIRMWARE_UPDATE_SUCCESSFUL";
|
||||
const char *FIRMWARE_UPDATE_FAILED_STRING = "FIRMWARE_UPDATE_FAILED";
|
||||
const char *STR_HELPER_READING_REPLY_FAILED_STRING = "STR_HELPER_READING_REPLY_FAILED";
|
||||
const char *STR_HELPER_COM_ERROR_STRING = "STR_HELPER_COM_ERROR";
|
||||
const char *STR_HELPER_NO_REPLY_STRING = "STR_HELPER_NO_REPLY";
|
||||
@ -352,6 +351,10 @@ const char *translateEvents(Event event) {
|
||||
return INVALID_ERROR_BYTE_STRING;
|
||||
case (11301):
|
||||
return ERROR_STATE_STRING;
|
||||
case (11401):
|
||||
return BOOTING_FIRMWARE_FAILED_STRING;
|
||||
case (11402):
|
||||
return BOOTING_BOOTLOADER_FAILED_STRING;
|
||||
case (11501):
|
||||
return SUPV_MEMORY_READ_RPT_CRC_FAILURE_STRING;
|
||||
case (11502):
|
||||
@ -401,32 +404,26 @@ const char *translateEvents(Event event) {
|
||||
case (12005):
|
||||
return FLASH_READ_SUCCESSFUL_STRING;
|
||||
case (12006):
|
||||
return FLASH_WRITE_FAILED_STRING;
|
||||
case (12007):
|
||||
return FLASH_READ_FAILED_STRING;
|
||||
case (12007):
|
||||
return FIRMWARE_UPDATE_SUCCESSFUL_STRING;
|
||||
case (12008):
|
||||
return FPGA_DOWNLOAD_SUCCESSFUL_STRING;
|
||||
return FIRMWARE_UPDATE_FAILED_STRING;
|
||||
case (12009):
|
||||
return FPGA_DOWNLOAD_FAILED_STRING;
|
||||
case (12010):
|
||||
return FPGA_UPLOAD_SUCCESSFUL_STRING;
|
||||
case (12011):
|
||||
return FPGA_UPLOAD_FAILED_STRING;
|
||||
case (12012):
|
||||
return STR_HELPER_READING_REPLY_FAILED_STRING;
|
||||
case (12013):
|
||||
case (12010):
|
||||
return STR_HELPER_COM_ERROR_STRING;
|
||||
case (12014):
|
||||
case (12011):
|
||||
return STR_HELPER_NO_REPLY_STRING;
|
||||
case (12015):
|
||||
case (12012):
|
||||
return STR_HELPER_DEC_ERROR_STRING;
|
||||
case (12016):
|
||||
case (12013):
|
||||
return POSITION_MISMATCH_STRING;
|
||||
case (12017):
|
||||
case (12014):
|
||||
return STR_HELPER_FILE_NOT_EXISTS_STRING;
|
||||
case (12018):
|
||||
case (12015):
|
||||
return STR_HELPER_SENDING_PACKET_FAILED_STRING;
|
||||
case (12019):
|
||||
case (12016):
|
||||
return STR_HELPER_REQUESTING_MSG_FAILED_STRING;
|
||||
default:
|
||||
return "UNKNOWN_EVENT";
|
||||
|
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* @brief Auto-generated object translation file.
|
||||
* @details
|
||||
* Contains 110 translations.
|
||||
* Generated on: 2022-02-03 12:01:36
|
||||
* Contains 112 translations.
|
||||
* Generated on: 2022-02-27 15:36:48
|
||||
*/
|
||||
#include "translateObjects.h"
|
||||
|
||||
@ -12,6 +12,7 @@ const char *ACS_CONTROLLER_STRING = "ACS_CONTROLLER";
|
||||
const char *THERMAL_CONTROLLER_STRING = "THERMAL_CONTROLLER";
|
||||
const char *MGM_0_LIS3_HANDLER_STRING = "MGM_0_LIS3_HANDLER";
|
||||
const char *GYRO_0_ADIS_HANDLER_STRING = "GYRO_0_ADIS_HANDLER";
|
||||
const char *SUS_0_STRING = "SUS_0";
|
||||
const char *SUS_1_STRING = "SUS_1";
|
||||
const char *SUS_2_STRING = "SUS_2";
|
||||
const char *SUS_3_STRING = "SUS_3";
|
||||
@ -23,8 +24,6 @@ const char *SUS_8_STRING = "SUS_8";
|
||||
const char *SUS_9_STRING = "SUS_9";
|
||||
const char *SUS_10_STRING = "SUS_10";
|
||||
const char *SUS_11_STRING = "SUS_11";
|
||||
const char *SUS_12_STRING = "SUS_12";
|
||||
const char *SUS_13_STRING = "SUS_13";
|
||||
const char *RW1_STRING = "RW1";
|
||||
const char *MGM_1_RM3100_HANDLER_STRING = "MGM_1_RM3100_HANDLER";
|
||||
const char *GYRO_1_L3G_HANDLER_STRING = "GYRO_1_L3G_HANDLER";
|
||||
@ -44,6 +43,7 @@ const char *PDU1_HANDLER_STRING = "PDU1_HANDLER";
|
||||
const char *PDU2_HANDLER_STRING = "PDU2_HANDLER";
|
||||
const char *ACU_HANDLER_STRING = "ACU_HANDLER";
|
||||
const char *BPX_BATT_HANDLER_STRING = "BPX_BATT_HANDLER";
|
||||
const char *PLPCDU_HANDLER_STRING = "PLPCDU_HANDLER";
|
||||
const char *RAD_SENSOR_STRING = "RAD_SENSOR";
|
||||
const char *PLOC_UPDATER_STRING = "PLOC_UPDATER";
|
||||
const char *PLOC_MEMORY_DUMPER_STRING = "PLOC_MEMORY_DUMPER";
|
||||
@ -82,6 +82,7 @@ const char *PUS_PACKET_DISTRIBUTOR_STRING = "PUS_PACKET_DISTRIBUTOR";
|
||||
const char *TMTC_BRIDGE_STRING = "TMTC_BRIDGE";
|
||||
const char *TMTC_POLLING_TASK_STRING = "TMTC_POLLING_TASK";
|
||||
const char *FILE_SYSTEM_HANDLER_STRING = "FILE_SYSTEM_HANDLER";
|
||||
const char *SDC_MANAGER_STRING = "SDC_MANAGER";
|
||||
const char *PTME_STRING = "PTME";
|
||||
const char *PDEC_HANDLER_STRING = "PDEC_HANDLER";
|
||||
const char *CCSDS_HANDLER_STRING = "CCSDS_HANDLER";
|
||||
@ -109,6 +110,7 @@ const char *TIME_STAMPER_STRING = "TIME_STAMPER";
|
||||
const char *FSFW_OBJECTS_END_STRING = "FSFW_OBJECTS_END";
|
||||
const char *SPI_TEST_STRING = "SPI_TEST";
|
||||
const char *UART_TEST_STRING = "UART_TEST";
|
||||
const char *I2C_TEST_STRING = "I2C_TEST";
|
||||
const char *DUMMY_HANDLER_STRING = "DUMMY_HANDLER";
|
||||
const char *DUMMY_INTERFACE_STRING = "DUMMY_INTERFACE";
|
||||
const char *LIBGPIOD_TEST_STRING = "LIBGPIOD_TEST";
|
||||
@ -132,31 +134,29 @@ const char *translateObject(object_id_t object) {
|
||||
case 0x44120010:
|
||||
return GYRO_0_ADIS_HANDLER_STRING;
|
||||
case 0x44120032:
|
||||
return SUS_1_STRING;
|
||||
return SUS_0_STRING;
|
||||
case 0x44120033:
|
||||
return SUS_2_STRING;
|
||||
return SUS_1_STRING;
|
||||
case 0x44120034:
|
||||
return SUS_3_STRING;
|
||||
return SUS_2_STRING;
|
||||
case 0x44120035:
|
||||
return SUS_4_STRING;
|
||||
return SUS_3_STRING;
|
||||
case 0x44120036:
|
||||
return SUS_5_STRING;
|
||||
return SUS_4_STRING;
|
||||
case 0x44120037:
|
||||
return SUS_6_STRING;
|
||||
return SUS_5_STRING;
|
||||
case 0x44120038:
|
||||
return SUS_7_STRING;
|
||||
return SUS_6_STRING;
|
||||
case 0x44120039:
|
||||
return SUS_8_STRING;
|
||||
return SUS_7_STRING;
|
||||
case 0x44120040:
|
||||
return SUS_9_STRING;
|
||||
return SUS_8_STRING;
|
||||
case 0x44120041:
|
||||
return SUS_10_STRING;
|
||||
return SUS_9_STRING;
|
||||
case 0x44120042:
|
||||
return SUS_11_STRING;
|
||||
return SUS_10_STRING;
|
||||
case 0x44120043:
|
||||
return SUS_12_STRING;
|
||||
case 0x44120044:
|
||||
return SUS_13_STRING;
|
||||
return SUS_11_STRING;
|
||||
case 0x44120047:
|
||||
return RW1_STRING;
|
||||
case 0x44120107:
|
||||
@ -195,6 +195,8 @@ const char *translateObject(object_id_t object) {
|
||||
return ACU_HANDLER_STRING;
|
||||
case 0x44260000:
|
||||
return BPX_BATT_HANDLER_STRING;
|
||||
case 0x44300000:
|
||||
return PLPCDU_HANDLER_STRING;
|
||||
case 0x443200A5:
|
||||
return RAD_SENSOR_STRING;
|
||||
case 0x44330000:
|
||||
@ -271,6 +273,8 @@ const char *translateObject(object_id_t object) {
|
||||
return TMTC_POLLING_TASK_STRING;
|
||||
case 0x50000500:
|
||||
return FILE_SYSTEM_HANDLER_STRING;
|
||||
case 0x50000550:
|
||||
return SDC_MANAGER_STRING;
|
||||
case 0x50000600:
|
||||
return PTME_STRING;
|
||||
case 0x50000700:
|
||||
@ -325,6 +329,8 @@ const char *translateObject(object_id_t object) {
|
||||
return SPI_TEST_STRING;
|
||||
case 0x54000020:
|
||||
return UART_TEST_STRING;
|
||||
case 0x54000030:
|
||||
return I2C_TEST_STRING;
|
||||
case 0x5400AFFE:
|
||||
return DUMMY_HANDLER_STRING;
|
||||
case 0x5400CAFE:
|
||||
|
@ -5,10 +5,6 @@
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <fsfw/tasks/FixedTimeslotTaskIF.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "linux/devices/SusHandler.h"
|
||||
#include "objects/systemObjectList.h"
|
||||
|
||||
ReturnValue_t pst::pstGpio(FixedTimeslotTaskIF *thisSequence) {
|
||||
// Length of a communication cycle
|
||||
uint32_t length = thisSequence->getPeriodMs();
|
||||
@ -153,6 +149,19 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_SUN_SENSORS == 1
|
||||
|
||||
bool addSus0 = true;
|
||||
bool addSus1 = true;
|
||||
bool addSus2 = true;
|
||||
bool addSus3 = true;
|
||||
bool addSus4 = true;
|
||||
bool addSus5 = true;
|
||||
bool addSus6 = true;
|
||||
bool addSus7 = true;
|
||||
bool addSus8 = true;
|
||||
bool addSus9 = true;
|
||||
bool addSus10 = true;
|
||||
bool addSus11 = true;
|
||||
/**
|
||||
* The sun sensor will be shutdown as soon as the chip select is pulled high. Thus all
|
||||
* requests to a sun sensor must be performed consecutively. Another reason for calling multiple
|
||||
@ -161,253 +170,157 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
* One sun sensor communication sequence also blocks the SPI bus. So other devices can not be
|
||||
* inserted between the device handler cycles of one SUS.
|
||||
*/
|
||||
if (addSus0) {
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.9, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.9, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.901, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.902, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.902, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.903, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.903, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.904, SusHandler::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.904, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.905, SusHandler::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.905, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_0, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
if (addSus1) {
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.8, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.91, SusHandler::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.91, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.93, SusHandler::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.93, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
if (addSus2) {
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.909, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.909, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.91, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.91, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.911, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.911, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_2, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
if (addSus3) {
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.912, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.912, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.913, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.913, DeviceHandlerIF::GET_READ);
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.914, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.914, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_3, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
if (addSus4) {
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.915, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.915, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.916, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions from inernal FIFO */
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.917, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_4, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
if (addSus5) {
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.918, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.918, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.919, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions from inernal FIFO */
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.92, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_5, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.921, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.921, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.922, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions from inernal FIFO */
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.923, DeviceHandlerIF::GET_READ);
|
||||
if (addSus6) {
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.924, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.924, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.925, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.926, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_6, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.927, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.927, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.928, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.929, DeviceHandlerIF::GET_READ);
|
||||
if (addSus7) {
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.93, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.93, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.931, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.932, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_7, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.933, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.933, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.934, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_12, length * 0.935, DeviceHandlerIF::GET_READ);
|
||||
if (addSus8) {
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.936, SusHandler::FIRST_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.936, DeviceHandlerIF::GET_READ);
|
||||
/* Start ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.937, DeviceHandlerIF::GET_READ);
|
||||
/* Read ADC conversions */
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_13, length * 0.938, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_8, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if (addSus9) {
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0, DeviceHandlerIF::GET_READ);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_9, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if (addSus10) {
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_10, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
if (addSus11) {
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0, DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.4, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.4, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::SUS_11, length * 0.4, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
#endif /* OBSW_ADD_SUN_SENSORS == 1 */
|
||||
|
||||
#if OBSW_ADD_RW == 1
|
||||
thisSequence->addSlot(objects::RW1, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
@ -436,8 +349,8 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
#endif
|
||||
|
||||
#if OBSW_ADD_ACS_BOARD == 1 && OBSW_ADD_ACS_HANDLERS == 1
|
||||
bool enableAside = true;
|
||||
bool enableBside = false;
|
||||
bool enableAside = false;
|
||||
bool enableBside = true;
|
||||
if (enableAside) {
|
||||
// A side
|
||||
thisSequence->addSlot(objects::MGM_0_LIS3_HANDLER, length * 0,
|
||||
@ -452,21 +365,21 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.25,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::MGM_1_RM3100_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.3, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_0_ADIS_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.35, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_1_L3G_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
|
||||
@ -474,7 +387,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
// B side
|
||||
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::MGM_2_LIS3_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
@ -484,21 +397,21 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.25,
|
||||
DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::MGM_3_RM3100_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.3, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_2_ADIS_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.35, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.25, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.6, DeviceHandlerIF::GET_WRITE);
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.75, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.7, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::GYRO_3_L3G_HANDLER, length * 0.85, DeviceHandlerIF::GET_READ);
|
||||
}
|
||||
#endif /* OBSW_ADD_ACS_BOARD == 1 && OBSW_ADD_ACS_HANDLERS == 1 */
|
||||
@ -519,6 +432,7 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
|
||||
ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
|
||||
// Length of a communication cycle
|
||||
uint32_t length = thisSequence->getPeriodMs();
|
||||
static_cast<void>(length);
|
||||
#if OBSW_ADD_MGT == 1
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::IMTQ_HANDLER, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
@ -533,6 +447,7 @@ ReturnValue_t pst::pstI2c(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::BPX_BATT_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
static_cast<void>(length);
|
||||
if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::error << "I2C PST initialization failed" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
@ -555,9 +470,11 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
|
||||
#ifdef XIPHOS_Q7S
|
||||
thisSequence->addSlot(objects::PLOC_UPDATER, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::PLOC_MEMORY_DUMPER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
#endif
|
||||
#if OBSW_ADD_PLOC_SUPERVISOR == 1
|
||||
thisSequence->addSlot(objects::PLOC_SUPERVISOR_HANDLER, length * 0,
|
||||
DeviceHandlerIF::PERFORM_OPERATION);
|
||||
@ -586,7 +503,7 @@ ReturnValue_t pst::pstUart(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.6, DeviceHandlerIF::SEND_READ);
|
||||
thisSequence->addSlot(objects::STAR_TRACKER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
|
||||
static_cast<void>(length);
|
||||
if (uartPstEmpty) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
@ -685,7 +602,7 @@ ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::PLOC_MPSOC_HANDLER, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
|
||||
#if OBSW_TEST_RADIATION_SENSOR_HANDLER == 1
|
||||
#if OBSW_TEST_RAD_SENSOR == 1
|
||||
thisSequence->addSlot(objects::RAD_SENSOR, length * 0, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.2, DeviceHandlerIF::SEND_WRITE);
|
||||
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.4, DeviceHandlerIF::GET_WRITE);
|
||||
@ -693,7 +610,7 @@ ReturnValue_t pst::pollingSequenceTE0720(FixedTimeslotTaskIF *thisSequence) {
|
||||
thisSequence->addSlot(objects::RAD_SENSOR, length * 0.8, DeviceHandlerIF::GET_READ);
|
||||
#endif
|
||||
|
||||
#if OBSW_TEST_SUS_HANDLER == 1
|
||||
#if OBSW_TEST_SUS == 1
|
||||
/* Write setup */
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.901, DeviceHandlerIF::PERFORM_OPERATION);
|
||||
thisSequence->addSlot(objects::SUS_1, length * 0.902, SusHandler::FIRST_WRITE);
|
||||
|
@ -1177,7 +1177,7 @@
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.other.138952870" name="Other debugging flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.other"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.showDevicesTab.69065720" name="showDevicesTab" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.showDevicesTab"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.1773865512" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder arguments="--build . -j" buildPath="${workspace_loc:/eive-obsw/build-Watchdog}" command="cmake" enableCleanBuild="false" enabledIncrementalBuild="true" id="ilg.gnuarmeclipse.managedbuild.cross.builder.890124449" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<builder arguments="--build . --target eive-watchdog -j" buildPath="${workspace_loc:/eive-obsw/build-Debug-Watchdog}" command="cmake" enableCleanBuild="false" enabledIncrementalBuild="true" id="ilg.gnuarmeclipse.managedbuild.cross.builder.890124449" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.964799144" name="GNU Arm Cross Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.295289472" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.111941431" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" valueType="includePath">
|
||||
@ -1343,7 +1343,7 @@
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.other.1135900144" name="Other debugging flags" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.debugging.other"/>
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.showDevicesTab.2092395820" name="showDevicesTab" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.showDevicesTab"/>
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform.381962613" isAbstract="false" osList="all" superClass="ilg.gnuarmeclipse.managedbuild.cross.targetPlatform"/>
|
||||
<builder arguments="--build . -j" buildPath="${workspace_loc:/eive-obsw/build-Release-Watchdog}" command="cmake" enableCleanBuild="false" enabledIncrementalBuild="true" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1784164529" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<builder arguments="--build . --target eive-watchdog -j" buildPath="${workspace_loc:/eive-obsw/build-Release-Watchdog}" command="cmake" enableCleanBuild="false" enabledIncrementalBuild="true" id="ilg.gnuarmeclipse.managedbuild.cross.builder.1784164529" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="ilg.gnuarmeclipse.managedbuild.cross.builder"/>
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler.926630835" name="GNU Arm Cross Assembler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.assembler">
|
||||
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.243911424" name="Use preprocessor" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor" value="true" valueType="boolean"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.473023042" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" valueType="includePath">
|
||||
@ -1496,10 +1496,10 @@
|
||||
<configuration configurationName="q7s-watchdog-release">
|
||||
<resource resourceType="PROJECT" workspacePath="/eive-obsw"/>
|
||||
</configuration>
|
||||
<configuration configurationName="eive-rpi-release-win"/>
|
||||
<configuration configurationName="eive-fsfw-unittest">
|
||||
<resource resourceType="PROJECT" workspacePath="/eive-obsw"/>
|
||||
</configuration>
|
||||
<configuration configurationName="eive-rpi-release-win"/>
|
||||
<configuration configurationName="q7s-watchdog-debug"/>
|
||||
<configuration configurationName="Default">
|
||||
<resource resourceType="PROJECT" workspacePath="/eive_obsw"/>
|
||||
|
@ -69,7 +69,7 @@ void ObjectFactory::produceGenericObjects() {
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
|
||||
// Every TM packet goes through this funnel
|
||||
new TmFunnel(objects::TM_FUNNEL);
|
||||
new TmFunnel(objects::TM_FUNNEL, 50);
|
||||
|
||||
// PUS service stack
|
||||
new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, apid::EIVE_OBSW,
|
||||
@ -79,7 +79,7 @@ void ObjectFactory::produceGenericObjects() {
|
||||
new Service3Housekeeping(objects::PUS_SERVICE_3_HOUSEKEEPING, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_3);
|
||||
new Service5EventReporting(objects::PUS_SERVICE_5_EVENT_REPORTING, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_5, 50);
|
||||
pus::PUS_SERVICE_5, 15, 45);
|
||||
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_8, 3, 60);
|
||||
new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_9);
|
||||
|
@ -1,5 +1,4 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
GPSHyperionLinuxController.cpp
|
||||
GomspaceDeviceHandler.cpp
|
||||
BpxBatteryHandler.cpp
|
||||
Tmp1075Handler.cpp
|
||||
@ -16,6 +15,7 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
RadiationSensorHandler.cpp
|
||||
GyroADIS1650XHandler.cpp
|
||||
RwHandler.cpp
|
||||
max1227.cpp
|
||||
SusHandler.cpp
|
||||
SolarArrayDeploymentHandler.cpp
|
||||
)
|
||||
|
||||
|
||||
|
@ -20,10 +20,6 @@ GyroADIS1650XHandler::GyroADIS1650XHandler(object_id_t objectId, object_id_t dev
|
||||
primaryDataset(this),
|
||||
configDataset(this),
|
||||
breakCountdown() {
|
||||
#if FSFW_HAL_ADIS1650X_GYRO_DEBUG == 1
|
||||
debugDivider = new PeriodicOperationDivider(5);
|
||||
#endif
|
||||
|
||||
#if OBSW_ADIS1650X_LINUX_COM_IF == 1
|
||||
SpiCookie *cookie = dynamic_cast<SpiCookie *>(comCookie);
|
||||
if (cookie != nullptr) {
|
||||
@ -101,7 +97,7 @@ ReturnValue_t GyroADIS1650XHandler::buildCommandFromCommand(DeviceCommandId_t de
|
||||
switch (deviceCommand) {
|
||||
case (ADIS1650X::READ_OUT_CONFIG): {
|
||||
this->rawPacketLen = ADIS1650X::CONFIG_READOUT_SIZE;
|
||||
uint8_t regList[5];
|
||||
uint8_t regList[5] = {};
|
||||
regList[0] = ADIS1650X::DIAG_STAT_REG;
|
||||
regList[1] = ADIS1650X::FILTER_CTRL_REG;
|
||||
regList[2] = ADIS1650X::MSC_CTRL_REG;
|
||||
@ -305,8 +301,8 @@ ReturnValue_t GyroADIS1650XHandler::handleSensorData(const uint8_t *packet) {
|
||||
primaryDataset.setValidity(true, true);
|
||||
}
|
||||
|
||||
#if FSFW_HAL_ADIS1650X_GYRO_DEBUG == 1
|
||||
if (debugDivider->checkAndIncrement()) {
|
||||
if (periodicPrintout) {
|
||||
if (debugDivider.checkAndIncrement()) {
|
||||
sif::info << "GyroADIS1650XHandler: Angular velocities in deg / s" << std::endl;
|
||||
sif::info << "X: " << primaryDataset.angVelocX.value << std::endl;
|
||||
sif::info << "Y: " << primaryDataset.angVelocY.value << std::endl;
|
||||
@ -316,7 +312,7 @@ ReturnValue_t GyroADIS1650XHandler::handleSensorData(const uint8_t *packet) {
|
||||
sif::info << "Y: " << primaryDataset.accelY.value << std::endl;
|
||||
sif::info << "Z: " << primaryDataset.accelZ.value << std::endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@ -446,6 +442,9 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
||||
}
|
||||
|
||||
size_t idx = 0;
|
||||
spi_ioc_transfer *transferStruct = cookie->getTransferStructHandle();
|
||||
uint64_t origTx = transferStruct->tx_buf;
|
||||
uint64_t origRx = transferStruct->rx_buf;
|
||||
while (idx < sendLen) {
|
||||
// Pull SPI CS low. For now, no support for active high given
|
||||
if (gpioId != gpio::NO_GPIO) {
|
||||
@ -471,11 +470,12 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
||||
if (idx < sendLen) {
|
||||
usleep(ADIS1650X::STALL_TIME_MICROSECONDS);
|
||||
}
|
||||
spi_ioc_transfer *transferStruct = cookie->getTransferStructHandle();
|
||||
|
||||
transferStruct->tx_buf += 2;
|
||||
transferStruct->rx_buf += 2;
|
||||
}
|
||||
|
||||
transferStruct->tx_buf = origTx;
|
||||
transferStruct->rx_buf = origRx;
|
||||
if (gpioId != gpio::NO_GPIO) {
|
||||
mutex->unlockMutex();
|
||||
}
|
||||
@ -486,4 +486,9 @@ ReturnValue_t GyroADIS1650XHandler::spiSendCallback(SpiComIF *comIf, SpiCookie *
|
||||
|
||||
void GyroADIS1650XHandler::setToGoToNormalModeImmediately() { goToNormalMode = true; }
|
||||
|
||||
void GyroADIS1650XHandler::enablePeriodicPrintouts(bool enable, uint8_t divider) {
|
||||
periodicPrintout = enable;
|
||||
debugDivider.setDivider(divider);
|
||||
}
|
||||
|
||||
#endif /* OBSW_ADIS1650X_LINUX_COM_IF == 1 */
|
||||
|
@ -23,6 +23,7 @@ class GyroADIS1650XHandler : public DeviceHandlerBase {
|
||||
GyroADIS1650XHandler(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie,
|
||||
ADIS1650X::Type type);
|
||||
|
||||
void enablePeriodicPrintouts(bool enable, uint8_t divider);
|
||||
void setToGoToNormalModeImmediately();
|
||||
|
||||
// DeviceHandlerBase abstract function implementation
|
||||
@ -69,13 +70,13 @@ class GyroADIS1650XHandler : public DeviceHandlerBase {
|
||||
size_t sendLen, void *args);
|
||||
#endif
|
||||
|
||||
#if FSFW_HAL_ADIS1650X_GYRO_DEBUG == 1
|
||||
PeriodicOperationDivider *debugDivider;
|
||||
#endif
|
||||
Countdown breakCountdown;
|
||||
void prepareWriteCommand(uint8_t startReg, uint8_t valueOne, uint8_t valueTwo);
|
||||
|
||||
ReturnValue_t handleSensorData(const uint8_t *packet);
|
||||
|
||||
bool periodicPrintout = false;
|
||||
PeriodicOperationDivider debugDivider = PeriodicOperationDivider(3);
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_GYROADIS16507HANDLER_H_ */
|
||||
|
@ -16,8 +16,9 @@ HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_
|
||||
mainLineSwitcherObjectId(mainLineSwitcherObjectId_),
|
||||
mainLineSwitch(mainLineSwitch_),
|
||||
actionHelper(this, nullptr) {
|
||||
auto mqArgs = MqArgs(setObjectId_, static_cast<void*>(this));
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
||||
cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
||||
cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
|
||||
HeaterHandler::~HeaterHandler() {}
|
||||
|
@ -1,11 +1,12 @@
|
||||
#include <OBSWConfig.h>
|
||||
#include <devices/gpioIds.h>
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
#include <mission/devices/RadiationSensorHandler.h>
|
||||
|
||||
RadiationSensorHandler::RadiationSensorHandler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF *comCookie)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie), dataset(this) {
|
||||
if (comCookie == NULL) {
|
||||
CookieIF *comCookie, GpioIF *gpioIF)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie), dataset(this), gpioIF(gpioIF) {
|
||||
if (comCookie == nullptr) {
|
||||
sif::error << "RadiationSensorHandler: Invalid com cookie" << std::endl;
|
||||
}
|
||||
}
|
||||
@ -14,11 +15,13 @@ RadiationSensorHandler::~RadiationSensorHandler() {}
|
||||
|
||||
void RadiationSensorHandler::doStartUp() {
|
||||
if (internalState == InternalState::CONFIGURED) {
|
||||
#if OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP == 1
|
||||
if (goToNormalMode) {
|
||||
setMode(MODE_NORMAL);
|
||||
#else
|
||||
}
|
||||
|
||||
else {
|
||||
setMode(_MODE_TO_ON);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,6 +69,14 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (RAD_SENSOR::START_CONVERSION): {
|
||||
ReturnValue_t result = gpioIF->pullHigh(gpioIds::ENABLE_RADFET);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::warning << "RadiationSensorHandler::buildCommandFromCommand; Pulling RADFET Enale pin "
|
||||
"high failed"
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
/* First the fifo will be reset here */
|
||||
cmdBuffer[0] = RAD_SENSOR::RESET_DEFINITION;
|
||||
cmdBuffer[1] = RAD_SENSOR::CONVERSION_DEFINITION;
|
||||
@ -80,14 +91,6 @@ ReturnValue_t RadiationSensorHandler::buildCommandFromCommand(DeviceCommandId_t
|
||||
rawPacketLen = RAD_SENSOR::READ_SIZE;
|
||||
return RETURN_OK;
|
||||
}
|
||||
// case(RAD_SENSOR::AIN0_AND_TMP_CONVERSION): {
|
||||
// /* First the fifo will be reset here */
|
||||
// cmdBuffer[0] = RAD_SENSOR::RESET_DEFINITION;
|
||||
// cmdBuffer[1] = RAD_SENSOR::CONVERSION_DEFINITION;
|
||||
// rawPacket = cmdBuffer;
|
||||
// rawPacketLen = 2;
|
||||
// return RETURN_OK;
|
||||
// }
|
||||
default:
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
@ -109,6 +112,17 @@ ReturnValue_t RadiationSensorHandler::scanForReply(const uint8_t *start, size_t
|
||||
case RAD_SENSOR::START_CONVERSION:
|
||||
case RAD_SENSOR::WRITE_SETUP:
|
||||
return IGNORE_REPLY_DATA;
|
||||
case RAD_SENSOR::READ_CONVERSIONS: {
|
||||
ReturnValue_t result = gpioIF->pullLow(gpioIds::ENABLE_RADFET);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::warning << "RadiationSensorHandler::buildCommandFromCommand; Pulling RADFET Enale pin "
|
||||
"low failed"
|
||||
<< std::endl;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -124,7 +138,8 @@ ReturnValue_t RadiationSensorHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
case RAD_SENSOR::READ_CONVERSIONS: {
|
||||
uint8_t offset = 0;
|
||||
PoolReadGuard readSet(&dataset);
|
||||
dataset.temperatureCelcius = (*(packet + offset) << 8 | *(packet + offset + 1)) * 0.125;
|
||||
int16_t tempRaw = ((packet[offset] & 0x0f) << 8) | packet[offset + 1];
|
||||
dataset.temperatureCelcius = tempRaw * 0.125;
|
||||
offset += 2;
|
||||
dataset.ain0 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
offset += 2;
|
||||
@ -138,7 +153,7 @@ ReturnValue_t RadiationSensorHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
offset += 2;
|
||||
dataset.ain7 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||
|
||||
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RAD_SENSOR
|
||||
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RAD_SENSOR == 1
|
||||
sif::info << "Radiation sensor temperature: " << dataset.temperatureCelcius << " °C"
|
||||
<< std::endl;
|
||||
sif::info << "Radiation sensor ADC value channel 0: " << dataset.ain0 << std::endl;
|
||||
@ -158,8 +173,6 @@ ReturnValue_t RadiationSensorHandler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void RadiationSensorHandler::setNormalDatapoolEntriesInvalid() {}
|
||||
|
||||
uint32_t RadiationSensorHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) {
|
||||
return 5000;
|
||||
}
|
||||
@ -175,3 +188,5 @@ ReturnValue_t RadiationSensorHandler::initializeLocalDataPool(localpool::DataPoo
|
||||
localDataPoolMap.emplace(RAD_SENSOR::AIN7, new PoolEntry<uint16_t>({0}));
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void RadiationSensorHandler::setToGoToNormalModeImmediately() { this->goToNormalMode = true; }
|
||||
|
@ -4,6 +4,8 @@
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <mission/devices/devicedefinitions/RadSensorDefinitions.h>
|
||||
|
||||
class GpioIF;
|
||||
|
||||
/**
|
||||
* @brief This is the device handler class for radiation sensor on the OBC IF Board. The
|
||||
* sensor is based on the MAX1227 ADC converter.
|
||||
@ -14,8 +16,10 @@
|
||||
*/
|
||||
class RadiationSensorHandler : public DeviceHandlerBase {
|
||||
public:
|
||||
RadiationSensorHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie);
|
||||
RadiationSensorHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
GpioIF *gpioIF);
|
||||
virtual ~RadiationSensorHandler();
|
||||
void setToGoToNormalModeImmediately();
|
||||
|
||||
protected:
|
||||
void doStartUp() override;
|
||||
@ -28,7 +32,6 @@ class RadiationSensorHandler : public DeviceHandlerBase {
|
||||
ReturnValue_t scanForReply(const uint8_t *start, size_t remainingSize, DeviceCommandId_t *foundId,
|
||||
size_t *foundLen) override;
|
||||
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) override;
|
||||
void setNormalDatapoolEntriesInvalid() override;
|
||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) override;
|
||||
@ -39,9 +42,10 @@ class RadiationSensorHandler : public DeviceHandlerBase {
|
||||
enum class InternalState { SETUP, CONFIGURED };
|
||||
|
||||
RAD_SENSOR::RadSensorDataset dataset;
|
||||
|
||||
static const uint8_t MAX_CMD_LEN = RAD_SENSOR::READ_SIZE;
|
||||
GpioIF *gpioIF = nullptr;
|
||||
|
||||
bool goToNormalMode = false;
|
||||
uint8_t cmdBuffer[MAX_CMD_LEN];
|
||||
InternalState internalState = InternalState::SETUP;
|
||||
CommunicationStep communicationStep = CommunicationStep::START_CONVERSION;
|
||||
|
@ -21,8 +21,9 @@ SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId
|
||||
deplSA2(deplSA2),
|
||||
burnTimeMs(burnTimeMs),
|
||||
actionHelper(this, nullptr) {
|
||||
auto mqArgs = MqArgs(setObjectId_, static_cast<void*>(this));
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(
|
||||
cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
||||
cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs);
|
||||
}
|
||||
|
||||
SolarArrayDeploymentHandler::~SolarArrayDeploymentHandler() {}
|
233
mission/devices/SusHandler.cpp
Normal file
233
mission/devices/SusHandler.cpp
Normal file
@ -0,0 +1,233 @@
|
||||
#include "SusHandler.h"
|
||||
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
#include <fsfw/globalfunctions/arrayprinter.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
SusHandler::SusHandler(object_id_t objectId, uint8_t susIdx, object_id_t comIF, CookieIF *comCookie)
|
||||
: DeviceHandlerBase(objectId, comIF, comCookie), divider(5), dataset(this), susIdx(susIdx) {}
|
||||
|
||||
SusHandler::~SusHandler() {}
|
||||
|
||||
ReturnValue_t SusHandler::initialize() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = DeviceHandlerBase::initialize();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void SusHandler::doStartUp() {
|
||||
if (comState == ComStates::IDLE) {
|
||||
comState = ComStates::WRITE_SETUP;
|
||||
commandExecuted = false;
|
||||
}
|
||||
if (comState == ComStates::WRITE_SETUP) {
|
||||
if (commandExecuted) {
|
||||
if (goToNormalModeImmediately) {
|
||||
setMode(MODE_NORMAL);
|
||||
} else {
|
||||
setMode(_MODE_TO_ON);
|
||||
}
|
||||
commandExecuted = false;
|
||||
if (clkMode == ClkModes::INT_CLOCKED) {
|
||||
comState = ComStates::START_INT_CLOCKED_CONVERSIONS;
|
||||
} else {
|
||||
comState = ComStates::EXT_CLOCKED_CONVERSIONS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SusHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
||||
|
||||
ReturnValue_t SusHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||
switch (comState) {
|
||||
case (ComStates::IDLE): {
|
||||
break;
|
||||
}
|
||||
case (ComStates::WRITE_SETUP): {
|
||||
*id = SUS::WRITE_SETUP;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
case (ComStates::EXT_CLOCKED_CONVERSIONS): {
|
||||
*id = SUS::READ_EXT_TIMED_CONVERSIONS;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
case (ComStates::START_INT_CLOCKED_CONVERSIONS): {
|
||||
*id = SUS::START_INT_TIMED_CONVERSIONS;
|
||||
comState = ComStates::READ_INT_CLOCKED_CONVERSIONS;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
case (ComStates::READ_INT_CLOCKED_CONVERSIONS): {
|
||||
*id = SUS::READ_INT_TIMED_CONVERSIONS;
|
||||
comState = ComStates::START_INT_CLOCKED_CONVERSIONS;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
case (ComStates::EXT_CLOCKED_TEMP): {
|
||||
*id = SUS::READ_EXT_TIMED_TEMPS;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
}
|
||||
return NOTHING_TO_SEND;
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::buildTransitionDeviceCommand(DeviceCommandId_t *id) {
|
||||
if (comState == ComStates::WRITE_SETUP) {
|
||||
*id = SUS::WRITE_SETUP;
|
||||
return buildCommandFromCommand(*id, nullptr, 0);
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
|
||||
const uint8_t *commandData,
|
||||
size_t commandDataLen) {
|
||||
using namespace max1227;
|
||||
switch (deviceCommand) {
|
||||
case (SUS::WRITE_SETUP): {
|
||||
if (clkMode == ClkModes::INT_CLOCKED) {
|
||||
cmdBuffer[0] = SUS::SETUP_INT_CLOKED;
|
||||
} else {
|
||||
cmdBuffer[0] = SUS::SETUP_EXT_CLOCKED;
|
||||
}
|
||||
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = 1;
|
||||
break;
|
||||
}
|
||||
case (SUS::START_INT_TIMED_CONVERSIONS): {
|
||||
std::memset(cmdBuffer, 0, sizeof(cmdBuffer));
|
||||
cmdBuffer[0] = max1227::buildResetByte(true);
|
||||
cmdBuffer[1] = SUS::CONVERSION;
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = 2;
|
||||
break;
|
||||
}
|
||||
case (SUS::READ_INT_TIMED_CONVERSIONS): {
|
||||
std::memset(cmdBuffer, 0, sizeof(cmdBuffer));
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = SUS::SIZE_READ_INT_CONVERSIONS;
|
||||
break;
|
||||
}
|
||||
case (SUS::READ_EXT_TIMED_CONVERSIONS): {
|
||||
std::memset(cmdBuffer, 0, sizeof(cmdBuffer));
|
||||
rawPacket = cmdBuffer;
|
||||
for (uint8_t idx = 0; idx < 6; idx++) {
|
||||
cmdBuffer[idx * 2] = buildConvByte(ScanModes::N_ONCE, idx, false);
|
||||
cmdBuffer[idx * 2 + 1] = 0;
|
||||
}
|
||||
cmdBuffer[12] = 0x00;
|
||||
rawPacketLen = SUS::SIZE_READ_EXT_CONVERSIONS;
|
||||
break;
|
||||
}
|
||||
case (SUS::READ_EXT_TIMED_TEMPS): {
|
||||
cmdBuffer[0] = buildConvByte(ScanModes::N_ONCE, 0, true);
|
||||
std::memset(cmdBuffer + 1, 0, 24);
|
||||
rawPacket = cmdBuffer;
|
||||
rawPacketLen = 25;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void SusHandler::fillCommandAndReplyMap() {
|
||||
insertInCommandAndReplyMap(SUS::WRITE_SETUP, 1);
|
||||
insertInCommandAndReplyMap(SUS::START_INT_TIMED_CONVERSIONS, 1);
|
||||
insertInCommandAndReplyMap(SUS::READ_INT_TIMED_CONVERSIONS, 1, &dataset,
|
||||
SUS::SIZE_READ_INT_CONVERSIONS);
|
||||
insertInCommandAndReplyMap(SUS::READ_EXT_TIMED_CONVERSIONS, 1, &dataset,
|
||||
SUS::SIZE_READ_EXT_CONVERSIONS);
|
||||
insertInCommandAndReplyMap(SUS::READ_EXT_TIMED_TEMPS, 1);
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::scanForReply(const uint8_t *start, size_t remainingSize,
|
||||
DeviceCommandId_t *foundId, size_t *foundLen) {
|
||||
*foundId = this->getPendingCommand();
|
||||
*foundLen = remainingSize;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t *packet) {
|
||||
switch (id) {
|
||||
case SUS::WRITE_SETUP: {
|
||||
if (mode == _MODE_START_UP) {
|
||||
commandExecuted = true;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
case SUS::START_INT_TIMED_CONVERSIONS: {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
case SUS::READ_INT_TIMED_CONVERSIONS: {
|
||||
PoolReadGuard readSet(&dataset);
|
||||
|
||||
dataset.temperatureCelcius = max1227::getTemperature(((packet[0] & 0x0f) << 8) | packet[1]);
|
||||
for (uint8_t idx = 0; idx < 6; idx++) {
|
||||
dataset.channels[idx] = packet[idx * 2 + 2] << 8 | packet[idx * 2 + 3];
|
||||
}
|
||||
printDataset();
|
||||
break;
|
||||
}
|
||||
case (SUS::READ_EXT_TIMED_CONVERSIONS): {
|
||||
PoolReadGuard readSet(&dataset);
|
||||
for (uint8_t idx = 0; idx < 6; idx++) {
|
||||
dataset.channels[idx] = packet[idx * 2 + 1] << 8 | packet[idx * 2 + 2];
|
||||
}
|
||||
// Read temperature in next read cycle
|
||||
if (clkMode == ClkModes::EXT_CLOCKED_WITH_TEMP) {
|
||||
comState = ComStates::EXT_CLOCKED_TEMP;
|
||||
}
|
||||
printDataset();
|
||||
break;
|
||||
}
|
||||
case (SUS::READ_EXT_TIMED_TEMPS): {
|
||||
PoolReadGuard readSet(&dataset);
|
||||
dataset.temperatureCelcius = max1227::getTemperature(((packet[23] & 0x0f) << 8) | packet[24]);
|
||||
comState = ComStates::EXT_CLOCKED_CONVERSIONS;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
sif::debug << "SusHandler::interpretDeviceReply: Unknown reply id" << std::endl;
|
||||
return DeviceHandlerIF::UNKNOWN_DEVICE_REPLY;
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
uint32_t SusHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) { return 2000; }
|
||||
|
||||
ReturnValue_t SusHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
localDataPoolMap.emplace(SUS::TEMPERATURE_C, &tempC);
|
||||
localDataPoolMap.emplace(SUS::CHANNEL_VEC, &channelVec);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void SusHandler::setToGoToNormalMode(bool enable) { this->goToNormalModeImmediately = enable; }
|
||||
|
||||
void SusHandler::printDataset() {
|
||||
if (periodicPrintout) {
|
||||
if (divider.checkAndIncrement()) {
|
||||
sif::info << "SUS ADC " << static_cast<int>(susIdx) << " hex [" << std::setfill('0')
|
||||
<< std::hex;
|
||||
for (uint8_t idx = 0; idx < 6; idx++) {
|
||||
sif::info << std::setw(3) << dataset.channels[idx];
|
||||
if (idx < 6 - 1) {
|
||||
sif::info << ",";
|
||||
}
|
||||
}
|
||||
sif::info << "] | T[C] " << std::dec << dataset.temperatureCelcius.value << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SusHandler::enablePeriodicPrintout(bool enable, uint8_t divider) {
|
||||
this->periodicPrintout = enable;
|
||||
this->divider.setDivider(divider);
|
||||
}
|
@ -2,16 +2,18 @@
|
||||
#define MISSION_DEVICES_SUSHANDLER_H_
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||
|
||||
#include "devicedefinitions/SusDefinitions.h"
|
||||
#include "fsfw/globalfunctions/PeriodicOperationDivider.h"
|
||||
#include "mission/devices/max1227.h"
|
||||
|
||||
/**
|
||||
* @brief This is the device handler class for the SUS sensor. The sensor is
|
||||
* based on the MAX1227 ADC. Details about the SUS electronic can be found at
|
||||
* https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release
|
||||
* @brief This is the device handler class for the SUS sensor based on the MAX1227 ADC.
|
||||
*
|
||||
* @details Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf
|
||||
* @details
|
||||
* Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf
|
||||
* Details about the SUS electronic can be found at
|
||||
* https://egit.irs.uni-stuttgart.de/eive/eive_dokumente/src/branch/master/400_Raumsegment/443_SunSensorDocumentation/release
|
||||
*
|
||||
* @note When adding a SusHandler to the polling sequence table make sure to add a slot with
|
||||
* the executionStep FIRST_WRITE. Otherwise the communication sequence will never be
|
||||
@ -21,15 +23,17 @@
|
||||
*/
|
||||
class SusHandler : public DeviceHandlerBase {
|
||||
public:
|
||||
enum ClkModes { INT_CLOCKED, EXT_CLOCKED, EXT_CLOCKED_WITH_TEMP };
|
||||
|
||||
static const uint8_t FIRST_WRITE = 7;
|
||||
|
||||
SusHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
|
||||
LinuxLibgpioIF* gpioComIF, gpioId_t chipSelectId);
|
||||
SusHandler(object_id_t objectId, uint8_t susIdx, object_id_t comIF, CookieIF* comCookie);
|
||||
virtual ~SusHandler();
|
||||
|
||||
virtual ReturnValue_t performOperation(uint8_t counter) override;
|
||||
void enablePeriodicPrintout(bool enable, uint8_t divider);
|
||||
|
||||
virtual ReturnValue_t initialize() override;
|
||||
void setToGoToNormalMode(bool enable);
|
||||
|
||||
protected:
|
||||
void doStartUp() override;
|
||||
@ -42,7 +46,6 @@ class SusHandler : public DeviceHandlerBase {
|
||||
ReturnValue_t scanForReply(const uint8_t* start, size_t remainingSize, DeviceCommandId_t* foundId,
|
||||
size_t* foundLen) override;
|
||||
ReturnValue_t interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) override;
|
||||
void setNormalDatapoolEntriesInvalid() override;
|
||||
uint32_t getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo) override;
|
||||
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
LocalDataPoolManager& poolManager) override;
|
||||
@ -53,19 +56,34 @@ class SusHandler : public DeviceHandlerBase {
|
||||
static const ReturnValue_t ERROR_UNLOCK_MUTEX = MAKE_RETURN_CODE(0xA0);
|
||||
static const ReturnValue_t ERROR_LOCK_MUTEX = MAKE_RETURN_CODE(0xA1);
|
||||
|
||||
enum class CommunicationStep { IDLE, WRITE_SETUP, START_CONVERSIONS, READ_CONVERSIONS };
|
||||
enum class ComStates {
|
||||
IDLE,
|
||||
WRITE_SETUP,
|
||||
EXT_CLOCKED_CONVERSIONS,
|
||||
EXT_CLOCKED_TEMP,
|
||||
START_INT_CLOCKED_CONVERSIONS,
|
||||
READ_INT_CLOCKED_CONVERSIONS
|
||||
};
|
||||
|
||||
LinuxLibgpioIF* gpioComIF = nullptr;
|
||||
|
||||
gpioId_t chipSelectId = gpio::NO_GPIO;
|
||||
bool periodicPrintout = false;
|
||||
PeriodicOperationDivider divider;
|
||||
bool goToNormalModeImmediately = false;
|
||||
bool commandExecuted = false;
|
||||
|
||||
SUS::SusDataset dataset;
|
||||
// Read temperature in each alternating communication step when using
|
||||
// externally clocked mode
|
||||
ClkModes clkMode = ClkModes::INT_CLOCKED;
|
||||
PoolEntry<float> tempC = PoolEntry<float>({0.0});
|
||||
PoolEntry<uint16_t> channelVec = PoolEntry<uint16_t>({0, 0, 0, 0, 0, 0});
|
||||
|
||||
uint8_t susIdx = 0;
|
||||
uint8_t cmdBuffer[SUS::MAX_CMD_SIZE];
|
||||
CommunicationStep communicationStep = CommunicationStep::IDLE;
|
||||
ComStates comState = ComStates::IDLE;
|
||||
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
uint32_t timeoutMs = 20;
|
||||
void printDataset();
|
||||
|
||||
MutexIF* spiMutex = nullptr;
|
||||
};
|
@ -8,25 +8,23 @@
|
||||
|
||||
namespace SUS {
|
||||
|
||||
/**
|
||||
* Some MAX1227 could not be reached with frequencies around 4 MHz. Maybe this is caused by
|
||||
* the decoder and buffer circuits. Thus frequency is here defined to 1 MHz.
|
||||
*/
|
||||
static const uint32_t MAX1227_SPI_FREQ = 1000000;
|
||||
|
||||
static const DeviceCommandId_t NONE = 0x0; // Set when no command is pending
|
||||
|
||||
static const DeviceCommandId_t WRITE_SETUP = 0x1;
|
||||
static const DeviceCommandId_t WRITE_SETUP = 1;
|
||||
/**
|
||||
* This command initiates the ADC conversion for all channels including the internal
|
||||
* temperature sensor.
|
||||
*/
|
||||
static const DeviceCommandId_t START_CONVERSIONS = 0x2;
|
||||
static const DeviceCommandId_t START_INT_TIMED_CONVERSIONS = 2;
|
||||
/**
|
||||
* This command reads the internal fifo which holds the temperature and the channel
|
||||
* conversions.
|
||||
*/
|
||||
static const DeviceCommandId_t READ_CONVERSIONS = 0x3;
|
||||
static constexpr DeviceCommandId_t READ_INT_TIMED_CONVERSIONS = 3;
|
||||
|
||||
static constexpr DeviceCommandId_t READ_EXT_TIMED_CONVERSIONS = 4;
|
||||
|
||||
static constexpr DeviceCommandId_t READ_EXT_TIMED_TEMPS = 5;
|
||||
|
||||
/**
|
||||
* @brief This is the configuration byte which will be written to the setup register after
|
||||
@ -39,7 +37,8 @@ static const DeviceCommandId_t READ_CONVERSIONS = 0x3;
|
||||
* written to the setup register
|
||||
*
|
||||
*/
|
||||
static const uint8_t SETUP = 0b01101000;
|
||||
static constexpr uint8_t SETUP_INT_CLOKED = 0b01101000;
|
||||
static constexpr uint8_t SETUP_EXT_CLOCKED = 0b01111000;
|
||||
|
||||
/**
|
||||
* @brief This values will always be written to the ADC conversion register to specify the
|
||||
@ -51,24 +50,18 @@ static const uint8_t SETUP = 0b01101000;
|
||||
*/
|
||||
static const uint8_t CONVERSION = 0b10101001;
|
||||
|
||||
static const uint8_t SUS_DATA_SET_ID = READ_CONVERSIONS;
|
||||
static const uint8_t SUS_DATA_SET_ID = READ_INT_TIMED_CONVERSIONS;
|
||||
|
||||
/** Size of data replies. Temperature and 6 channel convesions (AIN0 - AIN5) */
|
||||
static const uint8_t SIZE_READ_CONVERSIONS = 14;
|
||||
static const uint8_t SIZE_READ_INT_CONVERSIONS = 14;
|
||||
// 6 * conv byte, 6 * 0 and one trailing zero
|
||||
static constexpr uint8_t SIZE_READ_EXT_CONVERSIONS = 13;
|
||||
|
||||
static const uint8_t MAX_CMD_SIZE = SIZE_READ_CONVERSIONS;
|
||||
static const uint8_t MAX_CMD_SIZE = 32;
|
||||
|
||||
static const uint8_t POOL_ENTRIES = 7;
|
||||
|
||||
enum Max1227PoolIds : lp_id_t {
|
||||
TEMPERATURE_C,
|
||||
AIN0,
|
||||
AIN1,
|
||||
AIN2,
|
||||
AIN3,
|
||||
AIN4,
|
||||
AIN5,
|
||||
};
|
||||
enum Max1227PoolIds : lp_id_t { TEMPERATURE_C, CHANNEL_VEC };
|
||||
|
||||
class SusDataset : public StaticLocalDataSet<POOL_ENTRIES> {
|
||||
public:
|
||||
@ -77,12 +70,7 @@ class SusDataset : public StaticLocalDataSet<POOL_ENTRIES> {
|
||||
SusDataset(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, SUS_DATA_SET_ID)) {}
|
||||
|
||||
lp_var_t<float> temperatureCelcius = lp_var_t<float>(sid.objectId, TEMPERATURE_C, this);
|
||||
lp_var_t<uint16_t> ain0 = lp_var_t<uint16_t>(sid.objectId, AIN0, this);
|
||||
lp_var_t<uint16_t> ain1 = lp_var_t<uint16_t>(sid.objectId, AIN1, this);
|
||||
lp_var_t<uint16_t> ain2 = lp_var_t<uint16_t>(sid.objectId, AIN2, this);
|
||||
lp_var_t<uint16_t> ain3 = lp_var_t<uint16_t>(sid.objectId, AIN3, this);
|
||||
lp_var_t<uint16_t> ain4 = lp_var_t<uint16_t>(sid.objectId, AIN4, this);
|
||||
lp_var_t<uint16_t> ain5 = lp_var_t<uint16_t>(sid.objectId, AIN5, this);
|
||||
lp_vec_t<uint16_t, 6> channels = lp_vec_t<uint16_t, 6>(sid.objectId, CHANNEL_VEC, this);
|
||||
};
|
||||
} // namespace SUS
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user