#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(即調試模式庫),則需要在無論什么得放添加函數(shù)定義
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(即發(fā)布模式庫),則不會報錯。
4 打開中斷的時機不正確,導致無法進行任務切換。
由于我過早地打開了 SysTick 中斷,而我在SysTickHandler 中有如下語句:
{
...
OS_ENTER_CRITICAL(); /* Tell uC/OS-II that we are starting an ISR */
OSIntNesting++;
OS_EXIT_CRITICAL();