该函数实际是CMSIS中实现,位于core_cm0/3/4.h中,主要是配置Cortex-M内建的SysTick Timer。
SysTick Timer的具体用法请参见Cortex M0或M3/4权威指南中的Operating System Support Features中的The SysTick Timer章节。
/**
\brief System Tick Configuration
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
Counter is in free running mode to generate periodic interrupts.
\param [in] ticks Number of ticks between two interrupts.
\return 0 Function succeeded.
\return 1 Function failed.
\note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
must contain a vendor-specific implementation of this function.
SysTick_Config是一个内联函数,定义在core_cm3.h(按内核)文件中,在core_cm3.h文件中代码如下:
static __INLINE uint32_t SysTick_Config(uint32_t ticks)
{
if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
SysTick->VAL = 0; /* Load the SysTick Counter Value */
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
return (0); /* Function successful */
}
以下说明内容来自:RM0033_STM32F205xx, STM32F207xx, STM32F215xx和STM32F217xx单片机参考手册
8.1.2 SysTick calibration value register
The SysTick calibration value is fixed to 15000, which gives a reference time base of 1 ms
with the SysTick clock set to 15 MHz (max HCLK/8).
低版本的Keil需要编译一次才会生成函数/变量间关联信息(Broswe Information)。
或者直接在工程里用全文搜索,也能找出来。
该函数实际是CMSIS中实现,位于core_cm0/3/4.h中,主要是配置Cortex-M内建的SysTick Timer。
SysTick Timer的具体用法请参见Cortex M0或M3/4权威指南中的Operating System Support Features中的The SysTick Timer章节。
我是用keil的,编译过整个工程后,还是找不到。
楼主browse information勾上了么,如果勾上了编译通过以后还跳转不到定义的话,就和二楼说的一样用全工程搜索一般都能找到
评分
查看全部评分
http://www.51hei.com/bbs/dpj-31803-1.html
(出处: 单片机论坛)
希望对你有帮助……
我也遇到了这个问题,SysTick_Config是core_cm0.h文件中的,只要调用这个文件的函数都找不到定义,但是可以编译通过。编译后下载到芯片貌似这函数没起作用。我弄了好几天了,keil也重装了,重新更新。什么方法都用了就是不行。你是怎么解决的可以跟我说说吗!
static __INLINE uint32_t SysTick_Config(uint32_t ticks)
{
if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
SysTick->VAL = 0; /* Load the SysTick Counter Value */
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
return (0); /* Function successful */
}
以下说明内容来自:RM0033_STM32F205xx, STM32F207xx, STM32F215xx和STM32F217xx单片机参考手册
8.1.2 SysTick calibration value register
The SysTick calibration value is fixed to 15000, which gives a reference time base of 1 ms
with the SysTick clock set to 15 MHz (max HCLK/8).
简单的说,调用SysTick_Config(SystemCoreClock / count)函数,可以开启一个频率为count,也就是周期为1/count的周期性中断,中断函数为SysTick_Handler(void)。SysTick_Handler(void)中断优先级高于所有外设中断优先级。