cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging with STM32F401C Discovery

tgr
Associate II
Posted on November 27, 2013 at 11:42

Hi,

I am using a STM32F401C Discovery board with the L3GD20 project example and I wanted to use the Debug printf view to see what are the data coming from the gyroscope. I followed this tutorial from Keil to enable it but it isn't working:

http://www.keil.com/support/man/docs/ulink2/ulink2_trace_itm_viewer.htm

So I am asking if there is a way to use the Debug printf or not?

I also wanted to ask if there are soft examples using the accelerometer of the board.

Best regards!

Yann

#stm32f401c-discovery
19 REPLIES 19
Posted on November 27, 2013 at 11:50

SWV should work, it's dependent on a couple of things, one that PB3 is connected to the debugger (check SB15 solder bridge options), and that the frequency selected in the ''Trace'' configuration pane matches exactly with what you have the core set to run at. Nominally 84 MHz. The ST-LINK utilities also offer a SWV display.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tgr
Associate II
Posted on November 27, 2013 at 16:06

Thanks for your reply!

I don't really understand how it is supposed to work, do I have to put a jumper on the CN2 connector? And the other problem I got is that when I select an option for my device in Project->Option for target->Device->stm32f401cc, the project doesn't compile properly. It finds errors in the Drivers sources. These errors don't appear if I don't choose a device (Xtal is at 8.0 MHz but also works with 84.0 MHz) and if I load the project, it is properly working on the device...

I know my questions must be stupid but I can't figure out how to make this work.

Thanks for your time.

Yann

Posted on November 27, 2013 at 17:09

No you shouldn't have to move any connectors, and the solder bridge mentioned should already be made in the manual is correct. I know I've had to bridge some STM32F3-Discovery, and STM32F429I-DISCO boards for the SWV/SWO stuff to work.

I have had the STM32F401C-DISCO working with SWV and Keil uv 4.7x. Try the attached HEX file with the ST-Link utilities, and SWV viewer.

You don't specify your errors, but I might surmise that you have created a project from scratch and not set up the include paths and preprocessor defines correctly. Creating a new project from scratch requires a lot of insight into the tools and libraries used, suggest you clone the template project and work with that, and understand it's construction and settings.

________________

Attachments :

STM32F401C_DISCO_SWV.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I03M&d=%2Fa%2F0X0000000bSn%2FqoV88i00ewXyd0w62W5FtQEZdeY8P1aTZMzXgDHskJI&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tgr
Associate II
Posted on November 28, 2013 at 10:05

Thanks for your reply again!

I am working with Keil uv 5 and each time I launch the program, I get a window telling :

Error : Device not found

Device: 'stm32f4_256KB'

Vendor: 'STMicroelectronics'

Please update your device selecion

I worked with the stm32f407 board last year and I had trouble when creating a project but I learnt that I have to use existing STM examples and that's what I'm doing now. All the source files and paths should be right as I open these existing project (MEMS_L3GD20 or TIM_PWM_Output for example) but when I select the stm32f401cc (or cb) for the device, I get multiple errors like this one:

.\..\..\..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h(417): error:  #67: expected a ''}''

    EXTI9_5_IRQn                = 23,     /*!< External Line[9:5] Interrupts                                     */

I get 10 errors like this when compiling the stm32f401_discovery.c.

Thanks for your time again.

Best regards,

Yann

Posted on November 28, 2013 at 13:55

I'm not working with Keil uv 5, I understand you need to download processor support packages, really can't help you with that.

I used the firmware library for the STM32F401C-DISCO, I have this in the \Keil\ARM\Examples\ST directory, within the library I have my projects with the Projects directory

\Keil\ARM\Examples\ST\STM32F401-Discovery_FW_V1.0.0\Projects

http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF259098

http://www.st.com/web/en/catalog/tools/PF259428

http://www.st.com/st-web-ui/static/active/en/st_prod_software_internet/resource/technical/software/firmware/stsw-stm32136.zip

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tgr
Associate II
Posted on November 28, 2013 at 14:49

I may not be clear in my talking. I have already done all of that. I am use to work with ST projects/examples and my packages are up to date.

When running one of the projects from the STM32F401-Discovery_FW_V1.0.0 directory, I got the pop up window I told you before but if I load the project in the board, it is perfectly working. The problem is that when I go to Project->Options for target->Device and I choose the stm32f401vc, it comes to the multiple errors mentionned before and I can't build/compile the files anymore.

Posted on November 28, 2013 at 15:40

And I can't help you with uv5

I can only suggest you review the metadata for the project options, and try to better understand the reasons the lines are flagging with errors.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on November 28, 2013 at 15:50

I wouldn't rule out the possibility that some of the support files in uV5 are messed up.

Can you try another installation, preferably on another PC ?

If that works, you can reinstall, or try to dissect the issue in detail ...

But when the trouble already begins before the hardware is even attached, I wouldn't blame the board.

tgr
Associate II
Posted on November 29, 2013 at 09:23

Thanks for your replies!

I was on Keil uv 4.7 before and I got the same problems... This is the reason I upgraded to uv 5.0 thinking that as the board is a new product I should upgrade Keil.  I work on this project with two others coworkers, one is on uv 4.7 and the other on uv 5.0 and they both got the same problem (so 3 different computers)...

Well thanks for your time, I'll keep investigate on this and keep in contact here.