keil 在自定義程序起始地址開始調(diào)試

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文件)
具體代碼如下:
/*----------------------------------------------------------------------------

  • Name: Debug_RAM.ini
  • Purpose: RAM Debug Initialization File
  • Note(s):
    *----------------------------------------------------------------------------
  • This file is part of the uVision/ARM development tools.
  • This software may only be used under the terms of a valid, current,
  • end user licence from KEIL for a compatible version of KEIL software
  • development tools. Nothing else gives you the right to use this software.
  • This software is supplied "AS IS" without warranties of any kind.
  • Copyright (c) 2008-2011 Keil - An ARM Company. All rights reserved.
    ----------------------------------------------------------------------------/

/*----------------------------------------------------------------------------
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 選項(xiàng)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容