STM32的SRAM調試


      據說Flash的擦寫次數是有限的,所以在調試的時候擦來擦去不好,看到boot0、boot1可以配置從SRam啟動,就查了相關資料,試了一下,ok了。記錄一下,免得以后又忘了。跟flash調試部分相同的就不再描述了,重點在於SRam調試的設置部分,大部分以圖片形式。

 

Dbg_RAM.ini(D:\Keil\ARM\Boards\Keil\MCBSTM32\Blinky下面有一個,其實MCBSTM32目錄下的都一樣的,只要有)的內容:

/*----------------------------------------------------------------------------
 * Name:    Dbg_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(0x20000000);          // Setup Stack Pointer
  PC = _RDWORD(0x20000004);          // Setup Program Counter
  _WDWORD(0xE000ED08, 0x20000000);   // Setup Vector Table Offset Register
}

LOAD %L INCREMENTAL                  // load the application

Setup();                             // Setup for Running

g, main

最后,BOOT0和BOOT1引腳都接到3.3v,從SRAM啟動

JTAG調試,一切正常。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM