主题 : 请帮我解答 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 1084
精华: 0
发帖: 40
金钱: 345 两
威望: 41 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2008-07-16
最后登录: 2010-11-17
楼主  发表于: 2010-05-19 09:28

 请帮我解答

这是韦东山里面的一段程序(uart)

@******************************************************************************
@ File:head.S
@ 功能:设置SDRAM,将程序复制到SDRAM,然后跳到SDRAM继续执行
@******************************************************************************      
  
.extern     main
.text
.global _start
_start:
Reset:                  
    ldr sp, =4096           @ 设置栈指针,以下都是C函数,调用前需要设好栈
    bl  disable_watch_dog   @ 关闭WATCHDOG,否则CPU会不断重启
    bl  clock_init          @ 设置MPLL,改变FCLK、HCLK、PCLK
    bl  memsetup            @ 设置存储控制器以使用SDRAM
    bl  copy_steppingstone_to_sdram     @ 复制代码到SDRAM中
    ldr pc, =on_sdram                   @ 跳到SDRAM中继续执行
on_sdram:
    ldr sp, =0x34000000     @ 设置栈指针,
    ldr lr, =halt_loop      @ 设置返回地址
    ldr pc, =main           @ 调用main函数
halt_loop:
    b   halt_loop

请问为什么
    bl  copy_steppingstone_to_sdram     @ 复制代码到SDRAM中
    ldr pc, =on_sdram                   @ 跳到SDRAM中继续执行
    on_sdram:
在这里就调到了SDRAM中执行呢,我感觉这个时候的on_sdram:还是在SRAM里面啊,实在想不通,请知道的人解答一下,谢谢!
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-05-19 12:22
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."