2014-12-23 10:37 AM
How to setup SWV on this board? Do I need to solder SB9? pin T_SWO
#!stm32f4-disco #swv-st-link/v2 #printf-fprintf-itm2014-12-23 11:55 AM
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
2014-12-24 01:20 AM
@clive1 Tnx for the nice links to other threads! When I queried here in the bin on 'swv' I didn't get those links.
2014-12-24 07:56 AM
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)2014-12-25 01:07 AM
I soldered SB9. So SWO is short with PB3.
If I debug ITMDebugEnablevoid 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
2014-12-26 08:02 AM
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.2014-12-27 02:46 AM
This info confuse me. Do I need to select JTAG for ITEM debug?
2014-12-27 04:15 AM
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?
2014-12-27 04:56 AM
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.2014-12-27 05:28 AM
Device reset and the beast is working!