Sysprogs forums › Forums › VisualGDB › Print Memory usage report in function of linker sections
- This topic has 7 replies, 2 voices, and was last updated 6 years, 1 month ago by support.
-
AuthorPosts
-
October 19, 2018 at 11:41 #22364julieninnovelParticipant
Hello,
I would like to now if it’s possible to print automaticaly a memory utilization report, but in functions of differents sections and sizes declared in the linker script ?
Example, I have a firmware application and a bootloader application.
The linker script have a frst flash section for the bootloader (4K) a second one for the application (60K), and the RAM is also cut into 3 sections :
- RAM_VTOR (for interrupt relocation)
- RAM
- SHARED_RAM (to exchange data from bootloader to application firmware)
I would like to have a report with all sections memory usages, and not the default one with the full FLASH and RAM size…
Thanks
October 19, 2018 at 17:05 #22371supportKeymasterHi,
Please try opening View->Embedded Memory Explorer and keeping it open in the detailed view. It will automatically update each time you build the project, showing you the detailed per-section and per-symbol statistics (and also other useful information like offline disassembly or stack usage analysis).
October 22, 2018 at 08:37 #22378julieninnovelParticipantHello,
Thanks for this, it will help me but not exactly what I would like to have….
I explain more :
My flash size is about 128K split into 3 different sections :
- 4K for a bootloader
- 62K for firmware application
- 62K for new firmware downloaded and to be programmed by bootloader
Since the full size of flash is 128K, the memory utilization report, or embedded memory explorer compute the usage with 128K for size, but not with my active section of 62K.
Is there a way to do this ?
Thanks
October 22, 2018 at 18:17 #22400supportKeymasterHi,
Do you mean that you would like to see the percentage of each section that is occupied by the actual symbols vs. padding at the end of the section?
October 26, 2018 at 07:12 #22436julieninnovelParticipantHi,
It’s exactly what I want.
October 26, 2018 at 19:00 #22442supportKeymasterHi,
Thanks for clarifying it. Unfortunately it would’t work to not count the space between the symbols, as in most of the cases such space is wasted due to alignment constraints, or contains unnamed data from assembly files, and hence should be counted towards the used space.
Instead, please consider one of the following approaches:
- Instead of having fixed-size sections extended until the end of the 62K block, have a variable-size section followed by a dummy section marked with the NOLOAD attribute filling the rest of the space. The NOLOAD sections will be automatically excluded from the memory usage statistics.
- Simply place sections non-sequentially. You can use the “. = <address>” syntax in the linker script to place the next section at a fixed address.
- Split the FLASH memory in your linker script into 3 separate memories and place the sections accordingly. Again, ensure that the sections are not extended beyond the actual end of the last symbol.
November 20, 2018 at 12:01 #22774julieninnovelParticipantHi,
I found a way to do that, simply add to linker command line the option
-Wl,--print-memory-usage
November 20, 2018 at 21:22 #22785supportKeymasterHi,
Thanks for sharing this. We have added an option to the Linker properties under the VS properties for this setting to our development branch. It will be included in the upcoming VisualGDB beta.
-
AuthorPosts
- You must be logged in to reply to this topic.