1. KEIL 修改PC指针
KEIL debug窗口添加 Initializeation File
Initializeation File 内容如下, 其中 0x08000000为程序起始地址
FUNC void Setup (void) {
SP = _RDWORD(0x08000000); // Setup Stack Pointer
PC = _RDWORD(0x08000004); // Setup Program Counter
XPSR = 0x01000000; // Set Thumb bit
_WDWORD(0xE000ED08, 0x00000000);
}
FUNC void OnResetExec (void) { // executes upon software RESET
Setup(); // Setup for Running
}
LOAD %L INCREMENTAL // Download to RAM
Setup();
g, main
2. GCC
如果使用GCC + Jlink GDB service , 添加如下指令
monitor reg r13 = (0x08000000)
monitor reg pc = (0x08000004)
break main
如果是单纯的jlink command 修改PC 指针为:
setpc xxxxx