Merge remote-tracking branch 'upstream/mueller/master' into mueller/master

This commit is contained in:
Robin Müller 2021-07-19 18:50:20 +02:00
commit bdc5f593e2
776 changed files with 545 additions and 184 deletions

View File

@ -1,17 +1,81 @@
## Changes from ASTP 1.0.0 to 1.1.0 # Changed from ASTP 1.1.0 to 1.2.0
## API Changes
### FSFW Architecture
- New src folder which contains all source files except the HAL, contributed code and test code
- External and internal API mostly stayed the same
- Folder names are now all smaller case: internalError was renamed to internalerror and
FreeRTOS was renamed to freertos
- Warning if optional headers are used but the modules was not added to the source files to compile
### HAL
- HAL added back into FSFW. It is tightly bound to the FSFW, and compiling it as a static library
made using it more complicated than necessary
## Bugfixes
### FreeRTOS QueueMapManager
- Fixed a bug which causes the first generated Queue ID to be invalid
## Enhancements
### FSFW Architecture
- See API changes chapter. This change will keep the internal API consistent in the future
# Changes from ASTP 1.0.0 to 1.1.0
## API Changes
### PUS ### PUS
- Added PUS C support - Added PUS C support
- SUBSYSTEM_IDs added for PUS Services
- Added new Parameter which must be defined in config: fsfwconfig::FSFW_MAX_TM_PACKET_SIZE
### ObjectManager
- ObjectManager is now a singelton
### Configuration ### Configuration
- Additional configuration option fsfwconfig::FSFW_MAX_TM_PACKET_SIZE which - Additional configuration option fsfwconfig::FSFW_MAX_TM_PACKET_SIZE which
need to be specified in FSFWConfig.h need to be specified in FSFWConfig.h
### CMake
- Changed Cmake FSFW_ADDITIONAL_INC_PATH to FSFW_ADDITIONAL_INC_PATHS
## Bugfixes
- timemanager/TimeStamperIF.h: Timestamp config was not used correctly, leading to different timestamp sizes than configured in fsfwconfig::FSFW_MISSION_TIMESTAMP_SIZE
- TCP server fixes
## Enhancements
### FreeRTOS Queue Handles
- Fixed an internal issue how FreeRTOS MessageQueues were handled
### Linux OSAL
- Better printf error messages
### CMake
- Check for C++11 as mininimum required Version
### Debug Output
- Changed Warning color to magenta, which is well readable on both dark and light mode IDEs
## Changes from ASTP 0.0.1 to 1.0.0 # Changes from ASTP 0.0.1 to 1.0.0
### Host OSAL ### Host OSAL

View File

@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.13)
option(FSFW_GENERATE_SECTIONS option(FSFW_GENERATE_SECTIONS
"Generate function and data sections. Required to remove unused code" ON "Generate function and data sections. Required to remove unused code" ON
) )
if(FSFW_GENERATE_SECTIONS) if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON) option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif() endif()
@ -11,9 +10,18 @@ endif()
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON) option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
# Options to exclude parts of the FSFW from compilation. # Options to exclude parts of the FSFW from compilation.
option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON) option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON)
option(FSFW_USE_RMAP "Compile with RMAP" ON)
option(FSFW_USE_DATALINKLAYER "Compile with Data Link Layer" ON) # Optional sources
option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" ON) option(FSFW_ADD_PUS "Compile with PUS sources" ON)
option(FSFW_ADD_MONITORING "Compile with monitoring components" ON)
option(FSFW_ADD_RMAP "Compile with RMAP" OFF)
option(FSFW_ADD_DATALINKLAYER "Compile with Data Link Layer" OFF)
option(FSFW_ADD_COORDINATES "Compile with coordinate components" OFF)
option(FSFW_ADD_TMSTORAGE "Compile with tm storage components" OFF)
# Contrib sources
option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" OFF)
set(LIB_FSFW_NAME fsfw) set(LIB_FSFW_NAME fsfw)
add_library(${LIB_FSFW_NAME}) add_library(${LIB_FSFW_NAME})

View File

