[S3C2440]

TQ2440程序无法从nandflash运行

[复制链接]
2859|5
手机看帖
扫描二维码
随时随地手机跟帖
爱就一个字|  楼主 | 2014-5-25 12:53 | 显示全部楼层 |阅读模式
利用Jlink将Uboot.bin烧尽开发板的norflash,开关拨到从norflash启动,启动菜单如下:

#####    Boot for Nor Flash Main Menu   #####
#####     EmbedSky USB download mode     #####

[1] Download u-boot or STEPLDR.nb1 or other bootloader to Nand Flash
[2] Download Eboot (eboot.nb0) to Nand Flash
[3] Download Linux Kernel (zImage.bin) to Nand Flash
[5] Download CRAMFS image to Nand Flash
[6] Download YAFFS image (root.bin) 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 ** Picture (.bin) to Nand  Flash
[l] Set LCD Parameters
[n] Enter TFTP download mode menu
[o] Download u-boot to Nor Flash
[r] Reboot u-boot
[t] Test Linux Image (zImage)
[q] quit from menu
Enter your selection:

我的代码如下,四个LED分别连接到GPB[5]-GPB[8]
.text
.global _start
_start:
        ;设置GPB[5]-[8]为输出
        LDR R0,=0x56000010
        LDR R1,=0x00015400
        STR R1,[R0]
        //让GPB[8]输出为0
        LDR R0,=0x56000014   
        LDR R1,=0x000000E0
        STR R1,[R0]

loop:
        B loop

链接脚本如下:
led.bin : led.s
        arm-linux-gcc -g -c -o led.o led.s
        arm-linux-ld -Ttext 0x0000000 -g led.o -o led_elf
        arm-linux-objcopy -O binary -S led_elf led.bin
clean:
        rm -f   led_on.bin led_on_elf *.o

编译完之后选择菜单中的a选项,将程序烧尽nandfalsh,开关拨到从nandflash启动,上电,LED没亮。
选择菜单7结果相同,LED也没亮,久思不得其解。
但是我将程序利用Jlink烧写到norflash中,再从norflash启动,程序运行正常,LED亮了。
将天嵌官方的测试程序利用菜单a烧尽nandflash,却可以正常运行。
我的程序编译完之后只有36个字节,2440从nanflash启动,,会自动将nandflash的前4K代码拷贝到片内的RAM中,
然后从RAM运行。
为什么我的程序运行不了呢?

相关帖子

爱就一个字|  楼主 | 2014-5-25 12:56 | 显示全部楼层
注释写错了,应该是
;让GPB[8]输出为0
这个问题折磨我好几天了,求大神指导,感激不尽!!!

使用特权

评论回复
yamato2011| | 2014-5-25 13:45 | 显示全部楼层
你试过将你的代码用Jlink烧到NANDfalsh中启动了吗?

使用特权

评论回复
爱就一个字|  楼主 | 2014-5-26 00:03 | 显示全部楼层
yamato2011 发表于 2014-5-25 13:45
你试过将你的代码用Jlink烧到NANDfalsh中启动了吗?

利用Jlink只能将程序烧写到norflash中。
要想将程序烧写到nanflash中,只能通过并口烧写,我用的时是笔记本电脑,没有并口。
所以只能利用Uboot将程序烧写到nandflash中。

使用特权

评论回复
a08715| | 2014-7-10 17:56 | 显示全部楼层
这个问题我也在纳闷,用U-BOOT下载到nandflash,根本下不了,我的LED0-LED3轮流点亮程序,只能用J-LINK下载到norflash,而且灯不会闪。纳闷中!!

使用特权

评论回复
liupeng08304| | 2014-7-11 18:29 | 显示全部楼层
先选择9,格式化 然后选择1,可能是下载的地址不对

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

4

主题

14

帖子

0

粉丝