[本文摘自:http://hi./govern/blog/category/it%CE%C4%D5%C2]
1 在flash中跑程序时,能进入中断,但在ram中跑时,进不了中断的原因。
看以下的中断配置函数可以知道,要在ram中调试程序,需要定义VECT_TAB_RAM。
定义方法a:在Project\Options for taget 'xxx' 的对话框的c/c++中定义宏VECT_TAB_RAM
定义方法b:在程序中直接定义
void NVIC_Configuration(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
#ifdef VECT_TAB_RAM
/* Set the Vector Table base location at 0x20000000 */
NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
#else /* VECT_TAB_FLASH */
/* Set the Vector Table base location at 0x08000000 */
NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
#endif
/* Configure and enable ADC interrupt */
= ADC1_2_IRQChannel;
= 0;
= 0;
= ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
2 SysTickHandler 函数不能进入。
原先初始化的语句为
SysTick_Config();
修改为以下时可以进入
SysTick_Config();
SysTick_CounterCmd(SysTick_Counter_Enable);
3 如何解决链接时错误"..\obj\: Error: L6218E: Undefined symbol assert_failed (referred from )."?
(即调试模式库),则需要在无论什么得放添加函数定义
void assert_failed(u8* file, u32 line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* Infinite loop */
while (1)
{
}
stm32开发问题集锦 来自淘豆网m.daumloan.com转载请标明出处.