@ -12,7 +12,6 @@ set(LINUX_HAL_PATH_NAME linux)
set(STM32H7_PATH_NAME stm32h7) set(STM32H7_PATH_NAME stm32h7)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(inc)
foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS}) foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS})
if(IS_ABSOLUTE ${INCLUDE_PATH}) if(IS_ABSOLUTE ${INCLUDE_PATH})

View File

@ -1,7 +0,0 @@
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
)

View File

@ -1,10 +1,9 @@
add_subdirectory(devicehandlers) target_include_directories(${LIB_FSFW_NAME} PRIVATE
add_subdirectory(common) ${CMAKE_CURRENT_SOURCE_DIR}
)
if(FSFW_HAL_ADD_LINUX) target_include_directories(${LIB_FSFW_NAME} INTERFACE
add_subdirectory(${LINUX_HAL_PATH_NAME}) ${CMAKE_CURRENT_SOURCE_DIR}
endif() )
if(FSFW_HAL_ADD_STM32H7) add_subdirectory(fsfw)
add_subdirectory(${STM32H7_PATH_NAME})
endif()

View File

@ -0,0 +1 @@
add_subdirectory(hal)

View File

@ -0,0 +1,10 @@
add_subdirectory(devicehandlers)
add_subdirectory(common)
if(FSFW_HAL_ADD_LINUX)
add_subdirectory(linux)
endif()
if(FSFW_HAL_ADD_STM32H7)
add_subdirectory(stm32h7)
endif()

View File

@ -3,10 +3,10 @@
#include "spiDefinitions.h" #include "spiDefinitions.h"
#include "returnvalues/classIds.h" #include "returnvalues/classIds.h"
#include "../../common/gpio/GpioIF.h" #include "fsfw/hal/common/gpio/GpioIF.h"
#include <fsfw/devicehandlers/DeviceCommunicationIF.h> #include "fsfw/devicehandlers/DeviceCommunicationIF.h"
#include <fsfw/objectmanager/SystemObject.h> #include "fsfw/objectmanager/SystemObject.h"
#include <vector> #include <vector>
#include <unordered_map> #include <unordered_map>

View File

@ -1,15 +1,14 @@
#include "GyroL3GD20H.h" #include "fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h"
#include "../spi/mspInit.h" #include "fsfw/hal/stm32h7/spi/mspInit.h"
#include "../spi/spiDefinitions.h" #include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
#include "../spi/spiCore.h" #include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "../spi/spiInterrupts.h" #include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
#include "../spi/stm32h743ziSpi.h" #include "fsfw/hal/stm32h7/spi/stm32h743ziSpi.h"
#include "fsfw/tasks/TaskFactory.h" #include "fsfw/tasks/TaskFactory.h"
#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "stm32h7xx_nucleo.h"
#include "stm32h7xx_hal_spi.h" #include "stm32h7xx_hal_spi.h"
#include "stm32h7xx_hal_rcc.h" #include "stm32h7xx_hal_rcc.h"

View File

@ -1,6 +1,7 @@
#include <fsfw_hal/stm32h7/dma.h> #include <fsfw/hal/stm32h7/dma.h>
#include <stdint.h>
#include <stddef.h> #include <cstdint>
#include <cstddef>
user_handler_t DMA_1_USER_HANDLERS[8]; user_handler_t DMA_1_USER_HANDLERS[8];
user_args_t DMA_1_USER_ARGS[8]; user_args_t DMA_1_USER_ARGS[8];

View File

@ -1,4 +1,4 @@
#include "gpio.h" #include "fsfw/hal/stm32h7/gpio/gpio.h"
#include "stm32h7xx_hal_rcc.h" #include "stm32h7xx_hal_rcc.h"

View File

@ -9,6 +9,4 @@ void initializeGpioClock(GPIO_TypeDef* gpioPort);
} }
#endif /* FSFW_HAL_STM32H7_GPIO_GPIO_H_ */ #endif /* FSFW_HAL_STM32H7_GPIO_GPIO_H_ */

View File

