cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 trace problem with ST-LINK/v2 fw V2.J19.S0

matt
Associate
Posted on March 24, 2014 at 02:43

Hi all,

I am using the STM32's ITM to output log messages to my PC via SWO.  However, I have run into issues with losing characters (as has been noted elsewhere; e.g.,

/5056d518

).  Apparently ST-LINK fw V2.J19.S0 improves the situation somewhat, so I updated the firmware on my STM32F3DISCOVERY board to this version.  However, with the v19 firmware, I only ever receive 24 characters from the ST-LINK, after which point I have to unplug/replug the device in order to be able to restart tracing.

I wrote a simple application to test this further:

int main(void) {

    while (1)

        ITM_SendChar('x');

}

With ST-LINK fw V2.J17.S0 this outputs a continuous stream of x characters as expected (viewed using the Serial Wire Viewer component of the STM32 ST-LINK Utility).  However, when I update the ST-LINK to V2.J19.S0, and perform exactly the same steps I only ever receive 24 x characters.  If I inspect the SWO pin on the board, I see that there is still data being sent from the STM32 to the ST-LINK.

I have looked at a sniff of the USB traffic and what I see happen is as follows. The host asks the device how much trace data it has ready, to which the device replies with a large amount (large in this case being > 42 octets).  However, when the host fetches the data from the trace endpoint it only gets 42 octets (i.e., 24 characters of trace data, plus ITM headers).  From then on, when the host asks the device how much trace data it has ready the device constants replies with 0 octets.

I am running the latest version of the ST-LINK utility (v3.3.0) with STLinkUSBDriver.dll v4.3.1.0.

For now I have to work around this by downgrading back to V2.J17.S0 (which is the firmware packaged with the ST-LINK utility that I am using).  Has anyone else encountered this problem?  Is there a known solution?

Regards,

Matt

#st-link/v2-itm-trace-v2.j19.s0
2 REPLIES 2
S C
ST Employee
Posted on March 24, 2014 at 10:11

Hello Matt,

I confirm the regression in V2J19 on ST-Link/V2 boards. This will be fixed in a version V2J20 which should be available in the beginning of April. Until then please keep the version V2J17. Sorry for the annoyance.

SC
matt
Associate
Posted on March 24, 2014 at 20:27

That's good to know.  Thanks for the update.