fixes DMA issue by introducing new section

This commit is contained in:
Robin Müller 2021-06-04 12:59:12 +02:00
parent 12fb19ec7b
commit f78d0c95d3
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
6 changed files with 40 additions and 10 deletions

View File

@ -165,7 +165,11 @@ SECTIONS
} >RAM_D1
.dma_buffer : /* Space before ':' is critical */
{
*(.dma_buffer)
} >RAM_D2
.lwip_sec (NOLOAD) : {
. = ABSOLUTE(0x30040000);
*(.RxDecripSection)

View File

@ -1,17 +1,18 @@
#include "hardware_init.h"
#include <stm32h743xx.h>
#include <stm32h7xx_hal_rcc_ex.h>
#include <stm32h7xx_nucleo.h>
#include <app_ethernet.h>
#include "OBSWConfig.h"
#include "boardconfig.h"
#include "app_ethernet.h"
#include <common/stm32_nucleo/networking/ethernetif.h>
#include <lwip/netif.h>
#include <lwip/init.h>
#include <lwip/ip_addr.h>
#include <netif/ethernet.h>
#include <boardconfig.h>
#include "stm32h743xx.h"
#include "stm32h7xx_hal_cortex.h"
#include "stm32h7xx_hal_rcc_ex.h"
#include "stm32h7xx_nucleo.h"
#include <stdio.h>
/* 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);
}

View File

@ -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.

@ -1 +1 @@
Subproject commit 20815c1d6b6e5f0ce90ff5c1fcd84502fdff9f1c
Subproject commit cf8235cedeb1fa82e594daa67211d55a51c67b11

View File

@ -905,6 +905,7 @@
<option id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.usepreprocessor.82715789" 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.defs.671384657" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.defs" valueType="definedSymbols">
<listOptionValue builtIn="false" value="ETH"/>
<listOptionValue builtIn="false" value="__MPU_PRESENT=1"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths.1118638090" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.assembler.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/fsfwconfig}&quot;"/>
@ -918,10 +919,12 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/fsfwconfig}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/Inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/STM32CubeH7/Drivers/BSP/STM32H7xx_HAL_Driver/Inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/build-Debug-STM32H743-FreeRTOS}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.255200442" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="FSFW_FREERTOS"/>
<listOptionValue builtIn="false" value="ETH"/>
<listOptionValue builtIn="false" value="__MPU_PRESENT=1"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.934108357" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input"/>
</tool>
@ -931,10 +934,12 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/fsfwconfig}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/STM32CubeH7/Boards/NUCLEO-H743ZI/Inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/bsp_stm32_freertos/STM32CubeH7/Drivers/BSP/STM32H7xx_HAL_Driver/Inc}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/fsfw_example_public/build-Debug-STM32H743-FreeRTOS}&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.1540005786" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
<listOptionValue builtIn="false" value="FSFW_FREERTOS"/>
<listOptionValue builtIn="false" value="ETH"/>
<listOptionValue builtIn="false" value="__MPU_PRESENT=1"/>
</option>
<inputType id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1267738452" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input"/>
</tool>
@ -968,6 +973,7 @@
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="ilg.gnumcueclipse.managedbuild.packs"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.450259316.1933681494.615695818.863590432.2027226929">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.450259316.1933681494.615695818.863590432.2027226929" moduleId="org.eclipse.cdt.core.settings" name="fsfw-stm32-freertos-release">

View File

@ -59,6 +59,6 @@
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;&gt;&#13;&#10; &lt;memoryBlockExpression address=&quot;604291484&quot; label=&quot;*((((this)-&amp;gt;hkBuffer))+0)@100&quot;/&gt;&#13;&#10;&lt;/memoryBlockExpressionList&gt;&#13;&#10;"/>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;&gt;&#10; &lt;memoryBlockExpression address=&quot;604291484&quot; label=&quot;*((((this)-&amp;gt;hkBuffer))+0)@100&quot;/&gt;&#10;&lt;/memoryBlockExpressionList&gt;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>