天嵌 ARM开发社区

 找回密码
 注册
查看: 3763|回复: 26

求助,点亮LED没有反应

[复制链接]
chenhaiyang 发表于 2010-7-4 12:28:47 | 显示全部楼层 |阅读模式
刚刚买了QT2440,在网上找了一个点亮LED的程序,自己模仿写了一个,但是烧进去之后,没有反应。求解!谢谢了先。
代码如下:环境是ubuntu 10.04

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| chenhaiyang 发表于 2010-7-4 23:45:34 | 显示全部楼层
本帖最后由 chenhaiyang 于 2010-7-4 23:47 编辑

谢谢LS的,板子是买的新的,在淘宝上面,580元的那一套。
另外:输出0的我也试过,我怀疑是不是我烧录的方式有问题?应该怎么烧呢,从nor flash启动后用哪个选项呢?我都是用A的。
 楼主| chenhaiyang 发表于 2010-7-5 19:58:47 | 显示全部楼层
回复LS,我试了,还是有问题,选择7之后,我用dnw下载,完了之后,板子就重启了。
 楼主| chenhaiyang 发表于 2010-7-5 20:16:48 | 显示全部楼层
我怀疑是不是我的板子有问题阿,可是用WINCE里面的LED测试程序,没有问题阿,都能控制。不知道怎么办了。
 楼主| chenhaiyang 发表于 2010-7-5 22:14:14 | 显示全部楼层
把程序再贴一遍,麻烦您再看一下。
我的操作是:
norflash 启动,选择7,提示USB已经链接,等待下载数据。
然后,sudo dnw test

然后板子重启,串口有进入了norflash启动界面。

修改后的代码:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| chenhaiyang 发表于 2010-7-5 22:48:19 | 显示全部楼层
终于点亮了,但是我却迷茫了……………………
我之前一直烧的是经过objcopy之后的纯二进制文件,一直不成功,今天我烧了.o类型的ELF格式的文件,怎么就可以了呢?裸跑程序阿,怎么烧bin不行而ELF就可以呢?希望赐教一下啊。
亚瑟王 发表于 2010-7-6 12:23:11 | 显示全部楼层
你把用命令7时的串口信息贴出来。
 楼主| chenhaiyang 发表于 2010-7-6 19:46:38 | 显示全部楼层
串口信息如下:

lionheart@lionheart:~$ sudo minicom
[sudo] password for lionheart:


Welcome to minicom 2.4

OPTIONS: I18n
Compiled on Jan 25 2010, 06:49:09.
Port /dev/ttyUSB0

Press CTRL-A Z for help on special keys              
                                                     
*** Warning - bad CRC or NAND, using default environment
                                                     
                                                     

##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Download Mode !