@ -1,12 +1,21 @@
#include "SpiComIF.h" #include "fsfw/hal/stm32h7/spi/SpiComIF.h"
#include "SpiCookie.h" #include "fsfw/hal/stm32h7/spi/SpiCookie.h"
#include "fsfw/tasks/SemaphoreFactory.h" #include "fsfw/tasks/SemaphoreFactory.h"
#include "fsfw/osal/FreeRTOS/TaskManagement.h" #include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "fsfw_hal/stm32h7/spi/spiCore.h" #include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
#include "fsfw_hal/stm32h7/spi/spiInterrupts.h" #include "fsfw/hal/stm32h7/spi/mspInit.h"
#include "fsfw_hal/stm32h7/spi/mspInit.h" #include "fsfw/hal/stm32h7/gpio/gpio.h"
#include "fsfw_hal/stm32h7/gpio/gpio.h"
// FreeRTOS required special Semaphore handling from an ISR. Therefore, we use the concrete
// instance here, because RTEMS and FreeRTOS are the only relevant OSALs currently
// and it is not trivial to add a releaseFromISR to the SemaphoreIF
#if defined FSFW_OSAL_RTEMS
#include "fsfw/osal/rtems/BinarySemaphore.h"
#elif defined FSFW_OSAL_FREERTOS
#include "fsfw/osal/freertos/TaskManagement.h"
#include "fsfw/osal/freertos/BinarySemaphore.h"
#endif
#include "stm32h7xx_hal_gpio.h" #include "stm32h7xx_hal_gpio.h"
@ -421,10 +430,14 @@ void SpiComIF::genericIrqHandler(void *irqArgsVoid, spi::TransferStates targetSt
HAL_GPIO_WritePin(spiCookie->getChipSelectGpioPort(), spiCookie->getChipSelectGpioPin(), HAL_GPIO_WritePin(spiCookie->getChipSelectGpioPort(), spiCookie->getChipSelectGpioPin(),
GPIO_PIN_SET); GPIO_PIN_SET);
#if defined FSFW_OSAL_FREERTOS
// Release the task semaphore // Release the task semaphore
BaseType_t taskWoken = pdFALSE; BaseType_t taskWoken = pdFALSE;
ReturnValue_t result = BinarySemaphore::releaseFromISR(comIF->spiSemaphore->getSemaphore(), ReturnValue_t result = BinarySemaphore::releaseFromISR(comIF->spiSemaphore->getSemaphore(),
&taskWoken); &taskWoken);
#elif defined FSFW_OSAL_RTEMS
ReturnValue_t result = comIF->spiSemaphore->release();
#endif
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
// Configuration error // Configuration error
printf("SpiComIF::genericIrqHandler: Failure releasing Semaphore!\n"); printf("SpiComIF::genericIrqHandler: Failure releasing Semaphore!\n");
@ -436,11 +449,13 @@ void SpiComIF::genericIrqHandler(void *irqArgsVoid, spi::TransferStates targetSt
SCB_InvalidateDCache_by_Addr ((uint32_t *) comIF->currentRecvPtr, SCB_InvalidateDCache_by_Addr ((uint32_t *) comIF->currentRecvPtr,
comIF->currentRecvBuffSize); comIF->currentRecvBuffSize);
} }
#if defined FSFW_OSAL_FREERTOS
/* Request a context switch if the SPI ComIF task was woken up and has a higher priority /* Request a context switch if the SPI ComIF task was woken up and has a higher priority
than the currently running task */ than the currently running task */
if(taskWoken == pdTRUE) { if(taskWoken == pdTRUE) {
TaskManagement::requestContextSwitch(CallContext::ISR); TaskManagement::requestContextSwitch(CallContext::ISR);
} }
#endif
} }
void SpiComIF::printCfgError(const char *const type) { void SpiComIF::printCfgError(const char *const type) {

View File

@ -5,8 +5,7 @@
#include "fsfw/devicehandlers/DeviceCommunicationIF.h" #include "fsfw/devicehandlers/DeviceCommunicationIF.h"
#include "fsfw/objectmanager/SystemObject.h" #include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/osal/FreeRTOS/BinarySemaphore.h" #include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
#include "fsfw_hal/stm32h7/spi/spiDefinitions.h"
#include "stm32h7xx_hal_spi.h" #include "stm32h7xx_hal_spi.h"
#include "stm32h743xx.h" #include "stm32h743xx.h"
@ -14,6 +13,7 @@
#include <map> #include <map>
class SpiCookie; class SpiCookie;
class BinarySemaphore;
/** /**
* @brief This communication interface allows using generic device handlers with using * @brief This communication interface allows using generic device handlers with using

View File

@ -1,4 +1,4 @@
#include "SpiCookie.h" #include "fsfw/hal/stm32h7/spi/SpiCookie.h"
SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, spi::TransferModes transferMode, SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, spi::TransferModes transferMode,

View File

@ -1,13 +1,14 @@
#include <fsfw_hal/stm32h7/dma.h> #include "fsfw/hal/stm32h7/dma.h"
#include "mspInit.h" #include "fsfw/hal/stm32h7/spi/mspInit.h"
#include "spiCore.h" #include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "spiInterrupts.h" #include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
#include "stm32h743xx.h" #include "stm32h743xx.h"
#include "stm32h7xx_hal_spi.h" #include "stm32h7xx_hal_spi.h"
#include "stm32h7xx_hal_dma.h" #include "stm32h7xx_hal_dma.h"
#include "stm32h7xx_hal_def.h" #include "stm32h7xx_hal_def.h"
#include <stdio.h> #include <cstdio>
spi::msp_func_t mspInitFunc = nullptr; spi::msp_func_t mspInitFunc = nullptr;
spi::MspCfgBase* mspInitArgs = nullptr; spi::MspCfgBase* mspInitArgs = nullptr;

View File

@ -1,5 +1,6 @@
#include "spiDefinitions.h" #include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "spiCore.h" #include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
#include <cstdio> #include <cstdio>
SPI_HandleTypeDef* spiHandle = nullptr; SPI_HandleTypeDef* spiHandle = nullptr;

View File

@ -1,11 +1,12 @@
#ifndef FSFW_HAL_STM32H7_SPI_SPICORE_H_ #ifndef FSFW_HAL_STM32H7_SPI_SPICORE_H_
#define FSFW_HAL_STM32H7_SPI_SPICORE_H_ #define FSFW_HAL_STM32H7_SPI_SPICORE_H_
#include <fsfw_hal/stm32h7/dma.h> #include "fsfw/hal/stm32h7/dma.h"
#include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
#include "stm32h7xx_hal.h" #include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_dma.h" #include "stm32h7xx_hal_dma.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -1,4 +1,4 @@
#include "spiDefinitions.h" #include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
void spi::assignSpiMode(SpiModes spiMode, SPI_HandleTypeDef& spiHandle) { void spi::assignSpiMode(SpiModes spiMode, SPI_HandleTypeDef& spiHandle) {
switch(spiMode) { switch(spiMode) {

View File

@ -1,5 +1,5 @@
#include "spiInterrupts.h" #include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
#include "spiCore.h" #include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "stm32h7xx_hal.h" #include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_dma.h" #include "stm32h7xx_hal_dma.h"

View File

@ -1,6 +1,7 @@
#include "stm32h743ziSpi.h" #include "fsfw/hal/stm32h7/spi/stm32h743ziSpi.h"
#include "spiCore.h" #include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "spiInterrupts.h" #include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
#include "stm32h7xx_hal.h" #include "stm32h7xx_hal.h"
#include "stm32h7xx_hal_rcc.h" #include "stm32h7xx_hal_rcc.h"

View File

@ -1,7 +0,0 @@
#ifndef FSFW_FSFW_H_
#define FSFW_FSFW_H_
#include "FSFWConfig.h"
#endif /* FSFW_FSFW_H_ */

View File

@ -1,11 +0,0 @@
#ifndef FSFW_INC_FSFW_ACTION_H_
#define FSFW_INC_FSFW_ACTION_H_
#include "action/ActionHelper.h"
#include "action/ActionMessage.h"
#include "action/CommandActionHelper.h"
#include "action/HasActionsIF.h"
#include "action/CommandsActionsIF.h"
#include "action/SimpleActionHelper.h"
#endif /* FSFW_INC_FSFW_ACTION_H_ */

View File

@ -1,12 +0,0 @@
#ifndef FSFW_DATAPOOLLOCAL_DATAPOOLLOCAL_H_
#define FSFW_DATAPOOLLOCAL_DATAPOOLLOCAL_H_
/* Collected related headers */
#include "datapoollocal/LocalPoolVariable.h"
#include "datapoollocal/LocalPoolVector.h"
#include "datapoollocal/StaticLocalDataSet.h"
#include "datapoollocal/LocalDataSet.h"
#include "datapoollocal/SharedLocalDataSet.h"
#endif /* FSFW_DATAPOOLLOCAL_DATAPOOLLOCAL_H_ */

View File

@ -1,3 +1,20 @@
add_subdirectory(core) target_include_directories(${LIB_FSFW_NAME} PRIVATE
add_subdirectory(opt) ${CMAKE_CURRENT_SOURCE_DIR}
add_subdirectory(osal) )
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
)
add_subdirectory(fsfw)
# Configure File
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
)
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_BINARY_DIR}
)
configure_file(fsfw/FSFW.h.in fsfw/FSFW.h)

