Posted 2014-12-02 13:59:44 +0200

blogs->all

The linker in the GCC toolchain, ld, produces a *.Map file which shows you how the memory on your micro is being used. This file is a goldmine of information but it's a bit difficult for humans to absorb.

I've whipped up a web page which uses the excellent D3.js library to draw a visualisation of your memory usage, using the *.Map file as input. Blocks of memory are drawn proportionally so it's easy to see how much memory you have left and where it's all being used. Click on a block to zoom in on it.

You can run the tool right off the github project page, or download it and modify it for your needs. Pull requests welcome.

https://github.com/eliotstock/memory

Cheers,

Eliot

Posted Dec. 2, 2014, 5:30 p.m.

Nice! Did you use specific flags to get more information? I only see FLASH and RAM and very little used out of both. See this prog.map file.

Posted Dec. 2, 2014, 5:56 p.m.

Because you have very long symbol names, like this...

.text.ZN4func6detail16function_manager19templated_call_copyIPFvbESaIS4_EEEvRNS0_20manager_storage_typeERKS6

... ld is wrapping the memory details onto the next line which is breaking the tool.

Posted Dec. 3, 2014, 2:30 p.m.

Ah, you are right. If I join the lines together with .text in them:

ex -c '%g/\.text/j' -c "wq" prog.map


then I get a lot more info. A better one would be the one that leaves alone the lines that are already on one line:

ex -c '%g/\.text\S*[\s]*\$/j' -c "wq" prog.map


And succeeded by replacing .text.blah with .text:

sed -i 's/\.text\S*/.text/g' prog.map


The only thing left is that the items get really small when you're program gets big. I've to look in the zooming options in your code, but thanks again!

Posted Dec. 3, 2014, 5:48 p.m.

Thanks for the pull request! Merged.

## Recent blog posts

• ### nRF52 Development with CLion

Posted 2017-06-22 09:50:54 by dansheme
• ### Simple GPIO driver example

Posted 2017-06-22 13:38:36 by Hans Elfberg
• ### What mom didn't tell you about ble_app_att_mtu_throughput on the nRF52840 evaluation board

Posted 2017-06-16 16:12:15 by George
• ### Introducing Nordic’s new software licensing schemes

Posted 2017-06-15 11:21:39 by Reidar Martin Svendsen
• ### Open source project for live monitoring and troubleshooting of IoT systems and networks (now supports nRF52832)

Posted 2017-06-13 15:20:07 by Yaniv Nis

## Recent questions

• ### Missing closing brace in SDK13.0.0

Posted 2017-06-22 17:45:31 by Vulpiculus
• ### Clarify is_conn_params_ok() function

Posted 2017-06-22 17:18:46 by aras
• ### Enabling DC/DC mode on the NRF BEACON

Posted 2017-06-22 16:20:58 by nugget
• ### How to config SAADC?

Posted 2017-06-22 16:11:44 by Leila
• ### S130 central disconnected immediately after connection to iOS peripheral

Posted 2017-06-22 15:42:49 by Adam Heinrich