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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
Blog Power and Events Measurements with ULINKplus
  • Blog
  • RoadTest Forum
  • Documents
  • RoadTests
  • Reviews
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • 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 2008 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…
  • three-phase
    three-phase over 7 years ago

    Excellent detailed post on you work, very interesting to read.

     

    kind regards

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

    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.

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

    Thanks John,

     

    I can totally understand that. It was like catching a dinosaur by its tail.

     

    image

     

    My emotions right now

     

    Cheers image

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

    Thank you michaelkellett for your input. Atleast I am not alone in this  image

     

    I think that the documentation is very distributed an dispersed on the website.One has to go through many layers of reading to get the full essence of the features and what the debugger can and cannot do. If I had a clue about the Cortex M0 issues since the beginning I would have opted for a different board since the start.

     

    I went through many websites to come around with the device and the debugger. NXP tech support, ARM tech support, KEIL tech support,CMSIS support. I think they really need to consolidate the documentation and make it more easier to find stuff.

     

    I had to call the tech support and then only he pointed me to look through the connectivity of MCBSTM32F200 board to understand the physical connections else I was lost. I have also raised these concerns openly with their field applications engineer in Germany. 

     

    I am not surprised that many road-testers could not get around with it.

     

    Cheers image

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

    I rather agree with your overall impression of the UlinkPlus as it seem to be emerging. It's interesting to see it through a new user's eyes. You've done a lot of work to get uVision/UlinkPlus working and doing anything and showing the results/issues.

     

    I paid for mine and I'd score it between 5 and 6 out of 10.

     

    I'm not bothered by the lack of connectorised support of dev boards for the UlinkPlus  - I put debug connectors on all my designs to suit the project (usually Molex Pico Blade series) and I make adapter leads to suit. I very rarely use dev boards of any kind.

     

    I'd agree that UlinkPlus with M0 makes little sense (because you can't use it's best features) - yet the current measurement is most likely to be interesting with M0 class processors.

     

    For my money I think Keil/ARM would do far better with separate tools to measure current and do debugging whilst still integrating the captured data in the uVison software.

     

    MK

    • Cancel
    • Vote Up +2 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 © 2025 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