ulink下在ram中調(diào)試stm32的方法
----------------------------------------------------------------
FUNCvoidSetup(void){
SP=_RDWORD(0x20000000);//堆棧指針
PC=_RDWORD(0x20000004);//PC
_WDWORD(0xE000ED08,0x20000000);//中斷向量偏移地址
}
LOAD./basic.axfINCREMENTAL//Download,.axf根據(jù)自己的文件名和目錄修改
Setup();//調(diào)用Setup();
g,main//跳轉(zhuǎn)到main
----------------------------------------------------------------------copy以上。
2.把程序起始地址改成RAM的起始地址。
#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
評(píng)論