使用CCS的Energy Trace调试msp430的低功耗运行的问题

2019-03-24 09:40发布

首先转一个帖子的内容,我按着这些内容一步一步操作,结果是没有得到任何曲线,什么结果都没有。谁知道是什么原因吗
以下是转载的别人的内容,
本文简要介绍了使用CCSv6.0的低功耗测量评估工具Energy Trace对msp430芯片的低功耗运行进行优化目  录1 概述        12 Energia项目开发流程简介        22.1. Energy Trace介绍        22.2. Energy Trace的设置        22.3. Energy Trace的运行        32.4. Energy Trace的低功耗优化对比分析        6
1 概述本文简要介绍了使用CCSv6.0的低功耗测量评估工具Energy Trace对msp430芯片的低功耗运行进行优化。。硬件平台:TI-Launchpad FR5969软件平台:CCS V6.0.12 Energia项目开发流程简介本章介绍CCSmsp430低功耗测量评估工具——Energy Trace,并简要记录采用Energy Tracemsp430的低功耗运行进行优化的流程。2.1. Energy Trace介绍Energy TraceTImsp430系列芯片开发的,利用支持Energy Trace功能的Debugger,可以在CCS的调试界面显示芯片的运行功耗,从而帮助开发者对芯片的低功耗运行进行优化,以下是官方文档描述:The EnergyTraceTechnology is an energy-based code analysis tool set that is useful for measuring and viewing the applications energy profile and optimizing it for ultra-low power consumption.MSP430 devices with built-in EnergyTrace+[CPU State]+[Peripheral States] (or in short EnergyTrace++) support allow real-time monitoring of many internal device states while normally executing user program code. EnergyTrace++is supported on selected MSP430 devices and debuggers.The EnergyTrace mode (baring the ++) is the base of EnergyTraceTechnology and enables analog energy measurement to determine the energy consumption of an application, without the possibility to correlate it to internal device information. The EnergyTrace mode is available for all MSP430 devices with selected debuggers. 简而言之,Energy Trace是利用支持该功能的DebuggerEzFET等)对目标芯片供电,并测量供电输出电流(以及电压)大小,从而计算功耗,进而确定功耗优化选择。Energy Trace++则是通过调试器对支持该功能的芯片(不是所有430的芯片都支持),通过读取芯片内部功耗模式、时钟、外设使能等信息,从而估算芯片的功耗,进而确定功耗优化选择。2.2. Energy Trace的设置Energy Trace需要在菜单栏的Window->Preferences->Code Composer Studio->Advanced Tools->EnergyTrace™ Technology.里面设置如下图:
图 2-1  Energy Trace设置界面同时,对于建立的项目,需要勾选“超低功耗模式的调试”图 22  Project的低功耗调试模式设置界面2.3. Energy Trace的运行连接好Launchpad,并安装好驱动(参考Launchpad用户手册,不再赘述),打开EnergyTrace_Hands_On的项目,右键项目,选择Build Configurations->Set Active->Insufficient,则Insufficient.c导入项目,代码如下:
  • /*
  • /
  • //  MSP430FR59xx EnergyTrace Demo- High Energy Consumption Code
  • //
  • //   Description: This code is intentionally written inefficiently in order
  • //   to use an unnecessary amount of energy. The ULP Advisor and EnergyTrace
  • //   are used to help identify the problem areas in the code to point out
  • //   where changes can be made to increase efficiency.
  • //
  • //   About every second, an ADC temperature sample is taken and the degrees
  • //   Celsius and Fahrenheit are found using floating point calculations.
  • //   The results are printed and transmitted through the UART.
  • //   Some examples of the inefficient coding styles used are:
  • //      sprintf()
  • //      Floating point operations
  • //      Divide operations
  • //      Flag polling
  • //      Software delays
  • //      Floating port pins
  • //      No use of low-power modes
  • //      Counting up in loops
  • //
  • //   B. Finch
  • //   Texas Instruments Inc.
  • //   June 2014
  • //   Built with Code Composer Studio v6.0
  • #include <stdio.h>
  • #include <msp430.h>
  • #include <stdint.h>
  • .....
  •     UCA0CTLW0 &= ~UCSWRST;                    // Enable eUSCI_A
  •     __no_operation();                         // SET A BREAKPOINT HERE
  •     while(1)
  •     {
  •        ....
  •             while(UCA0STATW & UCBUSY);
  •             __no_operation();                 // For debugger
  •         }
  •     }
  • }

[color=rgb(51, 102, 153) !important]复制代码

点击Debug后,在调试界面的菜单栏选择Windows->Show View->Others,选择Energy Trace,进入Energy Trace分析界面。选择测量记录时间为10s,如下:图 2-3  设置Energy Trace的分析时间为10s截图Energy Trace主要包括Profile,以及Energy Profile(Energy Trace++ Profile)StatePower四个标签页,以曲线形式表示功耗大小。Energy Trece Profile对功率、电压、电流的最大值、平均值、最小值计算,同时估算采用CR2032纽扣电池供电的持续运行时间。而Energy Trace++ Profile则记录各个时间点CPU的运行模式、各个外设、时钟等信息。点击run,则Energy Trace自动记录芯片在10s内的功耗曲线。点击Profile标签页的保存按钮 ,将结果保存到一个文件。2.4. Energy Trace的低功耗优化对比分析结束调试,在Project Explorer里选择项目的Build Configuration选择Most Efficient,并编译调试,同样保存10sEnergy Trace记录,然后点击Profile标签页的导入按钮 ,导入刚才保存的Inefficient的记录,两者对比如下:
图 2-5  Energy Trace对比分析低功耗LPM3模式与持续Active模式在运行模式的对比中,当前的RuntimeEnergy大部分集中在LPM3中,而且FRAMMCLK都非常少,而Reference RuntimeReference Energy都在Active Mode里面,可以直观地对比出不同低功耗运行模式下所占用的时间比例。图 2-6  Energy Trace对比分析低功耗Power/EnergyStates上图则可以清楚地看到InefficeintReference EnergyReference Power(黄 {MOD}曲线)比Most Efficient高出很多。并且可以看到Most Efficient的运行模式等状态在LPM3ActiveMode之间切换,降低了功耗。最后还有Build ConfigurationMost Efficient Solution的运行对比如下:图 2-7  Energy Trace对比分析PortB初始化的Power/EnergyStates采用对PortB初始化后,可进一步降低功耗。
此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
7条回答
maylove
1楼-- · 2019-03-24 13:03
< 看到这个帖子的原创作者已经在他的帖子下面回复你了吗
数码小叶
2楼-- · 2019-03-24 15:58
 精彩回答 2  元偷偷看……
wanyisq
3楼-- · 2019-03-24 19:43
maylove 发表于 2015-11-6 14:18
看到这个帖子的原创作者已经在他的帖子下面回复你了吗

谢谢提醒 我看到了
wanyisq
4楼-- · 2019-03-25 00:13
数码小叶 发表于 2015-11-6 15:30
Launchpad要是5969的第二版才可以,第一版的不支持

不是用的launchpad,是自己做的板子。用的MSP FET430UIF调试器
数码小叶
5楼-- · 2019-03-25 00:43
 精彩回答 2  元偷偷看……
wanyisq
6楼-- · 2019-03-25 04:19
数码小叶 发表于 2015-11-6 18:29
那就对了,不支持,下次给你截个图,目前支持的仿真器就一个

好的,还望多多指教

一周热门 更多>

相关问题

    相关文章