cancel
Showing results for 
Search instead for 
Did you mean: 

SWD on STM32F3 Discovery rev B

smith
Associate II
Posted on October 16, 2016 at 20:38

I have noticed on the new rev (C) of the STM32F303 Discovery board that a Single Wire Debugger (SWD) port enumerates when plugging in the st-link cable.

This is not present on the rev B.  Is there any way to get this going on the rev B?

I am using this board in a teaching environment and have had a lot of reliability of the virtual com port (on the user port) issues in windows after programming the board to support the vcp.  I see that the SWD communications is very reliable and would be nice if I could get this working on a rev b (some students have the older rev).

So is there any way to get this working?
9 REPLIES 9
Posted on October 17, 2016 at 02:16

Start by getting the ST-LINK Utilities, and updating the firmware to the current level. This will save relitigating all the bugs and failures to this point.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smith
Associate II
Posted on October 17, 2016 at 23:09

Yes already did that and I got thinking that stm32cubemx enabling the serial wire debugger might make this work but so far no go.

Posted on October 18, 2016 at 18:21

You'd need to review the default settings of the solder bridges between the versions, I haven't reviewed the schematic.

The ST-LINK chip is now in two varieties, the DISC1 series boards uses the more advanced part and supports the VCP and mbed.

CubeMX really shouldn't impact the behaviour of the ST-LINK, that would really be a combination of firmware and drivers.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on October 18, 2016 at 18:24

Serial Wire Viewer (SWV) ? Check the solder bridge connecting PB3

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
smith
Associate II
Posted on October 26, 2016 at 20:16

Correct me if I am wrong, but the previous ST-Link on the Rev B board does not have a CDC class entry in its USB descriptors, connecting the jumpers will have no effect.  I figured cube would have no effect but was grasping as straws.  The manuals for the boards to me is of no help.

At the end of the day I need a serial connection that students can provide keyboard input and terminal output on.  I know there is a virtual com port endpoint for cdc class but it is proving to be unreliable but the SWD port is reliable on the computers in the classrooms.

Posted on October 26, 2016 at 20:36

As previously indicated there are two varieties of boards now, the original DISCO and the new DISC1. The latter has a different F103 chip, with more FLASH/RAM and supports mbed and VCP. You can't make the older board use the newer firmware/functionality. Sorry, I don't track board revisions, or work for ST.

Both boards can use the SWV (Serial Wire Viewer), which is operable as a window in Keil (and probably IAR, etc) and as a pop-out from the ST-LINK Utilities. This can provide output diagnostic messages, and can retarget printf(), putchar(), etc.

STM32F3-DISCO SWV example at the end of this thread

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32F3%20new%20project&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=719

Trace settings in KEIL

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/stm32%20evaluation%20board%20%20printf%20in%20Keil%20uVsion5&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=333]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2Fstm32%20evaluation%20board%20%20printf%20in%20Keil%20uVsion5&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=333

How it looks in KEIL and ST-LINK Utilities

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Debugging%20with%20STM32F401C%20Discovery&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=18...

More threads

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/setup%20SWV%20on%20STM32F429_Discovery%20board&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentvie...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Walid FTITI_O
Senior II
Posted on October 27, 2016 at 10:53

Hi smith.allan.001, 

As mentionned in the STM32F3Discovery User manual:

''The ST-LINK/V2 on PCB version A or B or the ST-LINK/V2-B on PCB version C isembedded as programming and debugging tool. Virtual COM port and USB mass storagefeatures are supported by the ST-LINK/V2-B only.The embedded ST-LINK/V2 (or V2-B) supports only SWD for STM32 devices. Forinformation about debugging and programming features refer to ST-LINK/V2 in-circuitdebugger/programmer for STM8 and STM32, User manual (UM1075), which describes indetail all the ST-LINK/V2 features.

So the discos revision B do not support the VCP and MSC. To do the same Lab, you would bring rev C discos .

-Hannibal-

smith
Associate II
Posted on October 31, 2016 at 00:25

Thank you for the information.  

Clearly the user manual is incorrect here as we have been using the Virtual Com Port on the Rev B for well over a year.  It is just the Rev C DISC1 version has the virtual com port built into the st-link connection port.

The issue here for us is there is a mix of the old and new boards in play here.  For some reason with the Atollic TrueStudio IDE the virtual com ports have been unreliable on both the Rev B and C hardware.  This is not likely an issue with STM but with the way the drivers are setup on the student computer images.

So that is where I started to look at a work around via SWD port, but that is not supported on Rev B boards.

smith
Associate II
Posted on October 31, 2016 at 00:31

Darn, every solution has another roadblock.  The free version of the development tool we are using does not support SWV.  Unfortunately that is the one we have to use due to licensing costs in the teaching environment.

We might have to revisit the decision to not use Kiel tools.