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

This commit is contained in:
Robin Müller 2021-07-19 18:49:05 +02:00
commit 77257320fe
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
779 changed files with 536 additions and 146 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
- 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
- Additional configuration option fsfwconfig::FSFW_MAX_TM_PACKET_SIZE which
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

View File

@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.13)
option(FSFW_GENERATE_SECTIONS
"Generate function and data sections. Required to remove unused code" ON
)
if(FSFW_GENERATE_SECTIONS)
option(FSFW_REMOVE_UNUSED_CODE "Remove unused code" ON)
endif()
@ -11,9 +10,18 @@ endif()
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
# Options to exclude parts of the FSFW from compilation.
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)
option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" ON)
# Optional sources
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)
add_library(${LIB_FSFW_NAME})

View File

@ -12,7 +12,6 @@ set(LINUX_HAL_PATH_NAME linux)
set(STM32H7_PATH_NAME stm32h7)
add_subdirectory(src)
add_subdirectory(inc)
foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS})
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)
add_subdirectory(common)
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
if(FSFW_HAL_ADD_LINUX)
add_subdirectory(${LINUX_HAL_PATH_NAME})
endif()
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
)
if(FSFW_HAL_ADD_STM32H7)
add_subdirectory(${STM32H7_PATH_NAME})
endif()
add_subdirectory(fsfw)

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 "returnvalues/classIds.h"
#include "../../common/gpio/GpioIF.h"
#include "fsfw/hal/common/gpio/GpioIF.h"
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
#include <fsfw/objectmanager/SystemObject.h>
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include <vector>
#include <unordered_map>

View File

@ -9,7 +9,6 @@
#include "fsfw/tasks/TaskFactory.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
#include "stm32h7xx_nucleo.h"
#include "stm32h7xx_hal_spi.h"
#include "stm32h7xx_hal_rcc.h"

View File

@ -2,12 +2,21 @@
#include "fsfw/hal/stm32h7/spi/SpiCookie.h"
#include "fsfw/tasks/SemaphoreFactory.h"
#include "fsfw/osal/freertos/TaskManagement.h"
#include "fsfw/hal/stm32h7/spi/spiCore.h"
#include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
#include "fsfw/hal/stm32h7/spi/mspInit.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"
SpiComIF::SpiComIF(object_id_t objectId): SystemObject(objectId) {
@ -421,10 +430,14 @@ void SpiComIF::genericIrqHandler(void *irqArgsVoid, spi::TransferStates targetSt
HAL_GPIO_WritePin(spiCookie->getChipSelectGpioPort(), spiCookie->getChipSelectGpioPin(),
GPIO_PIN_SET);
#if defined FSFW_OSAL_FREERTOS
// Release the task semaphore
BaseType_t taskWoken = pdFALSE;
ReturnValue_t result = BinarySemaphore::releaseFromISR(comIF->spiSemaphore->getSemaphore(),
&taskWoken);
#elif defined FSFW_OSAL_RTEMS
ReturnValue_t result = comIF->spiSemaphore->release();
#endif
if(result != HasReturnvaluesIF::RETURN_OK) {
// Configuration error
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,
comIF->currentRecvBuffSize);
}
#if defined FSFW_OSAL_FREERTOS
/* Request a context switch if the SPI ComIF task was woken up and has a higher priority
than the currently running task */
if(taskWoken == pdTRUE) {
TaskManagement::requestContextSwitch(CallContext::ISR);
}
#endif
}
void SpiComIF::printCfgError(const char *const type) {

View File

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

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)
add_subdirectory(opt)
add_subdirectory(osal)
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
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(container)
add_subdirectory(controller)
@ -26,3 +28,28 @@ add_subdirectory(thermal)
add_subdirectory(timemanager)
add_subdirectory(tmtcpacket)
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