#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
3 如何解决链接时错误"..\obj\LowCostDA.axf: Error: L6218E: Undefined symbol assert_failed (referred from stm32f10x_flash.o)."?
如果所加入的库是STM32F10xD.LIB(即调试模式库),则需要在无论什么得放添加函数定义
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)
{
}
}
如果所加入的库是STM32F10xR.LIB(即发布模式库),则不会报错。
4 打开中断的时机不正确,导致无法进行任务切换。
由于我过早地打开了 SysTick 中断,而我在SysTickHandler 中有如下语句:
{
...
OS_ENTER_CRITICAL(); /* Tell uC/OS-II that we are starting an ISR */
OSIntNesting++;
OS_EXIT_CRITICAL();