主题 : 请教怎样下载程序到NAND Flash并运行 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 5486
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
综合积分: 6 分
注册时间: 2009-04-24
最后登录: 2010-02-02
楼主  发表于: 2010-01-28 03:04

 请教怎样下载程序到NAND Flash并运行

mini2440 64M版的。只有Nor Flash有bootloader,NAND Flash的被我格掉了。把光盘上的test程序,通过[d]的方式可以跑。但是几个《嵌入式linux应用开发完全手册》上的例子无法运行。例程需要下载到NAND Flash 0x0地址。我从NOR Flash启动,在bootloader中用[d]方式,发现dnw无法把程序下载到0x0的地址,即使options里面显示的是0x00000000。用[a]方式也一样。
##### FriendlyARM BIOS for 2440 #####                                    
[x] bon part 0 320k 2368k                        
[v] Download vivi                
[k] Download linux kernel                        
[y] Download root_yaffs image                            
[c] Download root_cramfs image                              
[a] Absolute User Application                            
[n] Download Nboot                  
[e] Download Eboot                  
[i] Download WinCE NK.nb0                        
[w] Download WinCE NK.bin                        
[d] Download & Run                  
[z] Download zImage into RAM                            
[g] Boot linux from RAM                      
[f] Format the nand flash                        
[p] Partition for Linux                      
[b] Boot the system                  
[s] Set the boot parameters                          
[t] Print the TOC struct of wince                                
[u] Backup NAND Flash to HOST through USB(upload)                                                
[r] Restore NAND Flash from HOST through USB                                            
[q] Goto shell of vivi                      
Enter your selection: a                      
USB host is connected. W                      

Now, Downloading [ADDRESS:30000000h,TOTAL:82995]                                                
RECEIVED FILE SIZE:   82995 (81KB/S, 1S)                                        
Downloaded file at 0x30000000, size = 82985 bytes                                                
Flash params: oobsize = 16, oobblock = 512, erasesize = 16384, partition size =                                                                              
98304    
Erasing and programming NAND with checking bad blocks                                                    
Block erasing(addr/count) --- Block bad(addr/count) --- Block processed/All(%)                                                                              
--------------------------------------------------------------------------------                                                                                

     0x00014000/00006            0x00000000/00000           00006/00006=10                                                                        
Erasing and programming OK:                          
Blocks scanned: 6, Blocks erased: 6, Blocks are bad: 0                                                      

##### FriendlyARM BIOS for 2440 #####                                    
[x] bon part 0 320k 2368k                        
[v] Download vivi                
[k] Download linux kernel                        
[y] Download root_yaffs image                            
[c] Download root_cramfs image                              
[a] Absolute User Application                            
[n] Download Nboot                  
[e] Download Eboot                  
[i] Download WinCE NK.nb0                        
[w] Download WinCE NK.bin                        
[d] Download & Run                  
[z] Download zImage into RAM                            
[g] Boot linux from RAM                      
[f] Format the nand flash                        
[p] Partition for Linux                      
[b] Boot the system                  
[s] Set the boot parameters                          
[t] Print the TOC struct of wince                                
[u] Backup NAND Flash to HOST through USB(upload)                                                
[r] Restore NAND Flash from HOST through USB                                            
[q] Goto shell of vivi                      
Enter your selection: a                      
USB host is connected. Waiting a download.                                          

Now, Downloading [ADDRESS:30000000h,TOTAL:15522]                                                
RECEIVED FILE SIZE:   15522 (15KB/S, 1S)                                        
Downloaded file at 0x30000000, size = 15512 bytes                                                
Flash params: oobsize = 16, oobblock = 512, erasesize = 16384, partition size =                                                                              
16384    
Erasing and programming NAND with checking ba                                          
Block erasing(addr/count) --- Block bad(addr/count) --- Block processed/All(%)                                                                              
--------------------------------------------------------------------------------                                                                                

     0x00000000/00001            0x00000000/00000           00001/00001=100%                                                                            
Erasing and programming OK:                          
Blocks scanned: 1, Blocks erased: 1, Blocks are bad: 0                        
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-01-28 13:00
即使options里面显示的是0x00000000。用[a]方式也一样。

我很想知道你是怎么判断程序没有写入NAND Flash的0x0地址的?
"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."
这个阶段正是我事业的上升期,我怎么能走得开呢?
级别: 精灵王
UID: 3197
精华: 3
发帖: 770
金钱: 6995 两
威望: 5398 点
综合积分: 1600 分
注册时间: 2008-12-30
最后登录: 2010-12-31
2楼  发表于: 2010-01-28 13:28
那本书的例子或许只能适用于64M nand flash
级别: 新手上路
UID: 5486
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
综合积分: 6 分
注册时间: 2009-04-24
最后登录: 2010-02-02
3楼  发表于: 2010-01-28 22:44
引用第1楼kasim于2010-01-28 13:00发表的  :

我很想知道你是怎么判断程序没有写入NAND Flash的0x0地址的?

Now, Downloading [ADDRESS:30000000h,TOTAL:15522]                                                
RECEIVED FILE SIZE:   15522 (15KB/S, 1S)                                        
Downloaded file at 0x30000000, size = 15512 bytes                                                
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
4楼  发表于: 2010-01-29 11:00

 回 3楼(schottky) 的帖子

哦,那你觉得后面的
Flash params: oobsize = 16, oobblock = 512, erasesize = 16384, partition size =                                                                              
16384    
Erasing and programming NAND with checking ba                                          
Block erasing(addr/count) --- Block bad(addr/count) --- Block processed/All(%)                                                                              
--------------------------------------------------------------------------------                                                                                

     0x00000000/00001            0x00000000/00000           00001/00001=100%                                                                            
Erasing and programming OK:                          
Blocks scanned: 1, Blocks erased: 1, Blocks are bad: 0            

是在做什么?
"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."
级别: 新手上路
UID: 5486
精华: 0
发帖: 3
金钱: 15 两
威望: 3 点
综合积分: 6 分
注册时间: 2009-04-24
最后登录: 2010-02-02
5楼  发表于: 2010-01-29 13:24
后面写的是擦写NAND Flash完成。

我下载的程序是一个串口测试程序,接收输入的一个字符,+1之后返回。

我的问题是这样来的,这个程序会使用串口。而JTAG连接时,会锁住串口,用不了。我只能在启动uboot之后用dnw下载到开发板上运行。上面的是我测试的结果。想询问一下这是什么情况。

今天发现书上给的程序和友善的测试程序有很多不同点,可能需要大改之后才能运行。
级别: 新手上路
UID: 28358
精华: 0
发帖: 20
金钱: 100 两
威望: 20 点
综合积分: 40 分
注册时间: 2010-09-09
最后登录: 2013-03-06
6楼  发表于: 2012-06-29 15:53
我也遇到了相同的问题哦,是不是要把程序下到前4k(小石头区)运行啊,但为什么DNS设置为0X00000000都不行啊?