美文网首页
keil 在自定义程序起始地址开始调试

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

作者: eversay | 来源:发表于2020-04-15 19:53 被阅读0次

    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 选项

    相关文章

      网友评论

          本文标题:keil 在自定义程序起始地址开始调试

          本文链接:https://www.haomeiwen.com/subject/ovuhvhtx.html