cancel
Showing results for 
Search instead for 
Did you mean: 

setup SWV on STM32F429_Discovery board

jo
Associate II
Posted on December 23, 2014 at 19:37

How to setup SWV on this board? Do I need to solder SB9? pin T_SWO

#!stm32f4-disco #swv-st-link/v2 #printf-fprintf-itm
10 REPLIES 10
Posted on December 23, 2014 at 20:55

Yes you'll need to solder the bridges (varies by DISCO, some come made, others not) to connect SWO (PB3) to the ST-LINK.The viewer software needs be configured to the speed of the processor, whatever your clocks/PLLs are set too, 168 MHz, 180 MHz, etc.For things like Keil you'll need to configure the Trace pane, for the ST-LINK SWV screen mostly just the frequency.You STM32 based code will need to output via the ITM functions, and pipe printf/putchar functionality through suitable hosting code.

https://community.st.com/0D50X00009Xkh5nSAB

 

GNU printf via SWV

 

https://community.st.com/0D50X00009XkhwgSAB

 

Keil SWV hosting - STM32F3-DISCO but on point.

Edited: Removed DEAD LINKs, original post from 23-Dec-2014

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jo
Associate II
Posted on December 24, 2014 at 10:20

@clive1 Tnx for the nice links to other threads! When I queried here in the bin on 'swv' I didn't get those links.

Posted on December 24, 2014 at 16:56

When I queried here in the bin on 'swv' I didn't get those links.

The search feature on this Microsoft forum are worse than useless, I use Google to find my old stuff and related posts. The links to forum posts are also ridiculously long, and the software is dysfunctional from mobile devices (tablets and phones)

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jo
Associate II
Posted on December 25, 2014 at 10:07

I soldered SB9. So SWO is short with PB3.

If I debug ITMDebugEnable

void Debug_ITMDebugEnable(void) 
{ 
volatile unsigned int *ITM_TER = (volatile unsigned int *)0xE0000E00; 
volatile unsigned int *SCB_DHCSR = (volatile unsigned int *)0xE000EDF0; 
volatile unsigned int *DBGMCU_CR = (volatile unsigned int *)0xE0042004; 
*DBGMCU_CR |= 0x27; // DBGMCU_CR 
if ((*SCB_DHCSR & 1) && (*ITM_TER & 1)) // Enabled? 
Debug_ITMDebug = 1; 
}

Debug_ITMDebug don't get '1' because the value in ITM_TER at address 0xE0000E00 stays 0x00000000. SCB_DHCSR at 0xE000EDF0 value is 0x00030 Whyis theITM_TER register for? I can't find the answer in 'ST'-manual RM0
Posted on December 26, 2014 at 17:02

The ITM is part of the Cortex-M4 core, you'd need to review ARM's documentation for this, not ST's.

You might want to look at what the registers are set to by the ST-LINK Utilities SWV window.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jo
Associate II
Posted on December 27, 2014 at 11:46

0690X00000602QjQAI.bmpThis info confuse me. Do I need to select JTAG for ITEM debug?

jo
Associate II
Posted on December 27, 2014 at 13:15

I believed semihosting, as they use in CoIDE, was the same as ITM debug. But it's a completely different concept. CoIDE support ITM debug in anyway? Or what viewer is applicable?

jo
Associate II
Posted on December 27, 2014 at 13:56

Finally installed the ST-link utility. Registers are ok now. With default clock setting in  SWO viewer, stimulus port 0, there are some strange characters printed on the console.

If I change clock setting to the systemclock no characters are printed. I select all channels.

In memory region 0xE0001000 - 0xE0001001 values are constant changing.

jo
Associate II
Posted on December 27, 2014 at 14:28

Device reset and the beast is working!