Difference between revisions of "How to configure Embedded Studio to use SWO"
(→Measuring with J-Link SWO Viewer) |
(Redirected page to SEGGER Embedded Studio) |
||
Line 1: | Line 1: | ||
+ | #REDIRECT [[SEGGER_Embedded_Studio]] |
||
− | SEGGER Embedded Studio can use SWO for printf Output to the Debug Terminal and for code profiling and execution trace. This article describes the configuration of a project in Embedded Studio to enable SWO. |
||
− | |||
− | __TOC__ |
||
− | |||
− | |||
− | == Example Setup == |
||
− | The setup guide will be based on the following hardware and software components: |
||
− | * J-Link Software Package V6.18c or later |
||
− | * Embedded Studio V3.26a or later |
||
− | * [https://www.segger.com/evaluate-our-software/segger/empower/ SEGGER emPower] evaluation board |
||
− | * Any J-Link/J-Trace hardware |
||
− | * Physically connected SWO pin to debug interface |
||
− | |||
− | == Setup Guide== |
||
− | # Open your project in Embedded Studio |
||
− | # In the Project Explorer select the project and go to Project-> Edit Options... |
||
− | # Go to Debug -> Target Trace |
||
− | # Select SWO as Trace Interface Type |
||
− | # Enter the Trace Clock Speed: The trace clock speed is usually the target CPU speed while the application is running. |
||
− | # Enter the SWO Baud Rate: The SWO baud rate (or SWO speed) needs to match the trace clock speed and the used J-Link. |
||
− | # Click OK |
||
− | # Start a debug session |
||
− | # Open the Execution Profile Window (View -> More Debug Windows -> Execution Profile) |
||
− | # Open the Execution Trace Window (View -> More Debug Windows -> Execution Trace) |
||
− | [[File:1_Check_Target_Device.PNG|thumb|Check if correct device and debugger is selected|none]] |
||
− | [[File:2_SWO_Settings.PNG|thumb|Set SWO speed and baud rate|none]] |
||
− | [[File:3_Execution_Profile.PNG|thumb|Execution Profile|none]] |
||
− | [[File:4_Execution_Trace.PNG|thumb|Execution Trace|none]] |
||
− | |||
− | A basic ES project for the emPower board with all settings applied can be found here: [[Media: EmPower_ES_SWO.zip | emPower_ES_SWO.zip]] |
||
− | |||
− | == Measuring CPU speed == |
||
− | If the target CPU speed is not known it can be measured with J-Link Commander or J-Link SWO Viewer. |
||
− | |||
− | === Measuring with J-Link Commander === |
||
− | * Open J-Link Commander |
||
− | * Connect to your device |
||
− | * Execute "testcspeed <RamAddress>" |
||
− | [[File:Test_CPU_Speed.PNG|thumb|Measure CPU clock in J-Link Commander|none]] |
||
− | |||
− | === Measuring with J-Link SWO Viewer === |
||
− | * Open J-Link SWO Viewer |
||
− | * Select target device |
||
− | * Click measure |
||
− | [[File:SWOViewer_GUI_Conf.png|thumb|Measure SWO clock|none]] |
||
− | |||
− | == Calculating the SWO speed == |
||
− | The supported SWO speeds depend on the connected emulator. They can be retrieved from |
||
− | the emulator. To get the supported SWO speeds for your emulator, use J-Link Commander, connect to your target and execute the command "SWOSpeed" without quotations marks. |
||
− | The listed speeds can be set as SWO baud rate. |
||
− | |||
− | == Troubleshooting == |
||
− | |||
− | * The Terminal I/O windows are 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. |
||
− | |||
− | * 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? |
||
− | |||
− | |||
− | If there are still issues persisting feel free to contact our support: [mailto:support@segger.com support@segger.com] |
Revision as of 17:57, 23 October 2018
Redirect to: