2012-07-20 05:49 AM
Hi everyone I'm also trying to do an encoder control unit with stm32f4 discovery using of the standard periphberal libriaries and I have two problems.
1-) When I want to build codes, there is an error occuring which is ; Error : L6218E : Undefined symbol assert-param (referred from misc.o) after that problem I researched about this error with it's Error Number and I found something. The answer of my problem was USE_STDPERIPH_DRIVER definition (at 'Configure Flash Tools' => 'C/C++' => 'Define' ). Then I applied it to my project but another error occured. I added second error's pic and project files. Thanks.2012-07-20 06:31 AM
Which is indicative that you either don't have the Project's include paths correctly set up, or you don't have the configuration file stm32f4xx_conf.h in the root directory of your project. Check some of the examples in the firmware library.
2012-07-20 07:58 AM
Thanks for the answer I'm new arm based microcontrollers. Am I create everytime the system32f4xx_config.h (another configuration header file) for every another projects or same config file for another projects, can I use ?
2012-07-20 08:58 AM
Your strategy in Keil is different to mine, I have the library installed in the \Keil\ARM\Examples\ST directory, and the projects then live under the Project branch. ie C:\Keil\ARM\Examples\ST\STM32F4-Discovery_FW_V1.1.0\Project\PWM4
The object files are in the Project\PWM4\MDK\PWM4 directory and don't clutter up the source. And there is only a single instantiation of the library for all the projects. The stm32f4xx_conf.h pulls in all the other include files from the library, and itself is pulled in from stm32f4xx.h. Now you could modify all this stuff, but the point of the stm32f4xx_conf.h is to localize project specific settings in a consistent manner. Modifying the names and structures of things just makes it more difficult for others to work with your code, but there is nothing to prevent you from doing it.2012-07-20 11:26 PM
Thank for your support clive1. I need to work on this situation of using stdperiph libs. I think so, I'm choosing the hard way to go to the end. I'm trying to do as you do. Thank you again.
2012-07-21 01:21 AM
Where can I find the stm32f4xx_Clock_Configuration_V1.0.0.xls file? I did not find it at STM's webpage.
2012-07-21 04:20 AM
http://www.st.com/internet/mcu/product/252142.jsp
AN3988Clock configuration tool for STM32F40x/41x microcontrollers (V1.0.1)
http://www.st.com/internet/com/SOFTWARE_RESOURCES/TOOL/CONFIGURATION_UTILITY/stm32f4_clockconfig.zip
2012-07-23 07:08 AM
Thank you so much Clive I'm now running my codes with the peripheral libraries but I'm not building a new projects as example projects I think I have a linking problem between my codes and the other sources and headers. I'm looking to forum how to include libraries to my project because they are not linking with just writing #include..... I must add them in project menu but I did not find it yet..
2012-07-23 08:08 AM
Project -> Options for Target -> C/C++ -> Include Paths
For an STM32F2 one I had close at hand the list looked like this : ..\; ..\..\..\Libraries\CMSIS\CM3\CoreSupport; ..\..\..\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F2xx; ..\..\..\Libraries\STM32F2xx_StdPeriph_Driver\inc; ..\..\..\Utilities\STM32_EVAL; ..\..\..\Utilities\STM32_EVAL\Common; ..\..\..\Utilities\STM32_EVAL\STM322xG_EVAL Adapt to reflect the requirements of your project, and F42012-07-25 03:24 AM
I did it with stm32f4xx_stdperiph_templates and it's working well. Thanks for your answers clive1. Now I have another problem I set up interrupts TIM2_IRQHandler and EXTI0_IRQHandler and EXTI0 has more priority than TIM2 but programm is not brunching interrupt routines. I plug in encoder's A and B pins to PB3 and PA5 (TIM2 ch1 and ch2) timer is counting but interrupt hasn't occured under or overflows. I clocked SYSCFG_EXTICR1
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
SYSCFG_EXTILineConfig(EXTI_PortSourceGPIOD, EXTI_PinSource0);
Here is EXTI0's settings:
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_0);
NVIC_InitStructure.NVIC_IRQChannel = EXTI0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
And Timer2: NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0x00;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0x01;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
Interrup handlers prototypes and definitions are in the stm32f4xx_it.h header and the functions ar in the stm32f4xx_it.c source why interrups are not occuring??