S3C2440程序仿真和下载

33 篇文章 1 订阅

S3C2440不同于一般的M0~M7的内核的ARM,片内的FLASH太少,一般不在片上运行程序,其仿真和固化(程序FLASH下载)

都采用片外的芯片,这点与DSP芯片C5509很像,先来说仿真,运行在片外内存上,需要下面这个文件:

/******************************************************************************/
/* 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 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\iRAM_my_show.axf INCREMENTAL         // Download program
PC = 0x30000000;                       // Setup for Running
//g, main                                 // Goto Main

然后在工程设置里设置地址如下:

并且在Debug中勾选该文件,将该文件放在工程目录根目录下

这样就可以DEBUG了,但是掉电程序就丢掉了。

要想下载进去的话,需要设置如下

对应的硬件是天嵌的2440开发板,还需要选择NOR FLASH启动。这样就可以固化程序了,也可以用J-FLASH下载。

 

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值