天嵌 ARM开发社区

 找回密码
 注册
查看: 4697|回复: 9

u-boot启动问题

[复制链接]
ls_core 发表于 2012-8-29 15:16:19 | 显示全部楼层 |阅读模式
大家好小弟有个问题需要向各位请教。本人,最近在移植u-boot到TQ2440开发板(从NorFlash启动)。但是移植工作全部做好了,但是将生成u-boot.bin文件烧写到norFlash中,就是启动不起来。后来,本人将cpu/arm920t/目录下的start.S文件的头部改成了这样:

.globl _start
_start:       
       
#  define GPBCON1        0x56000010
#  define GPBDAT1        0x56000014
        ldr        r1, =0x00015400
        ldr        r0, =GPBCON1
        str        r1, [r0]

        ldr        r1, =0x00000140
        ldr        r0, =GPBDAT1
        str        r1, [r0]
loop1:
        b         loop1
这段代码的意思就是让u-boot一启动就去点亮开发板上的LED1和LED3以作为指示作用。但是这样做后,将编译生成的u-boot.bin烧写到NorFlash中,上电LED1 和LED3并没有亮。本人推断上电后系统根本没有从0地址处的_start运行。但这到底是为什么呢?希望知道的兄长帮忙解答一下。
备注:烧写天嵌出厂自带的u-boo.bin是可以正常启动的。

评分

参与人数 1 +2 收起 理由
510446684 + 2 很给力!

查看全部评分

 楼主| ls_core 发表于 2012-8-29 15:31:20 | 显示全部楼层
还有,今天本人又用天嵌自带的u-boot镜像,启动系统之后利用第7个选项[7] Download Program (uCOS-II or TQ2440_Test) to SDRAM and Run it。将上面生成的u-boot.bin(在u-boot移植方面已做了相关的修改(做了TEXT_BASE=0x33000000 等修改)。使u-boot能在sdram中运行)下载到SDRAM中并运行。
##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Download Mode !

#####    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 LOGO 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: 7
USB host is connected. Waiting a download.

Now, Downloading [ADDRESS:33000000h,TOTAL:94506]
RECEIVED FILE SIZE:   94506 (92KB/S, 1S)
## Starting application at 0x33000000 ...

可是LED1和LED3依然没有点亮。我推测,本人移植的u-boot总是无法从_start出执行。
恳求,哪位兄长能够指点指点。小弟不甚感激!谢谢
 楼主| ls_core 发表于 2012-8-29 20:47:16 | 显示全部楼层
知识就是一张窗户纸,有的时候如果有个明了的人给稍稍一点,问题就明了了……希望版主能够看到,帮帮小弟,谢谢!
小舟 发表于 2012-8-30 09:21:22 | 显示全部楼层
你好你是怎么进入到下面的页面的
##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Download Mode !

#####    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 LOGO 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: 7
USB host is connected. Waiting a download.

Now, Downloading [ADDRESS:33000000h,TOTAL:94506]
RECEIVED FILE SIZE:   94506 (92KB/S, 1S)
## Starting application at 0x33000000 ...


 楼主| ls_core 发表于 2012-8-30 10:28:28 | 显示全部楼层
小舟 发表于 2012-8-30 09:21
你好你是怎么进入到下面的页面的
##### EmbedSky BIOS for SKY2440/TQ2440 #####
Press Space key to Dow ...

你的NorFlash中只要有天嵌u-boot镜像,开发板上电之后在串口终端上就会看到这个界面的。如果你看不到,有可能你的Norflash中的镜像被擦除了。你可以找一个j-link再次烧写一下。
亚瑟王 发表于 2012-8-30 11:58:44 | 显示全部楼层
ls_core 发表于 2012-8-29 15:31
还有,今天本人又用天嵌自带的u-boot镜像,启动系统之后利用第7个选项[7] Download Program (uCOS-II or TQ ...

亲,start.S是开机第一个运行的,这点是不容置疑的。
根据你描述的情况,你需要自行确认:在u-boot.lds中start.S文件编译出来的start.o必须是第一个链接文件。
你需要修改你添加的代码到reset:之后,因为默认的开始一段内容是CPU做跳转的,希望不要将其占用了。
 楼主| ls_core 发表于 2012-8-30 12:16:35 | 显示全部楼层
亚瑟王 发表于 2012-8-30 11:58
亲,start.S是开机第一个运行的,这点是不容置疑的。
根据你描述的情况,你需要自行确认:在u-boot.lds中 ...

嗯嗯,应该是您说的CPU跳转的问题,因为我在start.S中自定义的宏,比如:#  define GPBCON1        0x56000010 #  define GPBDAT1        0x56000014;通过观察make生成u-boot.dis文件,会发现。这个宏定义被放在了代码段fiq中而且是undefine,请看他的304和305行。初步认定start.S中是不支持额外添加宏定义之类的,只能在原有的基础上修改,此问题有待验证……
278 33f80380 <fiq>:
  279 33f80380:       e51fd344        ldr     sp, [pc, #-836] ; 33f80044 <_armboot_start>
  280 33f80384:       e24dd805        sub     sp, sp, #327680 ; 0x50000
  281 33f80388:       e24dd088        sub     sp, sp, #136    ; 0x88
  ………………
  301 33f803d8:       4a000008        bmi     33f80400 <_TEXT_BASE>
  302 33f803dc:       00007fff        streqd  r7, [r0], -pc
  303 33f803e0:       4a00001c        bmi     33f80458 <SMRDATA+0x28>
  304 33f803e4:       56000010        undefined
  305 33f803e8:       56000014        undefined
  306 33f803ec:       e1a00000        nop                     (mov r0,r0)
  307 33f803f0:       e1a00000        nop                     (mov r0,r0)
  308 33f803f4:       e1a00000        nop                     (mov r0,r0)
  309 33f803f8:       e1a00000        nop                     (mov r0,r0)
  310 33f803fc:       e1a00000        nop                     (mov r0,r0)

谢谢亚瑟王的指点!希望能够与兄长多多交流。
 楼主| ls_core 发表于 2012-8-30 14:08:58 | 显示全部楼层
亚瑟王 发表于 2012-8-30 11:58
亲,start.S是开机第一个运行的,这点是不容置疑的。
根据你描述的情况,你需要自行确认:在u-boot.lds中 ...

亚瑟王您好:
有没有办法用LED灯指示一下程序跑到哪儿了啊,我想着是用LED灯指示,让后用loop:b loop指令停在stat.s
中的某处
亚瑟王 发表于 2012-8-30 15:27:59 | 显示全部楼层
ls_core 发表于 2012-8-30 14:08
亚瑟王您好:
有没有办法用LED灯指示一下程序跑到哪儿了啊,我想着是用LED灯指示,让后用loop:b loop指 ...

可以的,你把代码加到你想要停留的位置即可。
建议你先看天嵌科技提供的u-boot源码。再自行移植。
stary 发表于 2012-9-11 15:27:38 | 显示全部楼层
我的也是烧录到NORFLASH成功后,但是板子没有反应,白屏,随后就变黑了,就保持这个状态了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

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

GMT+8, 2024-4-29 14:06 , Processed in 1.046868 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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