element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
RoadTests & Reviews
  • Products
  • More
RoadTests & Reviews
Review Blogs Power and Events Measurements with ULINKplus
  • Blogs
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Sub-Groups
  • More
  • Cancel
  • New
Join RoadTests & Reviews to participate - click to join for free!
  • Share
  • More
  • Cancel
  • Author Author: snidhi
  • Date Created: 30 Jun 2018 1:23 PM Date Created
  • Views 2698 views
  • Likes 9 likes
  • Comments 9 comments
Related
Recommended
  • keil_ulink
  • keil_mdk
  • arm keil mdk

Power and Events Measurements with ULINKplus

snidhi
snidhi
30 Jun 2018

  • Measurements with ULINKplus debugger and EA LPC11U37H Board
    • Debugging using SystemViewer Windows
    • Debugging using the Logic Analyzer
    • Debugging with System Analyzer in Cortex M0
    • Performance Analyzer in KEIL MDK Professional
    • ITM and DWT trace debugging
    • Power Measurements with ULINKplus debugger and EA LPC11U37H LPCXpresso Board

Measurements with ULINKplus debugger and EA LPC11U37H Board

MDK Ver 5 uses software packs to support a micro-controller device and to use middleware which are needed for Debugging using Event Recorder.

 

Steps to get the Event Recorder working if you are migrating from the MDK4 legacy code to KEIL MDK5

  • Convert the compiled project from MDK4 to MDK5 from within the KEIL IDE.
  • Download the correct software packs for your micro-controller from the Pack Installer.
  • Later add the downloaded CMSIS and compiler packages from the software packs to your project.
  • Setup the Event Recorder in the project.
  • Get some beer and proceed as this road test will not end!!
  • Add the event recorder code to your main code. Event recorder sample code.
  • Then realize from ULINK: ULINKplus + Cortex-M0/M0+/M1/M23 support  posted January 8, 2018 Power Measurement- and Test Automation-support is not integrated with MDK-ARM V5.25 pre-release, but planned for all Cortex-M devices with coming MDK-ARM versions. However - Clock frequency measurement will not be possible in a foreseeable future for Cortex-M0/M0+/M1/M23 due to the lack of DWT CYCCNT (CPU cycle counter) in these CPUs.
  • Also find out that for Time Stamp Source: Specify the timer used as time base. Default is the DWT Cycle Counter that is part of the CoreSight debug interface. This counter is not available in Cortex-M0 and Cortex-M0+

 

image

A quick look into how the Event Recorder works in theory

 

image

 

Proceed ahead and record all the planned events in the code in the Event Recorder. Cross check the values in the Events recorder with the Call Stack

 

image

And done... Record all the planned events

 

An important point to note is to avoid conflicts between the startup files for the project. If you migrated the project from an already pre-complied code chances are that it already has a startup.s and startup.c file. Hence there is no need to add it from the Manage Runtime environment window else there will be a conflict.

 

image

Fig: Errors spotted in code with the Event Recorder

 

I also wanted to use the Event Recorder and Component Viewer for recording events for the Keil RTX5 where you can see the RTX5 RTOS Memory events, Kernel events, Semaphore events, Mutex events but this is only available with the MDK-ARM Plus or MDK-ARM Professional license.

Error #603: 'Keil.MDK-Plus::File System:CORE:LFN Debug:6.10.1': component requires valid MDK-ARM Plus or MDK-ARM Professional license

 

image

 

After some time spent with the Lite version I also evaluate the MDK ARM professional IDE for 7 days trial period. The Event Recorder test below is done using the ARM Cortex-M3 in uVision Simulator which I found to be quite a nice feature. Download Support for ARM Cortex-M0 in uVision Simulator

 

So even if you do not have the needed micro-controller board in hand one can test the working code in this Simulator. Help: Understanding the Event Recorder

image

Fig: MDK Professional License

 

image

Fig: Recording Events with ARM Cortex-M3 in uVision Simulator

 

Debugging using SystemViewer Windows

SystemViewer Windows is quite a powerful debugging tool as it lets you see directly into the registers of the peripherals. One can monitor the changes in the register values in real time and look into anomalies directly at the register level to catch unforseen bugs. I have used this very often in other debuggers as well.

 

This ADC peripheral project was translated and re-compiled in the KEIL MDK5 version. Hence you can see the CMSIS in this project window.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Debugging using the Logic Analyzer

 

The Logic Analyzer is a tool where you can see the changes in variables or VTREGs. They can be user specific but are subject to some restrictions. It uses trace information from Cortex-M3, M4, M7 devices to display data when used together with a debugger. Ref: Cortex-M Trace Configuration

 

There are certain restrictions on debugging using Logic Analyzer. The Logic Analyzer cannot record CPU registers, I/O pins of communication peripherals such as UART, CAN, SPI Memory BUS signals, Automatic variables inside a function. The logic analyzer can record peripheral registers, VTREGs and upto 4 global program variables.

 

I used the Virtual Simulation Registers (VTREG) method. VTREGs uses the CPU's simulated pins for input and output. They give a way to specify signals coming into the CPU from a simulated piece of hardware. VTREGs are not public symbols nor do they reside in a memory space of the CPU. The utilization of VTREGs is CPU dependent. Use command DIR VTREG to find your CPU specific signals which can be used. I tested it for the Cortex M0 Core.

 

