从skyeye学习arm( u-boot篇)


【 声明:版权所有,欢迎转载,请勿用于商业用途。  联系信箱:feixiaoxing @163.com】


    有了上面的skyeye环境,我们可以自己在上面进行测试和学习了。很多学习嵌入式linux的朋友都会涉及到u-boot的移植问题。但是u-boot调试是非常困难的,你能用到的方法不是点灯就是打印。但是有了skyeye之后,完全可以帮我们进行源码级别的调试。要进行u-boot调试,最主要的就是配置一个skyeye 文件和 编译u-boot。


   (1)配置skyeye.conf文件


cpu:  arm920t
mach: s3c2410x

#physical memory  
#mem_bank: map=M, type=RW, addr=0x20000000, size=0x01000000
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00800000
mem_bank: map=M, type=RW, addr=0x30000000, size=0x10000000
mem_bank: map=M, type=RW, addr=0xc0000000, size=0x01000000
mem_bank: map=M, type=RW, addr=0xc1000000, size=0x00600000
mem_bank: map=M, type=RW, addr=0xc1600000, size=0x00a00000
#all peripherals I/O mapping area
#mem_bank: map=I, type=RW, addr=0xfefa0000, size=0x00060000
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
net: type=cs8900a, base=0x19000300, size=0x20,int=9, mac=0:4:3:2:1:f, ethmod=tuntap, hostip=10.0.0.1
lcd:type=s3c2410x,mod=gtk
#dbct:state=on

    (2)编译u-boot, 我们使用的版本为u-boot-1.3.2.tar.bz2,


    a) 将arm交叉编译环境加入到PATH中;

    b)tar xjvf u-boot-1.3.2.tar.bz2;

    c)cd u-boot-1.3.2;

    d) make smdk2410_config;

    e) make, 编译在时候会有两个错误, 这和编译器有关, 只需要把_udivsi3.S:67, _umodsi3.S:79对应的代码直接用@注释就可以了;

    f)在目录下可以看到生成了u-boot、u-boot.bin两个文件。


    (3)将u-boot、skyeye.conf拷贝到一个目录下,在命令行下直接输入skyeye -e u-boot, 你就可以看到下面的内容


realsil@hp-6531s:~/Desktop/exer/arm_uboot$ skyeye -e u-boot 
Your elf file is little endian.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2 
mach info: name s3c2410x, mach_init addr 0x806dc30
ethmod num=1, mac addr=0:4:3:2:1:f, hostip=10.0.0.1
failed to setup_module (name:net, type:cs8900a)
tapif_init: icotl TUNSETIFF erroruart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
start addr is set to 0x33f80000 by exec file.
ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff
ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032


U-Boot 1.3.2 (Jan 12 2014 - 11:37:08)

DRAM:  64 MB
Flash: 512 kB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
ERROR: s3c2410x_io_write_word(0x1900030a) = 0x00000000
SMDK2410 # bdinfo
arch_number = 0x000000C1
env_t       = 0x00000000
boot_params = 0x30000100
DRAM bank   = 0x00000000
-> start    = 0x30000000
-> size     = 0x04000000
ethaddr     = 00:00:00:00:00:00
ip_addr     = 10.0.0.110
baudrate    = 115200 bps
SMDK2410 # 



    (4)调试u-boot


    a) 打开一个窗口, 输入skyeye -e u-boot -d;

    b) 再打开一个窗口, 输入gdb的相关调试命令即可。

realsil@hp-6531s:~/Desktop/exer/gdb-7.1/gdb$ ./gdb ../../u-boot-1.3.2/u-boot
GNU gdb (GDB) 7.1
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu --target=arm-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/realsil/Desktop/exer/u-boot-1.3.2/u-boot...done.
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
/home/realsil/Desktop/exer/gdb-7.1/gdb/.gdbinit:8: Error in sourced command file:
No breakpoint number 0.
(gdb) target remote :12345
Remote debugging using :12345
_start () at start.S:42
42	_start:	b       start_code
(gdb) b  board_init
Breakpoint 1 at 0x33f909d4: file smdk2410.c, line 74.
(gdb) c
Continuing.

Breakpoint 1, board_init () at smdk2410.c:74
74		clk_power->LOCKTIME = 0xFFFFFF;
(gdb) bt
#0  board_init () at smdk2410.c:74
During symbol reading, incomplete CFI data; unspecified registers (e.g., r0) at 0x33f909d4.
#1  0x33f805cc in start_armboot () at board.c:300
#2  0x33f8009c in start_code () at start.S:178
#3  0x33f8009c in start_code () at start.S:178
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 

    如果大家身边没有一块真实的arm开发板,完全可以用skyeye来进行相关的调试工作,非常方便。   

   


  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

嵌入式-老费

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值