How to configure SWO for EWARM V8

From SEGGER - Support Wiki
Jump to: navigation, search

IAR's EWARM is a J-Link compatible 3rd party IDE that supports most J-Link features out-of-the-box. With EWARM release version 8 some default project settings for SWO configuration with J-Link got changed and thus manual correction by the user is currently necessary. The following article will show a step by step guide how to set up SWO trace in a EWARM project and common troubleshooting tips to solve any issues a user might run into.


Example Setup

The setup guide will be based on the following hardware and software components:

  • J-Link Software Package V6.18c or later
  • IAR EWARM V8.11.2
  • SEGGER emPower evaluation board
  • Any J-Link/J-Trace hardware
  • Physically connected SWO pin to debug interface

Setup Guide

  • Open up an EWARMv8 project and make sure the correct target device is selected (in case of the emPower board it is the NXP MK66FN2M0xxx18).
Select target device
  • Next change the project settings to use SWO instead of Semihosting.
Select SWO
  • Make sure J-Link/J-Trace is selected as debug hardware.
Select J-Link as debug hardware
  • Detect actual SWO clock speed by using SEGGER's J-Link SWO Viewer for example, make sure that at this point your target application has been downloaded once so all PLL settings have been applied. For this first close all open connections to J-Link, open SWO viewer, select your device and press measure.
Measure SWO clock
  • Insert the measured SWO clock value in the EWARM project settings as close as possible to the measured value and set SWO clock to "Auto".
Set SWO clock
  • Now start the debug session and open the Terminal I/O window under View-> Terminal I/O, the printf output will now be displayed in that window.
Terminal Output

A basic EWARMv8 project for the emPower board with all settings applied can be found here: SEGGER_emPower_SWO_EWARMv8.zip

Troubleshooting

  • The Terminal I/O windows is still not showing any information even after following the setup guide step by step.
    • Make sure the SWO pin is actually connected to your J-Link debug hardware, many J-Link OBs for example do not have SWO routed to them.
    • Check if the selected target device is correct.
    • Create a testloop in your application where repeatedly prinf is called and see if that message is displayed in the J-Link SWO Viewer, if this is the case then the EWARM project settings are still incorrect.
  • I want SWO to output PC and timestamps.
    • To do so you need a running debug session, now go to J-Link->SWO Trace, press the "On" button in the now open window, then go to J-Link->SWO Trace Window Settings... and select all advance SWO features you want to monitor in the SWO Trace window.
Select advanced SWO features
  • I want to use SWO and JTAG simultaniously, how can i do that?
    • This is not possible as the TDO (JTAG) signal is sharing the same pin as SWO. To be able to use SWO a SWD debug connection is required.
  • I can't start a debug session
    • Is the target device powered properly? You can open the J-Link Commander to see what voltage is currently showing as VTREF in the console output. Is that value expected?
    • Try to use the J-Link flash loader to program the target device instead. To do that simply uncheck the following option in project settings.
Select J-Link flash loader

If there are still issues persisting feel free to contact our support: support@segger.com