dhgdh

Dependencies:   MAX44000 PWM_Tone_Library nexpaq_mdk

Fork of LED_Demo by joey shelton

Committer:
nexpaq
Date:
Sat Sep 17 16:32:05 2016 +0000
Revision:
1:55a6170b404f
checking in for sharing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
nexpaq 1:55a6170b404f 1 # memap - Static Memory Map Analysis
nexpaq 1:55a6170b404f 2
nexpaq 1:55a6170b404f 3 ## Introduction
nexpaq 1:55a6170b404f 4
nexpaq 1:55a6170b404f 5 *memap* is a simple utility that displays static memory information required by [mbed](https://github.com/mbedmicro/mbed) applications. This information is produced by analysing the memory map file previously generated by your toolchain.
nexpaq 1:55a6170b404f 6
nexpaq 1:55a6170b404f 7 **Note**: this tool shows static RAM usage and the total size of allocated heap and stack space defined at compile time, not the actual heap and stack usage (which may be different depending on your application).
nexpaq 1:55a6170b404f 8
nexpaq 1:55a6170b404f 9 ## Table of contents
nexpaq 1:55a6170b404f 10
nexpaq 1:55a6170b404f 11 1. [Using memap](#using-memap)
nexpaq 1:55a6170b404f 12 1. [Information on memory sections](#info-mem-sections)
nexpaq 1:55a6170b404f 13 1. [Current support](#current-support)
nexpaq 1:55a6170b404f 14 1. [Known problems](#known-problems)
nexpaq 1:55a6170b404f 15
nexpaq 1:55a6170b404f 16 ## Using memap
nexpaq 1:55a6170b404f 17
nexpaq 1:55a6170b404f 18 *memap* is automatically invoked after an mbed build finishes successfully. It's also possible to manually run the program with different command line options, for example:
nexpaq 1:55a6170b404f 19
nexpaq 1:55a6170b404f 20 ```
nexpaq 1:55a6170b404f 21 $> python memap.py
nexpaq 1:55a6170b404f 22 usage: memap.py [-h] -t TOOLCHAIN [-o OUTPUT] [-e EXPORT] [-v] file
nexpaq 1:55a6170b404f 23
nexpaq 1:55a6170b404f 24 Memory Map File Analyser for ARM mbed version 0.3.11
nexpaq 1:55a6170b404f 25
nexpaq 1:55a6170b404f 26 positional arguments:
nexpaq 1:55a6170b404f 27 file memory map file
nexpaq 1:55a6170b404f 28
nexpaq 1:55a6170b404f 29 optional arguments:
nexpaq 1:55a6170b404f 30 -h, --help show this help message and exit
nexpaq 1:55a6170b404f 31 -t TOOLCHAIN, --toolchain TOOLCHAIN
nexpaq 1:55a6170b404f 32 select a toolchain used to build the memory map file
nexpaq 1:55a6170b404f 33 (ARM, GCC_ARM, IAR)
nexpaq 1:55a6170b404f 34 -o OUTPUT, --output OUTPUT
nexpaq 1:55a6170b404f 35 output file name
nexpaq 1:55a6170b404f 36 -e EXPORT, --export EXPORT
nexpaq 1:55a6170b404f 37 export format (examples: 'json', 'csv-ci', 'table':
nexpaq 1:55a6170b404f 38 default)
nexpaq 1:55a6170b404f 39 -v, --version show program's version number and exit
nexpaq 1:55a6170b404f 40 ```
nexpaq 1:55a6170b404f 41
nexpaq 1:55a6170b404f 42 Result example:
nexpaq 1:55a6170b404f 43
nexpaq 1:55a6170b404f 44 ```
nexpaq 1:55a6170b404f 45 $> python memap.py GCC_ARM\myprog3.map -t GCC_ARM
nexpaq 1:55a6170b404f 46
nexpaq 1:55a6170b404f 47 +----------------------------+-------+-------+------+
nexpaq 1:55a6170b404f 48 | Module | .text | .data | .bss |
nexpaq 1:55a6170b404f 49 +----------------------------+-------+-------+------+
nexpaq 1:55a6170b404f 50 | Fill | 170 | 0 | 2294 |
nexpaq 1:55a6170b404f 51 | Misc | 36282 | 2220 | 2152 |
nexpaq 1:55a6170b404f 52 | core/hal | 15396 | 16 | 568 |
nexpaq 1:55a6170b404f 53 | core/rtos | 6751 | 24 | 2662 |
nexpaq 1:55a6170b404f 54 | features/FEATURE_IPV4 | 96 | 0 | 48 |
nexpaq 1:55a6170b404f 55 | frameworks/greentea-client | 912 | 28 | 44 |
nexpaq 1:55a6170b404f 56 | frameworks/utest | 3079 | 0 | 732 |
nexpaq 1:55a6170b404f 57 | Subtotals | 62686 | 2288 | 8500 |
nexpaq 1:55a6170b404f 58 +----------------------------+-------+-------+------+
nexpaq 1:55a6170b404f 59 Allocated Heap: 65540 bytes
nexpaq 1:55a6170b404f 60 Allocated Stack: 32768 bytes
nexpaq 1:55a6170b404f 61 Total Static RAM memory (data + bss): 10788 bytes
nexpaq 1:55a6170b404f 62 Total RAM memory (data + bss + heap + stack): 109096 bytes
nexpaq 1:55a6170b404f 63 Total Flash memory (text + data + misc): 66014 bytes
nexpaq 1:55a6170b404f 64
nexpaq 1:55a6170b404f 65 ```
nexpaq 1:55a6170b404f 66
nexpaq 1:55a6170b404f 67 ## Information on memory sections
nexpaq 1:55a6170b404f 68
nexpaq 1:55a6170b404f 69 The table above showed multiple memory sections.
nexpaq 1:55a6170b404f 70
nexpaq 1:55a6170b404f 71 - ``.text``: is where the code application and constants are located in Flash.
nexpaq 1:55a6170b404f 72 - ``.data``: non-zero initialized variables; allocated in both RAM and Flash memory (variables are copied from Flash to RAM at run time)
nexpaq 1:55a6170b404f 73 - ``.bss``: uninitialized data allocated in RAM, or variables initialized to zero.
nexpaq 1:55a6170b404f 74 - ``Heap``: dynamic allocations in the Heap area in RAM (for example, used by ``malloc``). The maximum size value may be defined at build time.
nexpaq 1:55a6170b404f 75 - ``Stack``: dynamic allocations in the Stack area in RAM (for example, used to store local data, temporary data when branching to a subroutine or context switch information). The maximum size value may be defined at build time.
nexpaq 1:55a6170b404f 76
nexpaq 1:55a6170b404f 77 There are other entries that require a bit of clarification:
nexpaq 1:55a6170b404f 78
nexpaq 1:55a6170b404f 79 - Fill: represents the bytes in multiple sections (RAM and Flash) that the toolchain has filled with zeros because it requires subsequent data or code to be aligned appropriately in memory.
nexpaq 1:55a6170b404f 80 - Misc: usually represents helper libraries introduced by the toolchain (like ``libc``), but can also represent modules that are not part of mbed.
nexpaq 1:55a6170b404f 81
nexpaq 1:55a6170b404f 82 ## Current support
nexpaq 1:55a6170b404f 83
nexpaq 1:55a6170b404f 84 *memap* has been tested on Windows 7, Linux and Mac OS X and works with memory map files are generated by the GCC_ARM, ARM (ARM Compiler 5) and IAR toochains.
nexpaq 1:55a6170b404f 85
nexpaq 1:55a6170b404f 86 ## Known issues and new features
nexpaq 1:55a6170b404f 87
nexpaq 1:55a6170b404f 88 This utility is considered 'alpha' quality at the moment. The information generated by this utility may not be fully accurate and may vary from one toolchain to another.
nexpaq 1:55a6170b404f 89
nexpaq 1:55a6170b404f 90 If you are experiencing problems, or would like additional features, please raise a ticket on [GitHub](https://github.com/mbedmicro/mbed/issues) and use ```[memap] ``` in the title.