cancel
Showing results for 
Search instead for 
Did you mean: 

Am I a dinosaur for still debugging over serial UART-USB links?

brinkand
Associate II
Posted on November 10, 2015 at 14:30

I am coming from NXP and Atmel ARM/AVR and used to debug program flow over RS-232 in addition to singlestepping and register readout etc. Serial IO and support for stdio used to be a default example project on other platforms, but I am having problems using it with my new STM32F4 project. There are examples included with the STM32 Cube, but the stuff is spread over many files which makes it a pain to move to my project. 

So I am thinking: Am I missing out on something that completely outdates a good serial link? Or have I just overlooked the great example project (UART and printf()) that everyone else use for serial links? 

My application actually also needs some easy-to-implement communication to a Win7 C♯ application, so I will need serial for other things than debugging. 

I appreciate any comments or suggestions!

#serial #stm32 #uart #debug
4 REPLIES 4
Posted on November 10, 2015 at 15:07

You could be a millennial and have no idea what your code does or how it flows unless you step through it in painful detail. I'd say it's puts you at an advantage.

Both Keil and GNU/GCC have methods to retarget the STDIO to a USART or SWV, these usually require you initialize the port/pins and provide character input and output functions. SWV (Serial Wire Viewer) is the Cortex equivalent to the ARM DCC (Debug Comm Channel). It uses a pin on the debug interface and provides serial like functionality with the debugger. The DISCO and NUCLEO boards with mbed also support a VCP via the ST-LINK's USB connection.

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/%C3%A8%20possibile%20usare%20printf&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=1256

https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Discovery/%C3%A8%20possibile%20usare%20printf&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F&currentviews=1256

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
brinkand
Associate II
Posted on November 12, 2015 at 10:56

Clive, thank you for taking the time to respond and to the thread reference. Did you mean to reference two threads; the links are duplicates?

I have been using IAR so far, and will try out and possibly switch to Atollic after their new licensing scheme.

My primary board is STM4discovery, so thank you for pointing to the VCP functionality. I will test your suggestions as soon as I get back on the project!

Posted on November 12, 2015 at 11:43

There should have been two different threads, I'll have to walk back the search to remember which they were, but there are several threads on USART or SWV connectivity. The GNU/GCC ones needing a newlibs stub file so the read/write function go to the USART, etc.

The original STM32F4-DISCO does not support mbed or the VCP functionality, to my knowledge the STM32F469I-DISCO is the first too. The USART1 PA9/PA10 is also not workable of the STM32F4-DISCO, due to a very large capacitor attached to PA9. But there are others that can be used with FTDI or SiLabs USB-to-Serial chips.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
brinkand
Associate II
Posted on November 13, 2015 at 11:15

Thanks again. Good info. I'm looking forward to your thread reference. There are numerous threads on the issue, so I appreciate your help on starting the right place.