Sysprogs forums › Forums › VisualGDB › MCU flash/ram size incorrectly reported.
- This topic has 5 replies, 2 voices, and was last updated 7 years, 9 months ago by support.
-
AuthorPosts
-
March 21, 2017 at 22:28 #10745sidpriceParticipant
I notice in my embedded project that the report of Flash/RAM usage is not using the correct available amounts for the selected MCU. Is this a bug or a missing/incorrect setting?
Thanks,
Sid
March 22, 2017 at 22:02 #10751supportKeymasterHi,
VisualGDB takes the RAM/FLASH size values from the bsp.xml file in the BSP directory. It is hard to say why they could be wrong without knowing the MCU type.
Please let us know which MCU you are using and what are expected/observed values and we will investigate this.
March 23, 2017 at 20:37 #10789sidpriceParticipantI am using STM32F411RE MCU, however I see the following in STM32.XML:
<McuID>STM32F103CB</McuID>
<MCUDefinitionFile>$(ProjectDir)\STM32F411xx.mcudef</MCUDefinitionFile>
<MCUProperties>
<Entries />
</MCUProperties>
<BSPSourceFolderName>Device-specific files</BSPSourceFolderName>
<InPlaceMCU>
<ID>STM32F103CB</ID>
<UserFriendlyName>STM32F103CB</UserFriendlyName>This may be the source of the Flash/RAM issue. How can I correct this? I don’t see a way to change the MCU in the project settings.
Sid
March 25, 2017 at 20:07 #10799supportKeymasterHi,
VisualGDB Project Properties does not support editing the FLASH/SRAM addresses as they are usually defined by us in the BSPs. Looks like your project is a stand-alone project, so you can modify the FLASH/RAM parameters directly in the stm32.xml file:
<FamilyID>STM32F4</FamilyID> <FLASHSize>1048576</FLASHSize> <RAMSize>196608</RAMSize> <FLASHBase>134217728</FLASHBase> <RAMBase>536870912</RAMBase>
March 26, 2017 at 18:37 #10810sidpriceParticipantThere are quite a few entries in STM32.XML that appear to be referring to the wrong MCU, I am nervous about changing all of them, should I correct all the MCU references:
<?xml version=”1.0″?>
<EmbeddedProfile xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<ToolchainID>com.visualgdb.arm-eabi</ToolchainID>
<BspID>com.visualgdb.bsp.in-place</BspID>
<BspVersion>1.0</BspVersion>
<McuID>STM32F103CB</McuID>
<MCUDefinitionFile>$(ProjectDir)\STM32F411xx.mcudef</MCUDefinitionFile>
<MCUProperties>
<Entries />
</MCUProperties>
<BSPSourceFolderName>Device-specific files</BSPSourceFolderName>
<InPlaceMCU>
<ID>STM32F103CB</ID>
<UserFriendlyName>STM32F103CB</UserFriendlyName>
<CompilationFlags>
<PreprocessorMacros>
<string>STM32F4</string>
<string>BLACKMAGIC</string>
<string>WIFIF4</string>
</PreprocessorMacros>
<IncludeDirectories>
<string>.</string>
<string>C:/DataRoot/Projects/bmp_windows_build/bmp_windows_build/bmp_windows_build/platforms/stm32</string>
</IncludeDirectories>
<CFLAGS>-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ggdb -fno-inline-small-functions -O0</CFLAGS>
<CXXFLAGS>-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ggdb -fno-inline-small-functions -O0</CXXFLAGS>
<LDFLAGS>-Wl,–defsym,_stack=0x20006000, -Wl,-T,platforms/stm32/f4discovery.ld -nostartfiles -lc -lnosys -Wl,-Map=mapfile -mthumb -mcpu=cortex-m4 -Wl,-gc-sections, -mfloat-abi=hard -mfpu=fpv4-sp-d16 </LDFLAGS>
<ASFLAGS>-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -ggdb -fno-inline-small-functions -O0</ASFLAGS>
<LinkerScript />
<COMMONFLAGS>-mcpu=cortex-m4 -mthumb</COMMONFLAGS>
<EnableLinkerGroups>true</EnableLinkerGroups>
</CompilationFlags>
<AdditionalSourceFiles />
<AdditionalHeaderFiles />
<AdditionalSystemVars>
<SysVarEntry>
<Key>com.sysprogs.bspoptions.arm.core</Key>
<Value>M3</Value>
</SysVarEntry>
<SysVarEntry>
<Key>com.sysprogs.stm32.hal_header_prefix</Key>
<Value>stm32f1xx</Value>
</SysVarEntry>
<SysVarEntry>
<Key>com.sysprogs.bspoptions.stm32.hal_system_file</Key>
<Value>STM32F1xxxx/CMSIS_HAL/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c</Value>
</SysVarEntry>
<SysVarEntry>
<Key>com.sysprogs.bspoptions.stm32.hal_config_template_file</Key>
<Value>STM32F1xxxx/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_conf_template.h</Value>
</SysVarEntry>
<SysVarEntry>
<Key>com.sysprogs.stm32.hal_device_family</Key>
<Value>STM32F103xB</Value>
</SysVarEntry>
<SysVarEntry>
<Key>com.sysprogs.stm32.legacy_device_family</Key>
<Value>STM32F10X_MD</Value>
</SysVarEntry>
</AdditionalSystemVars>
<ConfigurableProperties>
<PropertyGroups>
<PropertyGroup>
<Properties>
<PropertyEntry xsi:type=”Enumerated”>
<Name>Execute from</Name>
<UniqueID>com.sysprogs.bspoptions.primary_memory</UniqueID>
<OmitPrefixIfEmpty>false</OmitPrefixIfEmpty>
<SuggestionList>
<Suggestion>
<UserFriendlyName>FLASH</UserFriendlyName>
<InternalValue>flash</InternalValue>
</Suggestion>
<Suggestion>
<UserFriendlyName>SRAM</UserFriendlyName>
<InternalValue>sram</InternalValue>
</Suggestion>
</SuggestionList>
<DefaultEntryIndex>0</DefaultEntryIndex>
<AllowFreeEntry>false</AllowFreeEntry>
</PropertyEntry>
<PropertyEntry xsi:type=”Enumerated”>
<Name>C Library Type</Name>
<UniqueID>com.sysprogs.toolchainoptions.arm.libctype</UniqueID>
<OmitPrefixIfEmpty>false</OmitPrefixIfEmpty>
<SuggestionList>
<Suggestion>
<UserFriendlyName>Default</UserFriendlyName>
<InternalValue />
</Suggestion>
<Suggestion>
<UserFriendlyName>Newlib-nano</UserFriendlyName>
<InternalValue>–specs=nano.specs</InternalValue>
</Suggestion>
<Suggestion>
<UserFriendlyName>Newlib-nano with floating point support in printf()</UserFriendlyName>
<InternalValue>–specs=nano.specs -u _printf_float</InternalValue>
</Suggestion>
<Suggestion>
<UserFriendlyName>Newlib-nano with floating point support in printf() and scanf()</UserFriendlyName>
<InternalValue>–specs=nano.specs -u _printf_float -u _scanf_float</InternalValue>
</Suggestion>
</SuggestionList>
<DefaultEntryIndex>1</DefaultEntryIndex>
<AllowFreeEntry>false</AllowFreeEntry>
</PropertyEntry>
<PropertyEntry xsi:type=”Boolean”>
<Name>Provide default stubs for system calls</Name>
<UniqueID>com.sysprogs.toolchainoptions.arm.libnosys</UniqueID>
<OmitPrefixIfEmpty>false</OmitPrefixIfEmpty>
<DefaultValue>false</DefaultValue>
<ValueForTrue>–specs=nosys.specs</ValueForTrue>
</PropertyEntry>
</Properties>
<CollapsedByDefault>false</CollapsedByDefault>
</PropertyGroup>
</PropertyGroups>
</ConfigurableProperties>
<HierarchicalPath>STM32\STM32F1</HierarchicalPath>
<FamilyID>STM32F1</FamilyID>
<FLASHSize>131072</FLASHSize>
<RAMSize>20480</RAMSize>
<FLASHBase>134217728</FLASHBase>
<RAMBase>536870912</RAMBase>
<MCUDefinitionFile>..\..\iccv8cortex\bin\idb\SVD\STM32F411xx.svd</MCUDefinitionFile>
<AdditionalSourcesRequiredForTesting>false</AdditionalSourcesRequiredForTesting>
</InPlaceMCU>
<MCUMakFile>stm32.mak</MCUMakFile>
<TestFrameworkProperties>
<Entries />
</TestFrameworkProperties>
</EmbeddedProfile>Sid
March 28, 2017 at 04:31 #10814supportKeymasterHi,
It depends on what your goal is. The values in the XML file are copied from the default values for your MCU when you convert the project to a stand-alone one. They are propagated to the actual Makefile (or MSBuild property sheet file) once you change settings on the first page of VisualGDB Project Properties.
If you are not sure, we would recommend checking in the entire project to a source control system like git or SVN and then changing the parts that look suspicious and observing the outcome. You can also just change the FLASH/RAM Size/Base. Those settings are only used in GUI hints and the memory explorer and don’t directly affect compilation.
-
AuthorPosts
- You must be logged in to reply to this topic.