Please enable JavaScript to view this site.

winIDEA Help

Version: 9.21.233

Perform SWO Calibration

In this topic:

Data Rate

Configuration

Other methods

 

This topic describes how to use the SWO Calibration which obtains the SWO clock frequency and the Prescaler (clock divider) value in a semi automated way.

 

 

Data Rate

The Data Rate setting relates to an amount of internal BlueBox clock cycles relative to one SWO bit. As the SWO uses a UART (Universal Asynchronous Receiver/Transmitter) protocol and hence the more time (cycles) per UART bit the more timing margin and hence error margin results.

 

Fastest - Starts the calibration with the fastest possible SWO clock settings and results in the highest possible SWO bit rate (speed) but potentially at the price of the stability of long trace recordings. This should only be used if the device internal clock from which the SWO clock is derived is stable, e.g., derived from a crystal oscillator.

Optimum (Recommended) - Optimum setting between speed and SWO baudrate error margin.

Slow - Offers the highest SWO baudrate error margin at the expense of speed. Use this if the clock originates from an internal oscillator which varies widely over voltage and temperature.

 

i-icon

SWO Calibration is available on the iC5700 only.

 

Configuration

number1

Make sure the SWO Trace Capture method is selected in Hardware / CPU Options / SoC.

swo-calibration-1

 

 

number2

Run the application and make sure the CPU clock is set.

The CPU should run until the clock initialization completes as the SWO clock can depend/vary based on it.

 

number3

Stop the CPU.

 

Number4

Select the Data Rate and start the SWO Calibration via Hardware / Tools / SWO Calibration.

 

swo-calibration-2

 

i-icon

Once the calibration condition - Data Rate (Optimum, Fast, Slow) is changed a new debug session should be started.

 

 

Number5

Copy the Recommended values to Current via the arrow button.

swo-calibration

 

number6

Apply the Recommended values and  transfer the results to Hardware / CPU Options / SoC / SWO.

Note that changes will apply in the next session. It is recommended to save this configuration to the workspace (File / Save All).

swo-calibration-3

 

number7

Make sure winIDEA Debug Status is OFFLINE.

Make sure that winIDEA is disconnected. If that is not the case, disconnect it via Debug / End Session.

 

number8

Perform Reset Download.

 

 

Other methods

If you are not be able to obtain the Prescaler and the Clock value by using SWO calibration tool, you can do it by one of the less commonly used methods:

Using Trace Line Calibration tool

Using Logic analyzer or oscilloscope

From CPU configuration

 

 

Using Trace Line Calibration tool

Trace Line Calibration is usually used for identifying and configuring optimal settings of trace signals when using parallel trace. However, the tool can be also used to determine the SWO clock. This is especially useful when the SWO Calibration is not supported, for example on the iC5000.

 

Follow the instructions below to measure the SWO clock with Trace Line Calibration:

1. Make sure the Parallel Trace Capture method is selected in Hardware / CPU Options / SoC.

2. Run the application. Debug status must be winIDEA-status-RUN.

3. Start the Trace Line Calibration by pressing Start in Hardware / Tools / Trace Line Calibration. Calibration can take a minute.

4. Multiply the value obtained from Measured trace clock by two.

5. In Hardware / CPU Options / SoC, select SWO Trace Capture method and enter the calculated value into the SWO / Clock field.

6. Perform Reset or Download.

 

The limitation of this method is when parallel trace is not exposed via the CoreSight 20-pin debug connector on the embedded target. In such case, use one of the next methods.

 

 

Using Logic analyzer or oscilloscope

Using the logic analyzer or oscilloscope, you can measure the SWO clock directly from the SWO pin.

 

1. Find the SWO pin on the target.

2. Connect the probe to the pin and record the signal.

3. Find the shortest pulse in the record.

4. Calculate the SWO clock frequency from the shortest measured period.

It can be assumed that the width of this pulse is equal to one period of the signal. For greater reliability, these steps can be repeated several times.

5. In Hardware / CPU Options / SoC, select SWO Trace Capture method and enter the calculated value into the Clock field.

6. Perform Reset or Download.

SWOClock_Oscilloscope

 

 

 

 

i-icon

Your application needs to ensure that the trace components and the SWO pin are configured correctly.

 

 

Clock determination from the CPU configuration

The last method is clock determination from the CPU configuration. If you decide to use this method, you must be familiar with the clocking infrastructure of your particular microcontroller. For more information, refer to the reference manual of your device.

 

Of all the above methods, this method is the least reliable, as some details can be missed quickly.

 

Copyright © 2024 TASKING Germany GmbH