zoukankan      html  css  js  c++  java
  • IAR编译信息分析

    1、怎么设置可以查看单片的内存(消耗)使用状况?

    IAR的菜单栏 -->Tools -->IDE Options -->Messages -->Show build messages选择 ALL

    1. Tools->option->messages show build messages设置成all 

    这样可以在编译后看到用了多少个RAM多少Code,中间每个文件使用情况也可以看得到。

    2. Project->Options...(Alt-F7))的Linker->List中勾选Generate linker map file

    这样可以生成map文件,这个就更详细了(需要什么自己勾选)。

    3. Project->Options...(Alt-F7))的C/C++ compile ->List中勾选output list file

    这样可以看到每个文件编译的细节的list文件,还可以看到反汇编(需要什么自己勾选)

    二、编译信息

    1、 下面什么意思

    4 960 bytes of CODE  memory
    4 150 bytes of DATA  memory
    44 bytes of CONST memory
    

    4 960 个字节的代码(占FLASH)

    4150 个字节的变量数据(占RAM)
    44 个字节的常量数据(占FLASH)

    生成bin文件的大小= 4960+44

    1、

    9 486 bytes of CODE memory
    404 bytes of DATA memory (+ 36 absolute )
    520 bytes of CONST memory
    

    1、的括号内表示内存的绝对使用量,对应你设的全局变量大小
    2、表示共享的存储空间,和单片机的结构有关


     

    2、提问:

      9 176 bytes of CODE  memory (+     30 bytes shared)
       568 bytes of CONST memory (+ 18 148 bytes shared)
       943 bytes of DATA  memory (+    114 bytes shared)

    答:"+ 114 bytes shared"或linking后的"+114 bytes absolute"指的是您在程序中有144bytes 使用@ operator 或 #pragma location=operator 或__no_init volatile语法定义的数据。

    也可以说是可以在汇编中定义的数据。举例:P1OUT在430头文件中就用到了上述语法,当您读写P1OUT时,编译器和链接器就认为您使用了一个上述sahred/absolute数据。   编译器和链接器并不能真正地辨认出什么是RAM什么是Flash,它们使用DATA(没有指定固定的数据)和CONST/CODE(有指定固定的数据)概念来工作。

    原文:http://blog.sina.com.cn/s/blog_4c0cb1c00100vy5n.html

  • 相关阅读:
    Leetcode645.Set Mismatch错误的集合
    Leetcode622.Design Circular Queue设计循环队列
    Leetcode628.Maximum Product of Three Numbers三个数的最大乘积
    Leetcode633.Sum of Square Numbers平方数之和
    Leetcode617.Merge Two Binary Trees合并二叉树
    Leetcode606.Construct String from Binary Tree根据二叉树创建字符串
    SQL Sever实验二 交互式 SQL
    [bzoj2124]等差子序列_线段树_hash
    [bzoj4084][Sdoi2015]双旋转字符串_hash
    [bzoj1708][Usaco2007 Oct]Money奶牛的硬币_动态规划_背包dp
  • 原文地址:https://www.cnblogs.com/einstein-2014731/p/4497306.html
Copyright © 2011-2022 走看看