Trouble using STM32F0 Standard Peripheral Lib
Hello everyone,
A bit embarassed to be here. Been using CrossWorks for several years.
All the time for the same processor (STM32F207).
Now I want to use STM32F030 so I started a new solution/project and tried to copy settings from the old project where relevant. Spent many hours without any luck to get the project to recognize StdPeriphLibrary. There is no board connected yet, just trying to start simple.
I have downloaded STM32F0xx_StdPeriph_Lib_V1.5.0 from ST.
Have the following packages installed:
CMSIS 3 Support Package 3.3
CMSIS 4 CMSIS-CORE Support Package 4.31
CrossWorks Tasking Library Package 3.2
STMicroelectronics STM32 CPU Support Package 3.18
STMicroelectronics STM32 CPU Support Package 2.28
STMicroelectronics STM32F0xx Standard Peripherals Library Updates 1.0
STMicroelectronics STM32F30x DSP and Standard Peripherals Library Updates 1.0
User Include Directories in Properties Window:
$(TargetsDir)/STM32/include
$(PackagesDir)/CMSIS_4/CMSIS/Include
$(ProjectDir)/GasLite_1_0/STM32F0xx_StdPeriph_Lib_V1.5.0/Libraries/STM32F0xx_StdPeriph_Driver/inc
I'm using CrossWorks 3.2.0 but also tried with 3.7.7 with same result.
Would attach the .hzp file but I find nowhere to do that. If any other information needed tell me.
This is my simple main.c
#include "stm32f030xc.h"
uint16_t PrescalerValue;
// systick
uint16_t Tick,NextRunTick10,NextRunTick100,NextRunTick500;
TIM_TimeBaseInitTypeDef SysTickTimeBaseStructure;
TIM_OCInitTypeDef TIM_OCInitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/////////////////////////// SYSTICK ////////////////////////////////////////////
void ConfigSystick(void)
{
/* Set up SysTick counters to do stuff every 1,10,100,500 ms */
Tick=0;
NextRunTick10=4;
NextRunTick100=8;
NextRunTick500=12;
/* TIM5 clock enable */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM5,ENABLE);
/* Time base configuration */
PrescalerValue=(uint16_t)(SystemCoreClock/(10*65535)+1);
SysTickTimeBaseStructure.TIM_Period=323; //225
SysTickTimeBaseStructure.TIM_Prescaler=PrescalerValue;
SysTickTimeBaseStructure.TIM_ClockDivision=0;
SysTickTimeBaseStructure.TIM_CounterMode=TIM_CounterMode_Up;
TIM_TimeBaseInit(TIM5,&SysTickTimeBaseStructure);
/* TIM5 Output Compare Inactive Mode */
TIM_OCInitStructure.TIM_OCMode=TIM_OCMode_Inactive;
TIM_OCInitStructure.TIM_OutputState=TIM_OutputState_Disable;
TIM_OCInitStructure.TIM_Pulse=75;
TIM_OCInitStructure.TIM_OCPolarity=TIM_OCPolarity_High;
TIM_OC1Init(TIM5, &TIM_OCInitStructure);
TIM_OC1PreloadConfig(TIM5,TIM_OCPreload_Disable);
/* Enable the TIM5 Interrupt used for Systick */
NVIC_InitStructure.NVIC_IRQChannel=TIM5_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority=1;
NVIC_InitStructure.NVIC_IRQChannelSubPriority=1; // was (0)
NVIC_InitStructure.NVIC_IRQChannelCmd=ENABLE;
NVIC_Init(&NVIC_InitStructure);
TIM_ITConfig(TIM5,TIM_IT_CC1,ENABLE); // enable Systick interrupt
/* TIM5 enable counter */
TIM_Cmd(TIM5,ENABLE); // Systick start here
}
int main(void)
{
ConfigSystick(); // set up and start Systick
while(1) {}
}
The errors produced suggest that SPL is not found.
Suggestions someone, please....
Richard
Please sign in to leave a comment.
Comments
0 comments