target配置.rar (65 K) 下载次数:7
target配置.rar (65 K) 下载次数:7 环境介绍:
使用的开发板是友善之臂的mini2440
仿真器是:H-JTAG
Mini2440 Memory 配置:
NAND flash:K9F1208(64M x 8 Bit)
NOR flash:SST39VF1601(1M x16 Bit) 地址范围:[0x00000000~0x001FFFFF]
SDRAM: HY57V561620 (2pcsX4Banks x 4M x 16Bit) 地址范围:[0x30000000~0x33FFFFFF]
该程序在runinRAM中是OK的,但是runinflash(nor flash)不成功,调试了N天都不行,求助各位大牛了哈~~崩溃了哈~~~
1.Option for Target 配置见附件所示
2.runinflash.sct文件内容如下所示
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
; Run in RAM
LR_ROM1 0x00000000 { ; load region
ER_ROM1 0x00000000 0x0040000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_RAM1 0x30000000 0x0040000 { ; RW data
.ANY (+RW +ZI)
}
RW_IRAM1 0x40000000 0x00001000 {
.ANY (+RW +ZI)
}
}
3.Ext_Flash.ini的文件内容如下所示
/******************************************************************************/
/* Ext_RAM.INI: External RAM (SDRAM) Initialization File */
/******************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>> //
/******************************************************************************/
/* This file is part of the uVision/ARM development tools. */
/* Copyright (c) 2005-2008 Keil Software. All rights reserved. */
/* 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. */
/******************************************************************************/
FUNC void SetupForStart (void) {
// <o> Program Entry Point
PC = 0x00000000;
//PC = 0x0;
}
FUNC void Init (void) {
_WDWORD(0x4A000008, 0xFFFFFFFF); // Disable All Interrupts
_WDWORD(0x53000000, 0x00000000); // Disable Watchdog Timer
// Clock Setup
// FCLK = 300 MHz, HCLK = 100 MHz, PCLK = 50 MHz
_WDWORD(0x4C000000, 0x0FFF0FFF); // LOCKTIME
_WDWORD(0x4C000014, 0x0000000F); // CLKDIVN
_WDWORD(0x4C000004, 0x00043011); // MPLLCON
_WDWORD(0x4C000008, 0x00038021); // UPLLCON
_WDWORD(0x4C00000C, 0x001FFFF0); // CLKCON
// Memory Controller Setup for SDRAM
_WDWORD(0x48000000, 0x22000000); // BWSCON
_WDWORD(0x4800001C, 0x00018005); // BANKCON6
_WDWORD(0x48000020, 0x00018005); // BANKCON7
_WDWORD(0x48000024, 0x008404F3); // REFRESH
_WDWORD(0x48000028, 0x00000032); // BANKSIZE
_WDWORD(0x4800002C, 0x00000020); // MRSRB6
_WDWORD(0x48000030, 0x00000020); // MRSRB7
_WDWORD(0x56000000, 0x000003FF); // GPACON: Enable Address lines for SDRAM
}
// Reset chip with watchdog, because nRST line is routed on hardware in a way
// that it can not be pulled low with ULINK
_WDWORD(0x40000000, 0xEAFFFFFE); // Load RAM addr 0 with branch to itself
CPSR = 0x000000D3; // Disable interrupts
PC = 0x40000000; // Position PC to start of RAM
_WDWORD(0x53000000, 0x00000021); // Enable Watchdog
g, 0 // Wait for Watchdog to reset chip
Init(); // Initialize memory
LOAD Obj\Blinky.axf INCREMENTAL // Download program
//SetupForStart(); // Setup for Running
PC = 0x00000000;
//g, main // Goto Main