cancel
Showing results for 
Search instead for 
Did you mean: 

Why is SWV not working but my serial monitor is?

SFent.3
Associate II

I'm running CubeIDE version: 1.12.1 on an Apple Mac (OSx).

My board is a STM32f769i-DISCO.

I've configured the code as given in numerous examples and I can printf() without issue to an external serial port monitor. The serial monitor is one integrated into the Arduino IDE. What ever I print, appears correctly in this monitor.

I've selected SWV in the debug config, selected the appropriate CPU clock, setup to monitor the port, checked 1 and 2, and hit the red button. I do this prior to hitting 'debug'. I see nothing in SWV, I repeat the test again, this time using Arduino IDE, I see the data correctly sent.

I assume if I use a different serial monitor, this will alao work. Why is SWV not working in this case? I'd like to use the integrated SWV rather than another serial monitor program.

Regards,

Steve.

1 ACCEPTED SOLUTION

Accepted Solutions

I tried to use ITM_SendChar etc. It just didn't work. Dev time is money so  I  gave up in the end and I'm using Terminal in OSX with the scree command. Works fine for what I need.

Cheers.

View solution in original post

9 REPLIES 9
AScha.3
Chief III

in Arduino you can connect to st-link -> swv function ??? how you do?

(i see only serial /usb-cdc ports to connect, in Arduino 1.xx and 2.x )

+

serial /usb-cdc monitor in Aduino works always.

+

swv in cubeIDE worked fine for me, but suddenly no more at all.

seem more like a lottery game...hit red button and hope...hit and hope.

If you feel a post has answered your question, please click "Accept as Solution".
SFent.3
Associate II

Thanks. Hit and hope? ...Oh Jeez..Head in hands.

To monitor the serial port in Arduino, I select dev/cu.usbmodem14103 on my Mac. This I can use as an interim, but I want to use the integrated SWV (preferably).

Anyone?

SWV is very dependent on clock timing and gearing, needs to know that of the ST-LINK (different V2/V3). and what you're clocking the core at. If the two ends are mismatched you won't get trace data.

Some boards also have connectivity issues via the SB (Solder Bridges) that needs to be checked/confirmed.

ST-LINK Utilities used to have a good SWV Viewer mode, been ported to STM32 Cube Programmer, but personally haven't tried or spent time with it as using directly in Keil, or with serial ports.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
SFent.3
Associate II

I appreciate with async comms, clocks are paramount.

I found this..

https://community.st.com/s/question/0D50X00009XkddkSAB/stm32f769idisco-printf-using-itmswo

Suggesting R92 should be linked.

I will try this, but wonder why this is needed if I can see data on the port using ann external monitor running on the host (Mac)?

AScha.3
Chief III

just for fun...i tried on F303 simple test (program is only "blink LED" ;

tried with old st-link V2, this coming from console


_legacyfs_online_stmicro_images_0693W00000dDX01QAG.pngshould be: printf("clearScreen \n\r");

If you feel a post has answered your question, please click "Accept as Solution".

UART and SWO are two separate and unrelated hardware interfaces. Arduino uses UART, SWV uses SWO. While UART can be used with any terminal software, like Tera Term on Windows, for example, the SWO is feature of the debugger. And, of course, both can be used simultaneously.

Thanks for that info. I guess misunderstood. I thought the SWV would be viewing the UART1 output. This is visible on the host as the virtual com port (due to the integrated ST-LINK on the dev board). I'm sending successfully to this using printf().

So, to send to the SWV what would I need to do please?

I tried to use ITM_SendChar etc. It just didn't work. Dev time is money so  I  gave up in the end and I'm using Terminal in OSX with the scree command. Works fine for what I need.

Cheers.