#####    Boot for Nor Flash Main Menu   #####
[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash
[2] Download Eboot to Nand Flash
[3] Download Linux Kernel to Nand Flash
[5] Download CRAMFS image to Nand Flash
[6] Download YAFFS image to Nand Flash
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it
[8] Boot the system                                                            
[9] Format the Nand Flash                                                      
[0] Set the boot parameters                                                     
[a] Download User Program (eg: uCOS-II or TQ2440_Test)                          
[b] Download LOGO Picture (.bin) to Nand  Flash                                 
[l] Set LCD Parameters                                                         
[o] Download u-boot to Nor Flash                                                
[r] Reboot u-boot                                                               
[t] Test Linux Image (zImage)                                                   
[q] quit from menu                                                              
Enter your selection: 7                                                         
USB host is connected. Waiting a download.                                      
                                                                                
Now, Downloading [ADDRESS:32000000h,TOTAL:1118]                                 
RECEIVED FILE SIZE:    1<ERROR>118 <ERROR>(1KB/S, 1S)                           
## Starting application at 0x32000000 ...                                       
                                         &#65533;*** Warning - bad CRC or NAND, usingt
                                                                                
                                                                                
                                                                                
##### EmbedSky BIOS for SKY2440/TQ2440 #####                                    
Press Space key to Download Mode !                                             
                                                                                
#####    Boot for Nor Flash Main Menu   #####                                   
[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash            
[2] Download Eboot to Nand Flash                                                
[3] Download Linux Kernel to Nand Flash                                         
[5] Download CRAMFS image to Nand Flash                                         
[6] Download YAFFS image to Nand Flash                                          
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it               
[8] Boot the system                                                            
[9] Format the Nand Flash                                                      
[0] Set the boot parameters                                                     
[a] Download User Program (eg: uCOS-II or TQ2440_Test)                          
[b] Download LOGO Picture (.bin) to Nand  Flash                                 
[l] Set LCD Parameters                                                         
[o] Download u-boot to Nor Flash                                                
[r] Reboot u-boot                                                               
[t] Test Linux Image (zImage)                                                   
[q] quit from menu                                                              
Enter your selection:
烧录命令如下:

lionheart@lionheart:~/arm_code/arm_test$ sudo dnw test.bin
file name : test.bin
file size : 1108 bytes
Writing data...
100%     1118 bytes     OK
lionheart@lionheart:~/arm_code/arm_test$
 楼主| chenhaiyang 发表于 2010-7-6 19:49:05 | 显示全部楼层
串口信息中,后面的菜单是自动出来的。。。。。。。。。。。。。。。
 楼主| chenhaiyang 发表于 2010-7-6 20:03:01 | 显示全部楼层
谢谢LS,其实,test,和test.bin都是一样,只不过后来我给改了一下名字而已。
另外,资料我都是再网上搜的,arm-linux-gcc
还希望LS的可以加一下我的QQ,日后希望不吝赐教。
 楼主| chenhaiyang 发表于 2010-7-6 20:10:21 | 显示全部楼层
不是啊。是 “涅磐火凤”
亚瑟王 发表于 2010-7-6 20:22:28 | 显示全部楼层
你修改DNW,将0x32000000改为0x30000000,然后就可以使用命令7烧写到内存中运行了。
 楼主| chenhaiyang 发表于 2010-7-6 20:44:24 | 显示全部楼层
##### EmbedSky BIOS for SKY2440/TQ2440 #####                                    
Press Space key to Download Mode !                                             
                                                                                
#####    Boot for Nor Flash Main Menu   #####                                   
[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash            
[2] Download Eboot to Nand Flash                                                
[3] Download Linux Kernel to Nand Flash                                         
[5] Download CRAMFS image to Nand Flash                                         
[6] Download YAFFS image to Nand Flash                                          
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it               
[8] Boot the system                                                            
[9] Format the Nand Flash                                                      
[0] Set the boot parameters                                                     
[a] Download User Program (eg: uCOS-II or TQ2440_Test)                          
[b] Download LOGO Picture (.bin) to Nand  Flash                                 
[l] Set LCD Parameters                                                         
[o] Download u-boot to Nor Flash                                                
[r] Reboot u-boot                                                               
[t] Test Linux Image (zImage)                                                   
[q] quit from menu                                                              
Enter your selection: 7                                                         
USB host is connected. Waiting a download.                                      
                                                                                
Now, Downloading [ADDRESS:30000000h,TOTAL:34764]                                
RECEIVED FILE SIZE:   34764 (33KB/S, 1S)                                       
## Starting application at 0x30000000 ...                                       
*** Warning - bad CRC or NAND, using default environment                        
                                                                                
                                                                                
                                                                                
##### EmbedSky BIOS for SKY2440/TQ2440 #####                                    
Press Space key to Download Mode !                                             
                                                                                
#####    Boot for Nor Flash Main Menu   #####                                   
[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash            
[2] Download Eboot to Nand Flash                                                
[3] Download Linux Kernel to Nand Flash                                         
[5] Download CRAMFS image to Nand Flash                                         
[6] Download YAFFS image to Nand Flash                                          
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it               
[8] Boot the system                                                            
[9] Format the Nand Flash                                                      
[0] Set the boot parameters                                                     
[a] Download User Program (eg: uCOS-II or TQ2440_Test)                          
[b] Download LOGO Picture (.bin) to Nand  Flash                                 
[l] Set LCD Parameters                                                         
[o] Download u-boot to Nor Flash                                                
[r] Reboot u-boot                                                               
[t] Test Linux Image (zImage)                                                   
[q] quit from menu                                                              
Enter your selection: 7                                                         
USB host is connected. Waiting a download.                                      
                                                                                
Now, Downloading [ADDRESS:30000000h,TOTAL:1118]                                 
RECEIVED FILE SIZE:    1118 (1KB/S, 1S)                                         
<ERROR><ERROR>## Starting application at 0x30000000 ...                        
                                                       &#65533;*** Warning - bad CRC t
                                                                                
                                                                                
                                                                                
##### EmbedSky BIOS for SKY2440/TQ2440 #####                                    
Press Space key to Download Mode !                                             
                                                                                
#####    Boot for Nor Flash Main Menu   #####                                   
[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash            
[2] Download Eboot to Nand Flash                                                
[3] Download Linux Kernel to Nand Flash                                         
[5] Download CRAMFS image to Nand Flash                                         
[6] Download YAFFS image to Nand Flash                                          
[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it               
[8] Boot the system                                                            
[9] Format the Nand Flash                                                      
[0] Set the boot parameters                                                     
[a] Download User Program (eg: uCOS-II or TQ2440_Test)                          
[b] Download LOGO Picture (.bin) to Nand  Flash                                 
[l] Set LCD Parameters                                                         
[o] Download u-boot to Nor Flash                                                
[r] Reboot u-boot                                                               
[t] Test Linux Image (zImage)                                                   
[q] quit from menu                                                              
Enter your selection:
 楼主| chenhaiyang 发表于 2010-7-6 21:32:10 | 显示全部楼层
谢谢两位了。
问题解决了,原来是我的dnw是有问题的。再写的时候有可能出现奇数字节的写的情况。这样肯定会出问题,所以我把dnw改了。这个dnw是再网上下载的。没有想到居然有问题。
把修改后的贴出来吧。这样也许对遇到同样问题的一个方便的解决方式。(修改后是按照字单位的。呵呵,没有修改驱动部分。这个是linux版本)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| chenhaiyang 发表于 2010-7-6 21:43:25 | 显示全部楼层
但是,至于为什么用linux下的elf的.o文件就可以执行,甚至可以从nandflash启动,这个就不得而知了。这个问题可真实郁闷了阿。呵呵。不管怎么样,问题至少是解决了。呵呵。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-10-6 05:55 , Processed in 1.042032 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表