8
\$\begingroup\$

I am using STM32F4 discovery board and Atollic TrueStudio for ARM Lite 3

I would like to pass some debugging data to PC using printf and I can't find a way to do it through STLink. Is it even possible? It seems essential feature for any debugging process.

Edit: I need to use Serial Wire Viewer, but still no luck making it work.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ If you got this working could you post an example, im having the same issue and havent had any luck. I wrote my own printf function that uses the _write function in the basis syscall file. \$\endgroup\$ – JWL Jun 24 '13 at 2:33
4
\$\begingroup\$

OK, The way to achieve communication in Atollic TrueStudio for ARM Lite (yes it works under lite wersion since 3.0):

  1. Enable Serial Wire Viewer in active debug configuration
  2. Show SWV Console (under Debug prespective)
  3. Open Serial Wire Viewer settings (first button in SWV Console window)
  4. Enable ITM Stimulus Port 0
  5. Enable Start/Stop Trace button in SWV Console (second button)
  6. Use ITM_SendChar function
  7. Enjoy debugging strings!
\$\endgroup\$
1
  • \$\begingroup\$ This also works on Keil uCVision with all the ulink jtag family. \$\endgroup\$ – Katte May 10 '12 at 12:13
0
\$\begingroup\$

It is using Crossworks.. In crossworks, we use dbg_printf but it is slow, be warned.

\$\endgroup\$
0
\$\begingroup\$

For all CrossWorks users: the semihosting works but is slow. This is becasue cross works dosn't pass printf data through SWO but rather through JTAG/SWD interface. It halts uC and reads from register data to display. Be awere that uC stops when you are using printf function and the debugger is disconnected.

\$\endgroup\$
-1
\$\begingroup\$

Here is a complete guide for STM32F3-DISCOVERY using SWD debug:

http://controlsoft.nmmu.ac.za/STM32F3-Discovery-Board/Example-programs/Serial-Wire-Viewer-%28SWV%29

I have tested it on my stm32-discovery and it did work.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.