View File

@ -1,10 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
AssemblyBase.cpp
ChildHandlerBase.cpp
ChildHandlerFDIR.cpp
DeviceHandlerBase.cpp
DeviceHandlerFailureIsolation.cpp
DeviceHandlerMessage.cpp
DeviceTmReportingWrapper.cpp
HealthDevice.cpp
)

View File

@ -1,4 +0,0 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
HousekeepingMessage.cpp
PeriodicHousekeepingHelper.cpp
)

View File

@ -1,3 +1,5 @@
# Core
add_subdirectory(action) add_subdirectory(action)
add_subdirectory(container) add_subdirectory(container)
add_subdirectory(controller) add_subdirectory(controller)
@ -26,3 +28,28 @@ add_subdirectory(thermal)
add_subdirectory(timemanager) add_subdirectory(timemanager)
add_subdirectory(tmtcpacket) add_subdirectory(tmtcpacket)
add_subdirectory(tmtcservices) add_subdirectory(tmtcservices)
# Optional
if(FSFW_ADD_MONITORING)
add_subdirectory(monitoring)
endif()
if(FSFW_ADD_PUS)
add_subdirectory(pus)
endif()
if(FSFW_ADD_TMSTORAGE)
add_subdirectory(tmstorage)
endif()
if(FSFW_ADD_COORDINATES)
add_subdirectory(coordinates)
endif()
if(FSFW_ADD_RMAP)
add_subdirectory(rmap)
endif()
if(FSFW_ADD_DATALINKLAYER)
add_subdirectory(datalinklayer)
endif()
# OSAL
add_subdirectory(osal)

13
src/fsfw/FSFW.h.in Normal file
View File

@ -0,0 +1,13 @@
#ifndef FSFW_FSFW_H_
#define FSFW_FSFW_H_
#include "FSFWConfig.h"
#cmakedefine FSFW_ADD_RMAP
#cmakedefine FSFW_ADD_DATALINKLAYER
#cmakedefine FSFW_ADD_TMSTORAGE
#cmakedefine FSFW_ADD_COORDINATES
#cmakedefine FSFW_ADD_PUS
#cmakedefine FSFW_ADD_MONITORING
#endif /* FSFW_FSFW_H_ */

11
src/fsfw/action.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef FSFW_INC_FSFW_ACTION_H_
#define FSFW_INC_FSFW_ACTION_H_
#include "fsfw/action/ActionHelper.h"
#include "fsfw/action/ActionMessage.h"
#include "fsfw/action/CommandActionHelper.h"
#include "fsfw/action/HasActionsIF.h"
#include "fsfw/action/CommandsActionsIF.h"
#include "fsfw/action/SimpleActionHelper.h"
#endif /* FSFW_INC_FSFW_ACTION_H_ */

Some files were not shown because too many files have changed in this diff Show More