-
1Setup Debugger
From Mbed Studio, select Target and click the little chip to set up a new debug probe.
Under Debug Flags, you'll find a large number of items populated once you pick the USB device. Add the following (don't change anything that is there):
-O enable_swv=1 -O swv_system_clock=96000000 -O swv_raw_port=3443 -O swv_clock=2000000
Set everything else up as normal. You may have to adjust your system clock and/or baud rate. Here we have 96MHz and 2MHz.
By default the decoded port is on 4444.
If you are not using Orbuculum, you can omit the -O swv_raw_port=3443 option.
-
2Test
When running the debugger, you should be able to connect via telnet to localhost:3443. If not, something is wrong. This is the same port the Orbuculum tools use. If you run your program you will see the output but it is in the SWV format so it will be gibberish mixed in with your data. This step isn't necessary, but it is a quick way to tell if you have the command line right.
-
3Set up for real
Close the telnet program if you opened it. When you start the debugger, use the top menu bar to open a new terminal. Inside the new terminal enter:
orbcat -c 0,"%c"
This will decode channel 0 as a character in the display. You can add more -c if you want to mix in different channels or use different channels. For example:
orbcat -c 4,"%c"
The %c is a printf specifier so you could do more decoding that way.
You can also connect to port 4444 to see the decoded SWO data directly from PyOCD. Then it is mixed up and unformatted, but you can do it that way with no extra tools.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.