AnsweredAssumed Answered

STM32F4Discovery STLink/V2 SWV

Question asked by soo.jonathan on Sep 17, 2014
Latest reply on Sep 17, 2014 by soo.jonathan
I've been running into a problem with STLink/V2 SWV output when running firmware V2J21S0. The first time after plugging into USB, trace output works great. However, after disconnecting from the target and then reconnecting (keeping it physically plugged in) SWV output is garbled or nonexistent.

To reproduce this using the ST-LINK Utility on Windows, do the following (assuming you have firmware programmed that does SWV output):

1. Unplug and re-plug the STM32F4DISCOVERY board.
2. Connect to the target.
3. Open the Serial Wire Viewer and press "Start". You should see trace output.
4. Press "Stop". The trace output should stop.

Steps 5 and 6 below confirm that you can restart trace within a single session.

5. Press "Start". The trace output should continue. 
6. Press "Stop. The trace output should stop.

7. Close the SWV window and disconnect from the target.
8. Connect to the target.
9. Open the SWV window and click "Start". At this point you should see the "Printf data number" incrementing, but see no output or possibly garbled output.

If you then disconnect and repeat steps 1-4 again (unplugging and replugging the device) you should see trace working again.

I've reproduced this with multiple tools running on OSX including my own custom scripts. Unfortunately this makes it impossible to do any automated testing using SWV output.

Can anyone point me to a fix or to the best place to file a bug report?