2012-01-13 09:08 PM
When I try to build an example from ST distribution: STM32F4-Discovery_FW_V1.1.0\Project\Peripheral_Examples\IO_Toggle
I get an error complaining of missing stm32f4_discovery.h.
This header file is distributed in a folder with other .c .h and libPDMFilter_Keil.lib files. If I copy the missing .h and the corresponding .c file into the project folder, I get new errors…and I keep fixing them by copying of the missing files but it seems that there must be a better way.
What are the general steps for building of the examples? I am using CrossWorks IDE.
Thank you.
2012-01-13 10:43 PM
路过,顺便帮顶。。。
sorry。。。2012-01-18 10:22 AM
I am calling functions from stm32f4_discovery.c. In order to build with this source file, I had to modify it to add the following includes:
#include ''stm32f4xx_gpio.h''#include ''stm32f4xx_rcc.h''#include ''stm32f4xx_exti.h''#include ''stm32f4xx_syscfg.h''#include ''misc.h''Now it is a ''domino'' effect. Now another file is failing to compile:/CrossWorks Project 2/stm32f4xx_rcc.c:1088: undefined reference to `assert_param'This is strange. It seems that the provided source code is defected? It should include the missing includes.I have to edit stm32f4xx_rcc.c to include:#define assert_param(expr) ((void)0)
2012-01-18 11:55 AM
This normally all comes in via stm32f4xx_conf.h
2012-01-18 12:06 PM
Thank you! Yes, I did notice this header file. I avoided it because the ST firmware distribution has 22 of these files. That seemed strange to me.
2012-01-18 12:26 PM
Thank you! Yes, I did notice this header file. I avoided it because the ST firmware distribution has 22 of these files. That seemed strange to me.
Yes, because it permits per-project customization. The goal with a project would be to have the IDE/compiler know where the library, and system, include files are located (via search paths). From command line tools this is typically achieved with -I or -L options. Earlier releases of the library (STM32F1xx V2.x) had you build the library as a separate project and you included the .LIB/.A file into your own project. This has changed somewhat with V3 and CMSIS where the library source, as needed, is typically dumped into your project as a sub-section or sub-project. Now if the Rowley guys were clever they'd be able to import a project from the Keil or IAR files.
2012-01-19 12:43 PM
All are valid points and thanks for all valuable information you provide!
However,stm32f4xx_conf.h provided by ST is already customized. I am judging by the folder name/location where these files are stored.
IMHO, there should be one occurrence of the file in the Utilities\STM32F4-Discovery folder where for example stm32f4_discovery.h is stored.2012-01-25 06:31 AM
Thanks for the above information, I managed to get the Toggle example compiling. Two points if you will be so kind:-
1) I only see THUMB Release and THUMB debug as project types offered on Cross Studio, is there a way to get the other? 2) How can I make the program I downloaded just run on the board when I apply the power? At the moment all I can do is download and run from Cross Studio. Thank you.2012-01-25 07:09 AM
I am new to this too….
You can take the examples prepackaged for other IDEs. Simply take the main.c and other .c & .h files and compile on your IDE. The Peripheral_Examples folder from the FW distribution has many examples you can use.What happens when you apply the power and push the reset button? I expect that the program you have downloaded before should start running.2012-01-25 07:56 AM
What happens when you apply the power and push the reset button? I expect that the program you have downloaded before should start running.
Yes that is what I thought should happen also. It stops when you press the on board reset switch while connected to Cross Studio. If you just plug it in without Cross Studio running nothing happens, not even when you press the reset button. That is after loading a release version of the code. Is that what happens for you?