2013-11-27 02:42 AM
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-discovery2013-11-29 01:07 AM
Both uv4.7 and uv5, you don't find that a tad weird?
Honestly it still strikes me that you have the wrong pre-processor defines, which should be USE_STDPERIPH_DRIVER,STM32F401xx You've likely got multiple processors defined, and it's trying to instantiate multiple enum sections from an examination of the include file in questions, at the line number specified.2013-11-29 01:59 AM
It's the preprocessor symbols define I already got.
2013-11-29 07:45 AM
I recently bought this board and encountered the same problem while preparing an empty project. The fact is that when you select the ''STM32F401VC'' as the target a preprocessor, define STM32F40XX is automatically put in the compiler command and cannot be edited. The device header file tells to use ''STM32F401xx'' for this processor but when STM32F40XX is defined, STM32F40_41xxx get chosen. I managed to compile and run program that blink a led using the STM32F40_41xxx define instead of
of
the recommended
. A way of solving the problem is to remove this lines from stm32f4xx.h and use the correct processor definition ( i haven't tested this solution yet but i did a quick search and STM32F40XX is used only there/* Old STM32F40XX definition, maintained for legacy purpose */
#ifdef STM32F40XX
#define STM32F40_41xxx
#endif /* STM32F40XX */
I then followed
application note but i was unable to use logic analyzer and event viewer, i havent tryed the printf yet.
2013-11-30 03:49 AM
After doing some research i found that the files that come from st site also have problem in pll configuration because are written for a 25mhz crystal and the discovery board use a 8mhz. Even after the resolution of this issue i'm still unable to use logic analyzer , event viewer or printf and in the thebug window i see the message ''Trace no synchronization''
2013-11-30 04:23 AM
This is normally addressed by a project local copy of stm32f4xx_conf.h which is pulled in by stm32f4xx.h (USE_STDPERIPH_DRIVER) or stm32f401_discovery.h, and a local copy of system_stm32f4xx.c with the correct PLL settings.
See project construction in STM32F401-Discovery_FW_V1.0.0\Projects\Peripheral_Examples\ADC_DMA If the board is in fact running at 84 MHz, and the trace clock is set to this, the SWV output works. I'm in transit now otherwise I'd ZIP up the project to demonstrate. If the clock is of concern output it via one of the MCO or TIM pins and physically confirm.2013-12-02 12:22 AM
I used the config files you said but still i'm unable to use the debugging features. Tomorrow i'll test the board with a scope to see if clock is right or not.
Anyway if is possible for you to upload your code i could compare with mine, maybe i left something behind Thranks a lot2013-12-02 09:12 AM
Building with 4.70 with library and project arranged thusly
C:\Keil\ARM\Examples\ST\STM32F401-Discovery_FW_V1.0.0\Projects\SWV-DEMOhttps://drive.google.com/file/d/0B7OY5pub_GfITVdTbF9iX0dLSkE/edit?usp=sharing
2013-12-03 01:12 AM
Hi, thanks for all your replies and for your examples.
@sires : When putting in comments the line you mentionned, I can properly run my project! Thanks a lot! @clive1 : I can't understand why you select a STM32F405OE device when it should be a STM32F401VC for the disco and why your Xtal is at 8.0MHz instead of 84MHz.2013-12-03 05:28 AM
The CPU/Xtal selection are not critical, the memory allocation is important to the linker, and the CPU type (Cortex-M4) to the compiler.
The Xtal on the Discovery board is 8 MHz. It is the clock setting in the Debug/Trace pane that is critical to SWV support. The template project uses STM32F4_256KB, as of 4.71a there doesn't appear to be explicit support for F401 parts, they are nevertheless usable.2013-12-05 07:24 AM
T
he curious thing
is that now trace featured passed from not working to working sometimes and i can't understand why