Using ARM Cortex-M Single Wire Output (SWO)
About this document
This document describes how to use Cortex-M SWO to output data from 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.
- Software capable of driving and outputting data from an SWO source. (ST-Link)[http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link004.html] is an excellent tool for this purpose.
- Set nanoFramework build options to include support for SWO (either setting
"SWO_OUTPUT" : "ON"in cmake-variants.json or launching CMake with -DSWO_OUPUT=ON).
Load the target flash with a nanoFramework image build with SWO option
On ST-Link menu choose ST-Link -> Printf via SWO viewer
- After SWO viewer windows loads, set the Sytem clock to match the target and the Stimulus port to
- Click the Start button and watch the output in the main window area.