cancel
Showing results for 
Search instead for 
Did you mean: 

Use Serial Wire Viewer on Cube Programmer for STM32 F405 Feather

vs13
Associate II
I want to read the serial output from the STM32 F405 Feather using the SWV on Cube Programmer, but I do not receive Serial output from the board. I am running the .hex file from this Arduino sketch on the board:

 

#include <SWOStream.h>
SWOStream s(2000000, SWO_Async, 0, false); //swoEnable = false

void setup() {
  delay(150);
}

void loop() {
  s.print("Serial is alive!");
  delay(500);
}

 

I have searched through the board documentation over and over and I can't find what clock frequency to use in my program and in the SWV terminal on Cube Programmer, so if anyone could point me in the right direction, it would be appreciated!
13 REPLIES 13

@BarryWhit wrote:

That looks just like the cheap chinese ones. I know because I had one and instead of risking damaging it with my shaky hands to get SWV working, I got a better quality one which worked immediately.  Are you sure you bought that from ST?

https://www.eevblog.com/forum/microcontrollers/quick-hack-to-get-swo-on-st-link-clones/


I could have sworn I did buy it from ST, but darn, I'll have to make sure. Before I risk damaging it with the bodge wire (haha), is it possible to get SWV working using the SWIM pin?

BarryWhit
Senior III

The SWO pin isn't routed to the external connector on these clones, AFAIK there's no way around a bodge to get it working. 

 

If you attempt the mod, be very careful. The PCB inside the clone can change from seller to seller and over time. An EEVblog post from 10 years ago might contain information that does not apply to your board so make sure you're not blindly following but actually understand what you're trying to do. Or, buy a better ST-LINK (original or clone).

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.

@BarryWhit wrote:

The SWO pin isn't routed to the external connector on these clones, AFAIK there's no way around a bodge to get it working. 

If you attempt the mode, be very careful. Clones are uncharted territory, and the board may change from seller to seller and over time. An EEVblog post from 10 years ago may contain information that does not apply to your board so make sure you're not blindly following but actually understand what you're trying to to. Or, buy a better ST-LINK (original or clone).


Sigh, that's a good point. I'll just try to order a new one and make sure it's not a clone, thanks for all of your help!

BarryWhit
Senior III

@vs13 , see this thread for identical situation and high-res photos of mod (may or may not be same board as yours), if you're thinking of doing it.

- If a post has answered your question, please acknowledge the help you received by clicking "Accept as Solution".
- Once you've solved your issue, please consider posting a summary of any additional details you've learned. Your new knowledge may help others in the future.