Using ARM Cortex-M Single Wire Output (SWO)
About this document
This document describes how to use Cortex-M SWO to output data from .NET nanoFramework.
- Target board with SWO pin free and configured in it's reset state (meaning not used by GPIO or any other peripheral and not configured in any alternate mode).
- If using a stock board it's also convenient to check the schematics if any hardware changes are required.
- STM F429I_DISCOVERY board requires solder bridge SB9 to be soldered
- STM F769I-DISCO board requires a 0 Ohm resistor on R92 (or just soldering the pads toghether)
- Software capable of driving and outputting data from an SWO source. ST-Link is an excellent tool for this purpose.
- Set .NET nanoFramework build options to include support for SWO (either setting
"SWO_OUTPUT" : "ON"in
CMakeUserPresets.jsonor launching CMake with -DSWO_OUPUT=ON).
- Step 1: Load the target flash with a .NET nanoFramework image build with SWO option
- Step 2: On ST-Link menu choose ST-Link -> Printf via SWO viewer
- Step 3: After SWO viewer windows loads, set the Sytem clock to match the target and the Stimulus port to
- Step 4: Click the Start button and watch the output in the main window area.