keil 在自定义程序起始地址开始调试

2020-04-15  本文已影响0人  eversay

keil option 中DEBUG页面下
initialization file 加入脚本文件Debug_Ram.init (可参考KEIL中的C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.2.0\Boards\Keil\MCBSTM32E\Blinky\Debug_Ram.init文件)
具体代码如下:
/*----------------------------------------------------------------------------

/*----------------------------------------------------------------------------
Setup() configure PC & SP for RAM Debug
----------------------------------------------------------------------------/
FUNC void Setup (void) {
SP = _RDWORD(0x08004000); // Setup Stack Pointer
PC = _RDWORD(0x08004004); // Setup Program Counter
_WDWORD(0xE000ED08, 0x08004000); // Setup Vector Table Offset Register
}

FUNC void OnResetExec (void) { // executes upon software RESET
Setup(); // Setup for Running
}

load prj\obj\app.axf INCREMENTAL
Setup(); // Setup for Running

g, main

取消勾选load application at startup 选项

上一篇 下一篇

猜你喜欢

热点阅读