Includes library modifications to allow access to AIN_4 (AIN_0 / 5)

Committer:
bryantaylor
Date:
Tue Sep 20 21:26:12 2016 +0000
Revision:
0:eafc3fd41f75
hackathon

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bryantaylor 0:eafc3fd41f75 1 # memap - Static Memory Map Analysis
bryantaylor 0:eafc3fd41f75 2
bryantaylor 0:eafc3fd41f75 3 ## Introduction
bryantaylor 0:eafc3fd41f75 4
bryantaylor 0:eafc3fd41f75 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.
bryantaylor 0:eafc3fd41f75 6
bryantaylor 0:eafc3fd41f75 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).
bryantaylor 0:eafc3fd41f75 8
bryantaylor 0:eafc3fd41f75 9 ## Table of contents
bryantaylor 0:eafc3fd41f75 10
bryantaylor 0:eafc3fd41f75 11 1. [Using memap](#using-memap)
bryantaylor 0:eafc3fd41f75 12 1. [Information on memory sections](#info-mem-sections)
bryantaylor 0:eafc3fd41f75 13 1. [Current support](#current-support)
bryantaylor 0:eafc3fd41f75 14 1. [Known problems](#known-problems)
bryantaylor 0:eafc3fd41f75 15
bryantaylor 0:eafc3fd41f75 16 ## Using memap
bryantaylor 0:eafc3fd41f75 17
bryantaylor 0:eafc3fd41f75 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:
bryantaylor 0:eafc3fd41f75 19
bryantaylor 0:eafc3fd41f75 20 ```
bryantaylor 0:eafc3fd41f75 21 $> python memap.py
bryantaylor 0:eafc3fd41f75 22 usage: memap.py [-h] -t TOOLCHAIN [-o OUTPUT] [-e EXPORT] [-v] file
bryantaylor 0:eafc3fd41f75 23
bryantaylor 0:eafc3fd41f75 24 Memory Map File Analyser for ARM mbed version 0.3.11
bryantaylor 0:eafc3fd41f75 25
bryantaylor 0:eafc3fd41f75 26 positional arguments:
bryantaylor 0:eafc3fd41f75 27 file memory map file
bryantaylor 0:eafc3fd41f75 28
bryantaylor 0:eafc3fd41f75 29 optional arguments:
bryantaylor 0:eafc3fd41f75 30 -h, --help show this help message and exit
bryantaylor 0:eafc3fd41f75 31 -t TOOLCHAIN, --toolchain TOOLCHAIN
bryantaylor 0:eafc3fd41f75 32 select a toolchain used to build the memory map file
bryantaylor 0:eafc3fd41f75 33 (ARM, GCC_ARM, IAR)
bryantaylor 0:eafc3fd41f75 34 -o OUTPUT, --output OUTPUT
bryantaylor 0:eafc3fd41f75 35 output file name
bryantaylor 0:eafc3fd41f75 36 -e EXPORT, --export EXPORT
bryantaylor 0:eafc3fd41f75 37 export format (examples: 'json', 'csv-ci', 'table':
bryantaylor 0:eafc3fd41f75 38 default)
bryantaylor 0:eafc3fd41f75 39 -v, --version show program's version number and exit
bryantaylor 0:eafc3fd41f75 40 ```
bryantaylor 0:eafc3fd41f75 41
bryantaylor 0:eafc3fd41f75 42 Result example:
bryantaylor 0:eafc3fd41f75 43
bryantaylor 0:eafc3fd41f75 44 ```
bryantaylor 0:eafc3fd41f75 45 $> python memap.py GCC_ARM\myprog3.map -t GCC_ARM
bryantaylor 0:eafc3fd41f75 46
bryantaylor 0:eafc3fd41f75 47 +----------------------------+-------+-------+------+
bryantaylor 0:eafc3fd41f75 48 | Module | .text | .data | .bss |
bryantaylor 0:eafc3fd41f75 49 +----------------------------+-------+-------+------+
bryantaylor 0:eafc3fd41f75 50 | Fill | 170 | 0 | 2294 |
bryantaylor 0:eafc3fd41f75 51 | Misc | 36282 | 2220 | 2152 |
bryantaylor 0:eafc3fd41f75 52 | core/hal | 15396 | 16 | 568 |
bryantaylor 0:eafc3fd41f75 53 | core/rtos | 6751 | 24 | 2662 |
bryantaylor 0:eafc3fd41f75 54 | features/FEATURE_IPV4 | 96 | 0 | 48 |
bryantaylor 0:eafc3fd41f75 55 | frameworks/greentea-client | 912 | 28 | 44 |
bryantaylor 0:eafc3fd41f75 56 | frameworks/utest | 3079 | 0 | 732 |
bryantaylor 0:eafc3fd41f75 57 | Subtotals | 62686 | 2288 | 8500 |
bryantaylor 0:eafc3fd41f75 58 +----------------------------+-------+-------+------+
bryantaylor 0:eafc3fd41f75 59 Allocated Heap: 65540 bytes
bryantaylor 0:eafc3fd41f75 60 Allocated Stack: 32768 bytes
bryantaylor 0:eafc3fd41f75 61 Total Static RAM memory (data + bss): 10788 bytes
bryantaylor 0:eafc3fd41f75 62 Total RAM memory (data + bss + heap + stack): 109096 bytes
bryantaylor 0:eafc3fd41f75 63 Total Flash memory (text + data + misc): 66014 bytes
bryantaylor 0:eafc3fd41f75 64
bryantaylor 0:eafc3fd41f75 65 ```
bryantaylor 0:eafc3fd41f75 66
bryantaylor 0:eafc3fd41f75 67 ## Information on memory sections
bryantaylor 0:eafc3fd41f75 68
bryantaylor 0:eafc3fd41f75 69 The table above showed multiple memory sections.
bryantaylor 0:eafc3fd41f75 70
bryantaylor 0:eafc3fd41f75 71 - ``.text``: is where the code application and constants are located in Flash.
bryantaylor 0:eafc3fd41f75 72 - ``.data``: non-zero initialized variables; allocated in both RAM and Flash memory (variables are copied from Flash to RAM at run time)
bryantaylor 0:eafc3fd41f75 73 - ``.bss``: uninitialized data allocated in RAM, or variables initialized to zero.
bryantaylor 0:eafc3fd41f75 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.
bryantaylor 0:eafc3fd41f75 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.
bryantaylor 0:eafc3fd41f75 76
bryantaylor 0:eafc3fd41f75 77 There are other entries that require a bit of clarification:
bryantaylor 0:eafc3fd41f75 78
bryantaylor 0:eafc3fd41f75 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.
bryantaylor 0:eafc3fd41f75 80 - Misc: usually represents helper libraries introduced by the toolchain (like ``libc``), but can also represent modules that are not part of mbed.
bryantaylor 0:eafc3fd41f75 81
bryantaylor 0:eafc3fd41f75 82 ## Current support
bryantaylor 0:eafc3fd41f75 83
bryantaylor 0:eafc3fd41f75 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.
bryantaylor 0:eafc3fd41f75 85
bryantaylor 0:eafc3fd41f75 86 ## Known issues and new features
bryantaylor 0:eafc3fd41f75 87
bryantaylor 0:eafc3fd41f75 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.
bryantaylor 0:eafc3fd41f75 89
bryantaylor 0:eafc3fd41f75 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.