image

Fig:  Virtual Simulation Registers (VTREG) for Cortex M0

 

image

Fig: CORE_CLK Error in Logic Analyzer

 

image

Fig: Some success at measuring the ultra low power at the board

 

Debugging with System Analyzer in Cortex M0

 

As again; the clock measurement feature works only for Arm Cortex-M3, Cortex-M4, and Cortex-M7 devices and not for Cortex M0.

 

image

Fig: No clock Measurement can be seen here

 

image

Fig: Again Not supported for Cortex M0 in System Analyzer

 

Similarly to the other test I also tested with CMSIS in the ARM Cortex-M3 in uVision Simulator.

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

Performance Analyzer in KEIL MDK Professional

 

Another cool feature that I tested with the KEIL MDK professional using the ARM Cortex-M3 in uVision Simulator was the performance analyzer. It shows statistics, like time and number of calls of a function or module during code execution.

 

image

Fig: Performance Analyzer Window Options Explained

 

image

Fig: Performance Analyzer in Real Time Execution

 

image

Fig: Performance Analyzer with CMSIS RTOS

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Fig: Real Time Execution of Performance Analyzer

 

ITM and DWT trace debugging

 

ITM and DWT trace are also unsupported for the Cortex M0 devices. I just confirmed it today with the ARM Tech Support.

 

image

Fig: Unsupported Trace debugging

 

image ITM and DWT trace debugging are unavailable in  MCB11U10MCB11U10  MCB1114MCB1114 or  MCB11C14MCB11C14 boards because their MCUs do not provide the Serial Wire Output(SWO signal needed). As a result the Logic Analyzer and OS Event Viewer features of the debugger in real time are also not available because they too require the SWO signal. And none of the MCB1000 boards support a JTAG interface.

 

Power Measurements with ULINKplus debugger and EA LPC11U37H LPCXpresso Board

The ULINKplus adapter allows power measurements during execution as well as in non execution mode. So basically when the shunt is connected to the ulink plus debugger it acts as an Ammeter which is connected in series to the power pin which needs to be measured. For example if you want to measure the current consumption of the MPU connect one end to the MPU_PWR pin; GND on board; and other to the 3V3_PWR pin. And this current and voltage consumption can be seen in the System Analyzer. These measurements can be done during run-time or also only in debug mode without the SWD. For debug mode without the SWD is referred as the Debug — Energy Measurement without Debug

 

The power measurement setup. Reference

 

image

Fig: Setup for Power Measurement

 

  • Next step is to configure the ULINKplus and KEIL MDK5 for power measurement.
  • ULINKplus window configuration for the power measurement.
  • Setting up the Debug_UlinkPlus.ini file and the proper configuration Wizard settings for the shunt used
  • Do the offset calibration for current in the  Energy measurement without debug mode

 

image

Fig: My simple set up for power measurements

 

Analyzing power consumption in System Analyzer window as seen below. In the System Analyzer window; the consumption part displays the voltage and current readings captured by ULINKplus.

 

image

Fig: Setting up the Debug_Ulink.ini Configuration wizard to chose the appropriate Shunt value

 

 

image

Fig: Power consumption measurements for the LPC11u37H CPU core

 

Since the  ITM and DWT trace debugging are unavailable for Cortex M0 I could only do power measurements only in the debug mode and not the run-time mode

 

In short, Cortex M0 is not the best MCU to work with if one wants to explore the new features offered by the ARM ULINKplus. Although most of the features that I did want to explore for the device were successful but not to the complete extent.

  • Sign in to reply

Top Comments

  • snidhi
    snidhi over 7 years ago +4
    Thanks John, I can totally understand that. It was like catching a dinosaur by its tail. My emotions right now Cheers
  • dougw
    dougw over 7 years ago +4
    Great work. Excellent perseverance. I hope your next road test is easier, but the hard ones do give a sense of accomplishment and we appreciate it when someone else does the heavy lifting.
  • genebren
    genebren over 7 years ago +3
    A very nice addition to your roadtest review. I really like the power measurement feature. This a very clever addition to allow you to verify various attempts to limit power usage in your design. The Logic…
  • jw0752
    jw0752 over 7 years ago

    Hi Sneha,

    While most of what you are doing is over my head I am enjoying learning and following your posts.

    John

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • snidhi
    snidhi over 7 years ago

    Yes I had many long discussions with the ARM Tech support to get some results. I really didn't expect it to be so difficult.

     

    And they basically told me that if I use the aRM ulink debugger with their specific ARM board designed with the specific power pins to do the power measurements with the particular version of KEIL MDK with the specific upgraded software only then I can expect results.

     

    They did admit that the device is so new that there are really not many development boards adapted for to do these tests.

     

    It was somewhat silly and funny. Ain't nobody got time for that. image

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 7 years ago

    A very nice addition to your roadtest review.  I really like the power measurement feature.  This a very clever addition to allow you to verify various attempts to limit power usage in your design.  The Logic analyzer is also a handy feature to chart changes.

     

    Well done!

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 7 years ago

    Nice start.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube