3680|9

69

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

nand flash启动问题 [复制链接]

我用ads1.2编译arm9 2410的boot_loader(NAND FLASH 启动)时,将其ro_base设置为0x33f00000,这就意味着代码段的起始地址从0x33f00000开始。若将生成的bin文件download到nand中,arm启动时,应该执行0x0地址对应的代码,这时sdram寄存器都还没有设置,若执行跳转指令,程序会跑飞,对吗?但是程序确实能正常执行指令  b ResetHandler。  

最新回复

跳转指令B是相对跳转的,和你设置的起始地址没关系的。如果其中用了ldr指令,就要注意了  详情 回复 发表于 2010-1-22 16:02
点赞 关注

回复
举报

68

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
nandflash里的程序先会被搬运到ram中,然后在ram中运行。如果ram的地址映射是0x00000000,程序时可以正常运行的。
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
你有个概念需要理解清楚:
这里所说的地址其实有两种地址:一种是加载时地址,是指映像下载到Flash中的地址;另一种是运行时地址,是指映像在RAM中执行时的地址。RO_BASE指的是后者的地址。当ARM芯片上电后首先执行的是0x00地址处的指令,而0x00地址连接的其实是Flash。Flash中的前一段代码作了一个“乾坤大挪移”的动作,把Flash中的代码拷贝到了RO_BASE开始的地址中。换言之0x33f00000中的指令是b ResetHandler
 
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

4
 
ro_base设置为0x33f00000,这是你在RAM中的执行地址。如果你把这个生成的bin文件,放在nand里面,重新启动,应该不能执行才是。取指令错误。
是不是你烧录的bin文件地址是是0开始的??或者说你的startup.s这段代码还是放在0开始的?
 
 
 

回复

73

帖子

0

TA的资源

一粒金砂(初级)

5
 
有一个设置你要弄清楚:
当OM[1:0]被设置成00时,那么就从NAND FLASH启动,NAND是不能运行程序的,因为他的存储不是线性的,所以硬件设计成自动将NAND FLASH的前4K的代码复制到0x00开始的4K的boot sram也叫steppingstone,该段代码执行了startup.s中的代码.所以你的程序没有跑飞
 
 
 

回复

81

帖子

0

TA的资源

一粒金砂(初级)

6
 
不懂。学习下
 
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

7
 
