-
Notifications
You must be signed in to change notification settings - Fork 223
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.
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
).
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
The ITM output is delivered through the onboard ST-LINK/V2 debugger and can be easily viewed in STM32 ST-LINK utility application:
- Launch STM32 ST-LINK Utility
- On the ST-LINK menu select Printf via SWO viewer
- In the Serial Wire Viewer dialog enter System Clock value (
SYSTEM_CLOCK_HZ
fromplatform_selector.h
) and set Stimulus port to 0 or All - Press the Start button
Example ITM output from STM32F746-Nucleo board running at 192 MHz
For additional information please refer to UM0892: STM32 ST-LINK utility software description (PDF).