Skip to content
This repository has been archived by the owner on Jun 5, 2019. It is now read-only.

Diagnostics and Troubleshooting

CW2 edited this page Sep 13, 2016 · 1 revision

Diagnostics and Troubleshooting

The NETMF provides two communication channels for debugging and tracing messages:

HAL Name Symbolic Name
DebugTextPort DEBUG_TEXT_PORT
stdio STDIO

DebugTextPort is communication channel for debug messages in the debugger and is accessed via debug_printf() function in the HAL/PAL and System.Diagnostic.Debug.Print() method in managed code.

stdio is an internal HAL/PAL debug and tracing channel accessed via hal_printf() function and allows messages in the Debugger and DebugTextPort transport drivers.

Instrumentation Trace Macrocell (ITM) Transport

The Cortex-M3/M4/M7 incorporates Instrumentation Trace Macrocell (ITM) unit that provides together with the Serial Viewer Output (SVO) trace capabilities. The ITM has 32 communication channels, the current version of NETMF support only channel 0 (defined as ITM0).

Solution Configuration

To configure DebugTextPort and stdio for ITM transport, define the following symbols in the platform_selector.h:

#define DEBUG_TEXT_PORT     ITM0
#define STDIO               ITM0

Viewing the ITM output - STM32 Discovery and Nucleo boards

The ITM output is delivered through the onboard ST-LINK/V2 debugger and can be easily viewed in STM32 ST-LINK utility application:

  1. Launch STM32 ST-LINK Utility
  2. On the ST-LINK menu select Printf via SWO viewer
  3. In the Serial Wire Viewer dialog enter System Clock value (SYSTEM_CLOCK_HZ from platform_selector.h) and set Stimulus port to 0 or All
  4. Press the Start button

Example ITM output from STM32F746-Nucleo board running at 192 MHz

STM32 ST-LINK SWV

For additional information please refer to UM0892: STM32 ST-LINK utility software description (PDF).

Clone this wiki locally