diff --git a/CMakeLists.txt b/CMakeLists.txt index 21e6005..b7961f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,10 @@ if(TGT_BSP MATCHES "arm/raspberrypi") set(FSFW_HAL_ADD_RASPBERRY_PI ON) endif() +if(TGT_BSP MATCHES "arm/stm32h743zi-nucleo") + set(FSFW_HAL_ADD_STM32H7 ON) +endif() + # Perform steps like loading toolchain files where applicable. include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() @@ -37,7 +41,6 @@ pre_project_config() project(fsfw_example ASM C CXX) - ################################################################################ # Pre-Sources preparation ################################################################################ diff --git a/bsp_stm32_freertos/STM32CubeH7/Drivers/BSP/STM32H7xx_HAL_Driver/CMakeLists.txt b/bsp_stm32_freertos/STM32CubeH7/Drivers/BSP/STM32H7xx_HAL_Driver/CMakeLists.txt index 3c64258..dd3b896 100644 --- a/bsp_stm32_freertos/STM32CubeH7/Drivers/BSP/STM32H7xx_HAL_Driver/CMakeLists.txt +++ b/bsp_stm32_freertos/STM32CubeH7/Drivers/BSP/STM32H7xx_HAL_Driver/CMakeLists.txt @@ -29,6 +29,7 @@ target_sources(${LIB_STM_HAL_NAME} PRIVATE Src/stm32h7xx_hal_pwr.c Src/stm32h7xx_hal_pwr_ex.c Src/stm32h7xx_hal_i2c.c + Src/stm32h7xx_hal_spi.c Src/stm32h7xx_hal_i2c_ex.c Src/stm32h7xx_hal_uart.c Src/stm32h7xx_hal_uart_ex.c diff --git a/common/stm32_nucleo/STM32TestTask.cpp b/common/stm32_nucleo/STM32TestTask.cpp index 6f3655f..09729dc 100644 --- a/common/stm32_nucleo/STM32TestTask.cpp +++ b/common/stm32_nucleo/STM32TestTask.cpp @@ -2,6 +2,9 @@ #include "stm32h7xx_nucleo.h" #include "OBSWConfig.h" +#include "fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h" +#include "fsfw/serviceinterface/ServiceInterface.h" + STM32TestTask::STM32TestTask(object_id_t objectId, bool enablePrintout, bool blinkyLed): TestTask(objectId, enablePrintout), blinkyLed(blinkyLed) { @@ -19,5 +22,11 @@ ReturnValue_t STM32TestTask::performPeriodicAction() { } ReturnValue_t STM32TestTask::performOneShotAction() { + performSpiL3gd20hTest(); return HasReturnvaluesIF::RETURN_OK; } + +void STM32TestTask::performSpiL3gd20hTest() { + SPI_HandleTypeDef spiHandle = {}; + GyroL3GD20H gyroDevice(&spiHandle); +} diff --git a/common/stm32_nucleo/STM32TestTask.h b/common/stm32_nucleo/STM32TestTask.h index 4f4a1b9..f00ec15 100644 --- a/common/stm32_nucleo/STM32TestTask.h +++ b/common/stm32_nucleo/STM32TestTask.h @@ -2,6 +2,10 @@ #define BSP_STM32_BOARDTEST_STM32TESTTASK_H_ #include +#include "stm32h7xx_hal.h" +#include "stm32h7xx_hal_spi.h" + + class STM32TestTask: public TestTask { public: @@ -10,6 +14,7 @@ public: ReturnValue_t performPeriodicAction() override; ReturnValue_t performOneShotAction() override; + void performSpiL3gd20hTest(); private: bool blinkyLed = false; diff --git a/doc/stm32_nucleo/stm32h743-rm0433-datasheet.pdf b/doc/stm32_nucleo/stm32h743-rm0433-datasheet.pdf new file mode 100644 index 0000000..89fef2b Binary files /dev/null and b/doc/stm32_nucleo/stm32h743-rm0433-datasheet.pdf differ diff --git a/fsfw_hal b/fsfw_hal index 4ba4e45..4c54682 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit 4ba4e45789a9fc37c8ff45d09b7986ee1dbd53ca +Subproject commit 4c546820fdb28bf46fae6606716ae34e2f4ba950