Reset operation
As discussed previously, CE# must be low for all NAND activities. The simplest NAND command is the Reset (FFh), which doesn't require any address or second cycle. Simply assert CLE and issue a write pulse with FFh on the data bus, and a Reset operation is performed. Reset is one of two commands that can be issued while the NAND device is busy. If it's busy processing a previous command, issuing a Reset aborts the previous operation. Note that if the previous operation was an Erase or Program command, issuing a Reset aborts the command prematurely, and the desired operation doesn't complete. Because Erase and Program can be time-consuming operations, they can be aborted with a Reset and re-issued later.
Read ID operation
The Read ID (90h) command requires one dummy address cycle (00h), but doesn't need a second command cycle (Table 1, again). After issuing the command and dummy address, the ID data can be read out by keeping CLE and ALE low and toggling the RE# signal for each byte of ID.
Read status operation
Read Status (70h) is the second command that can be issued while the NAND device is busy. This command doesn't require an address or second command cycle. The NAND device's status can be interrogated by issuing the RE# clock signal. If the Read Status command is used to monitor the device's ready state, the command should only be issued one time and the status re-read by re-issuing the RE# clock. Alternatively, the RE# signal can be kept low waiting for the appropriate status bit. Read Status also includes the status of the write protect pin as well as the pass/fail status of the previous Program or Erase operations. It's mandatory that successful status be attained on Program or Erase operations to ensure proper data integrity.
The Block Erase (60h) operation erases an entire block of 64 pages or 128 bytes total. To issue this operation, use the WE# signal to clock in the Erase command (60h) with CLE asserted. Next, clock in three address cycles, keeping ALE asserted for each address byte. The three address cycles are the most significant address cycles of Table 2, which includes the block and page addresses. The page address portion (the low order 6 bits of the third address cycle) is ignored, and only the block address portion of the three most significant bytes is used. Once the address is input completely, issue the second command (command cycle 2) of D0h, which also gets clocked in with WE# while CLE is being asserted. This confirms the erase operation, and the device goes busy for roughly 2 ms. When this operation completes, the device is ready for another command. Notice the Read Status command can be issued at any time, even when the device is busy during the erase. The processor or controller could interrogate the device using the read status command.
Program operations
Program operations can only program bits to 0, and assume that you started with a previously-erased block. If you don't want to program a bit, keep it in its erased state by setting that particular bit (or group of bits) to 1. When the Program Page (80h) command is received, the input register is reset to all 1s (internally). This lets the user input only data bytes that he wants to program with 0 bits. The Program operation starts with the 80h command, with CLE asserted (Fig. 4). Next, drop CLE and assert ALE to input the full five address cycles.
Click here for Fig. 4
4. When the Program Page (80h) command is received, the input register is internally reset to all 1s, letting the user input only data bytes that he wants to program with 0 bits.
After the command and address are input, data is input to the register. Once all the data has been input, we issue the confirm command (10h) and start the programming operation. A Program operation typically requires 300 μs, although it may require up to 700 μs. It's mandatory that you read the status and check for successful operation. If the operation isn't successful, log the block and don't use it in the future. Move all data from the block to a good block.
Random data input operation
The next command is the random data input command (85h). This command only requires two bytes of address followed by the data (Fig. 5). It's useful when you want to jump around within a page, to access ECC data, for example. Random data input can be used to jump to the end of the page and write the ECC data. You can input as many address and data combinations as needed. It's only when the program confirm command (10h) is issued that the data is actually programmed to the selected page.
Click here for Fig. 5
5. Show is the Program command with random data input. The highlighted section shows that this command only requires two bytes of address followed by the data.
Due to the NAND page's large size, partial page programming is needed to store smaller-sized data. Each NAND page could accommodate four PC-sized 512-byte sectors. The spare area of each page provides additional storage for ECC and other information. While it's advantageous to write all four sectors at once, it's not always possible. An example of this is when you are appending a file. The file might start out as 512 bytes, with additional data coming later, making it 1024 bytes. In this case, writing the second 512 bytes would require a second page program operation to the NAND device. The maximum specification for partial page programming is eight; this would accommodate four data sectors and ECC, each programmed separately.
There are two common methods for storing data and spare information in the same page (Fig. 6). The first contains a data area of 512 bytes with the spare area directly adjacent to it. The spare area in this case is 16 bytes. Therefore, a 2112-byte page could contain four 528-byte elements. The second implementation involves storing the data and spare information separately. This means the 512-byte data is stored first, and the respective spare information for that data is stored at the end of the array starting at the beginning of the spare area. The second 512 bytes is stored next to the first 512, and the associated spare area for the second 512 is stored in the next 16-byte spare area. This continues until all four 512-byte sectors are stored with their respective 16-byte spare areas.
 
 
 

回复

70

帖子

0

TA的资源

一粒金砂(初级)

8
 
用的是SRAM,考虑你的函数连接文件的写法限制在4K之内,跳转则在4K内进行,那么没问题。
否则必须初始化ram,并从新copy代码到ram在从相应的语句地址开始执行你的跳转,但这个时刻的连接脚本和刚刚说过在sram中是不一样的。
 
 
 

回复

76

帖子

0

TA的资源

一粒金砂(初级)

9
 
我也碰到过类似的问题!!!
 
 
 

回复

71

帖子

0

TA的资源

一粒金砂(初级)

10
 
跳转指令B是相对跳转的,和你设置的起始地址没关系的。如果其中用了ldr指令,就要注意了
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/8 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表