2022-01-12 06:49 AM
2022-01-12 08:38 AM
ITM and VCP are separate paths. If you want data out of the VCP COM port, you'll need to use the appropriate UART channel rather than using ITM.
https://community.st.com/s/article/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages
2022-01-12 08:49 AM
Not how it works.
Technically they probably could create a VCP that way, but they don't.
Need to use a physical one on the ST-LINK/V2-1 devices
2022-01-12 02:25 PM
Have a look to: https://adastra-soft.com/poor-man-arm-cortex-m-swo/
2022-01-12 03:16 PM
I cannot get the point of that additional FTDI C232HM hardware. I'm just using SWO which is present on ST-LINK on a Nucleo board and connected to both - the on-board slave MCU and a header for external boards. And, by initializing the SWO output only on a single one of those simultaneously, I can switch from one to another without hardware modification. Debug, SWO and VCP - it all works simultaneously with just a single USB cable and a bare Nucleo board at the end of it.
2022-01-13 04:57 AM
Interesting.
How do you get and display the data from the SWO through the STLINK usb?
2022-01-13 03:53 PM
Sorry, forgot to mention that the board is NUCLEO-F767ZI, but I'm using J-Link GDB Server and J-Link SWO Viewer and onboard ST-LINK is re-flashed as a J-Link:
https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/
Just in case you want to try - it's an easily reversible action. The main reason for me is J-Link has a workaround implemented for the Cortex-M7 core bug, which makes single step debugging next to impossible. On firmware side I'm doing just this without any other code related to debug hardware:
static int SWO_Output_(int ch, lwprintf_t* lwp)
{
if (ch != '\0') {
ITM_SendChar(ch);
}
return ch;
}
Some time ago I remember ST-LINK Utility being capable of showing SWO data. CubeIDE should also be capable of doing it, isn't it?
2022-01-14 05:33 AM
Thank you. I was not aware of the M7 core bug.
Yes CubeIDE can display SWO data, but only at slow baud rate.
I use SWO at high speed (8-12 Mbits/s) to get data traces for some tricky algorithms (~20-40 char every ms). without timing disturbance.
And the processing software receives this data directly