群里用人用 英蓓特stm32 v100的开发板么?
我是新手,有两个问题请教下~
Build target 'STM32F10x Release'
compiling main.c...
main.c(123): warning: #223-D: function "RCC_WaitForHSEStartUp" declared implicitly
main.c(123): warning: #188-D: enumerated type mixed with another type
main.c(137): warning: #223-D: function "FLASH_SetLatency" declared implicitly
main.c(137): error: #20: identifier "FLASH_Latency_2" is undefined
main.c(139): warning: #223-D: function "FLASH_PrefetchBufferCmd" declared implicitly
main.c(139): error: #20: identifier "FLASH_PrefetchBuffer_Enable" is undefined
Target not created
高手们,问下为什么会提示未定义啊?不是函数库里有程序么?
我刚起步学stm32 在看《基于MDK的STM32处理器开发应用》它上面的一个例程
FLASH_SetLatency(FLASH_Latency_2);
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
这两个函数未发现
STM32固件库,没有
FLASH_SetLatency(FLASH_Latency_2);
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
没有这两个函数?
源程序
void RCC_Configuration(void)
{
/* RCC system reset(for debug purpose) */
RCC_DeInit();
/* Enable HSE */
RCC_HSEConfig(RCC_HSE_ON);
/* Wait till HSE is ready */
HSEStartUpStatus = RCC_WaitForHSEStartUp();
if(HSEStartUpStatus == SUCCESS)
{
/* HCLK = SYSCLK */
RCC_HCLKConfig(RCC_SYSCLK_Div1);
/* PCLK2 = HCLK */
RCC_PCLK2Config(RCC_HCLK_Div1);
/* PCLK1 = HCLK/2 */
RCC_PCLK1Config(RCC_HCLK_Div2);
/* Flash 2 wait state */
FLASH_SetLatency(FLASH_Latency_2);
/* Enable Prefetch Buffer */
FLASH_PrefetchBufferCmd(FLASH_PrefetchBuffer_Enable);
/* PLLCLK = 8MHz * 9 = 72 MHz */
RCC_PLLConfig(RCC_PLLSource_HSE_Div1, RCC_PLLMul_9);
/* Enable PLL */
RCC_PLLCmd(ENABLE);
/* Wait till PLL is ready */
while(RCC_GetFlagStatus(RCC_FLAG_PLLRDY) == RESET)
{
}
/* Select PLL as system clock source */
RCC_SYSCLKConfig(RCC_SYSCLKSource_PLLCLK);
/* Wait till PLL is used as system clock source */
while(RCC_GetSYSCLKSource() != 0x08)
{
}
}
/* Enable GPIOB, GPIOC and AFIO clocks */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO, ENABLE);
}
用的英蓓特stm32 v100的板子,MDK v3.10
此帖出自
小平头技术问答
一周热门 更多>