diff --git a/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/STM32H743ZITx_FLASH.ld b/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/STM32H743ZITx_FLASH.ld index f19b81a..ab1968d 100644 --- a/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/STM32H743ZITx_FLASH.ld +++ b/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/STM32H743ZITx_FLASH.ld @@ -165,7 +165,11 @@ SECTIONS } >RAM_D1 - + .dma_buffer : /* Space before ':' is critical */ + { + *(.dma_buffer) + } >RAM_D2 + .lwip_sec (NOLOAD) : { . = ABSOLUTE(0x30040000); *(.RxDecripSection) diff --git a/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/Src/hardware_init.c b/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/Src/hardware_init.c index b8b4701..5738adf 100644 --- a/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/Src/hardware_init.c +++ b/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/Src/hardware_init.c @@ -1,17 +1,18 @@ #include "hardware_init.h" - -#include -#include -#include - -#include +#include "OBSWConfig.h" +#include "boardconfig.h" +#include "app_ethernet.h" #include #include #include #include #include -#include +#include "stm32h743xx.h" +#include "stm32h7xx_hal_cortex.h" +#include "stm32h7xx_hal_rcc_ex.h" +#include "stm32h7xx_nucleo.h" + #include /* Forward declarations */ @@ -208,6 +209,23 @@ void MPU_Config(void) HAL_MPU_ConfigRegion(&MPU_InitStruct); +#if STM_USE_PERIPHERAL_TX_BUFFER_MPU_PROTECTION == 1 + // Protect DMA buffer for other peripherals + MPU_InitStruct.Enable = MPU_REGION_ENABLE; + MPU_InitStruct.BaseAddress = 0x30000000; + MPU_InitStruct.Size = MPU_REGION_SIZE_1KB; + MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; + MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; + MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE; + MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; + MPU_InitStruct.Number = MPU_REGION_NUMBER1; + MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; + MPU_InitStruct.SubRegionDisable = 0x00; + MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE; + + HAL_MPU_ConfigRegion(&MPU_InitStruct); +#endif + /* Enable the MPU */ HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT); } diff --git a/bsp_stm32_freertos/fsfwconfig/OBSWConfig.h.in b/bsp_stm32_freertos/fsfwconfig/OBSWConfig.h.in index 0c88fcf..f13b47b 100644 --- a/bsp_stm32_freertos/fsfwconfig/OBSWConfig.h.in +++ b/bsp_stm32_freertos/fsfwconfig/OBSWConfig.h.in @@ -6,6 +6,8 @@ #ifndef FSFWCONFIG_OBSWCONFIG_H_ #define FSFWCONFIG_OBSWCONFIG_H_ +#define STM_USE_PERIPHERAL_TX_BUFFER_MPU_PROTECTION 1 + //! Specify whether TMTC commanding via Ethernet is possible #define OBSW_ETHERNET_TMTC_COMMANDING 1 //! Only applies if TMTC commanding is enabled. diff --git a/fsfw_hal b/fsfw_hal index 20815c1..cf8235c 160000 --- a/fsfw_hal +++ b/fsfw_hal @@ -1 +1 @@ -Subproject commit 20815c1d6b6e5f0ce90ff5c1fcd84502fdff9f1c +Subproject commit cf8235cedeb1fa82e594daa67211d55a51c67b11 diff --git a/misc/eclipse/.cproject b/misc/eclipse/.cproject index d456f5d..ed71f65 100644 --- a/misc/eclipse/.cproject +++ b/misc/eclipse/.cproject @@ -905,6 +905,7 @@ @@ -931,10 +934,12 @@ + @@ -968,6 +973,7 @@ + diff --git a/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch b/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch index a8c0c1e..c2dbd65 100644 --- a/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch +++ b/misc/eclipse/cmake/FreeRTOS/fsfw-stm32-freertos-debug.launch @@ -59,6 +59,6 @@ - +