代码: 全选
1、skyeye 1.2.6-rc1
2、arm-linux-gcc 2.95.3
3、arm-linux-gdb 6.8
4、arm-linux-insight 6.8
5、u-boot 1.1.4
host使用的是ubuntu-8.04
一、编译安装skyeye
假定我的工作目录是~/workspace,下载skyeye-1.2.6_rc1.tar.bz2至工作目录
代码: 全选
kanson@kanson:~/workspace$ tar -jxvf skyeye-1.2.6.tar.bz2
kanson@kanson:~/workspace$ cd skyeye-1.2.6_rc1
kanson@kanson:~/.../skyeye-1.2.6_rc1$ ./configure
kanson@kanson:~/.../skyeye-1.2.6_rc1$ make
kanson@kanson:~/.../skyeye-1.2.6_rc1$ sudo cp skyeye /usr/bin
二、配置u-boot-1.1.4
代码: 全选
kanson@kanson:~/workspace$ tar -jxvf u-boot-1.1.4.tar.bz2
kanson@kanson:~/workspace$ cd u-boot-1.1.4
kanson@kanson:~/.../u-boot-1.1.4$ make smdk2410_config
kanson@kanson:~/.../u-boot-1.1.4$ make
u-boot.bin是不带调制信息的二进制文件make[1]: *** No rule to make target `hello_world.srec', needed by `all'. Stop.
make[1]: Leaving directory `/home/mort/src/targa/u-boot/u-boot-TOT/examples'
make: *** [examples] Error 2
有如下的解决方法:
打开 examples/Makefile
119 $(LIB): .depend $(LIBOBJS)
120 $(AR) crv $@ $(LIBOBJS)
121
122 %: %.o $(LIB)
123 $(LD) -g $(EX_LDFLAGS) -Ttext $(LOAD_ADDR) \
124 -o $@ -e $(<:.o=) $< $(LIB) \
125 -L$(gcclibdir) -lgcc
126 %.srec: %
127 $(OBJCOPY) -O srec $< $@ 2>/dev/null
128
129 %.bin: %
130 $(OBJCOPY) -O binary $< $@ 2>/dev/null
把126行和129行改为:
%.srec: %.o
%.bin: %.o
继续make
在make的过程中,出现:
isystem /usr/local/arm/bin/../lib/gcc-lib/arm-linux/3.2/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -mtune=arm7tdmi -msoft-float -mabi=apcs-gnu -Uarm -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c
cc1: invalid option `abi=apcs-gnu'
有如下的解决方法:
出错的文件是/cpu/s3c44b0/下的config.mk:将
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
改成:
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu),)
继续make,顺利make出u-boot.bin、u-boot、u-boot.srec
u-boot.bin是包含调制信息的elf文件,也是本方案要使用的文件
u-boot.srec好像是moto的一种文件格式,just forget it
三、仿真前准备工作
创建仿真工作目录
代码: 全选
kanson@kanson:~/.../u-boot-1.1.4$ mkdir skyeye
kanson@kanson:~/.../u-boot-1.1.4$ cd skyeye
代码: 全选
kanson@kanson:~/.../skyeye$ vi skyeye.conf
代码: 全选
#skyeye config file sample
cpu:arm920t
mach:s3c2410x
#all peripherals I/O mapping area
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
mem_bank: map=I, type=RW, addr=0x19000300, size=0x00000020
#physical memory
mem_bank: map=M, type=RW, addr=0x00000000, size=0x00080000, file=./u-boot, boot=yes
mem_bank: map=M, type=RW, addr=0x30000000, size=0x04000000
load_addr:base=0x30000000, mask=0xFFFFFF
代码: 全选
kanson@kanson:~/.../skyeye$ skyeye
代码: 全选
**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************
Your elf file is little endian.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x806c5c0
Your elf file will be load to: base address=0x30000000,mask=0xffffff
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM ./u-boot
ERROR: s3c2410x_io_write_word(0x4c000000) = 0x00ffffff
ERROR: s3c2410x_io_write_word(0x4c000008) = 0x00048032
U-Boot 1.1.4 (Oct 27 2008 - 11:34:51)
U-Boot code: 33F80000 -> 33F9873C BSS: -> 33F9C814
RAM Configuration:
Bank #0: 30000000 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 #
代码: 全选
kanson@kanson:~/.../skyeye$ skyeye -d
代码: 全选
**************************** WARNING **********************************
If you want to run ELF image, you should use -e option to indicate
your elf-format image filename. Or you only want to run binary image,
you need to set the filename of the image and its entry in skyeye.conf.
***********************************************************************
Your elf file is little endian.
arch: arm
cpu info: armv4, arm920t, 41009200, ff00fff0, 2
mach info: name s3c2410x, mach_init addr 0x806c5c0
Your elf file will be load to: base address=0x30000000,mask=0xffffff
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
Loaded RAM ./u-boot
debugmode= 1, filename = skyeye.conf, server TCP port is 12345
再打开一个shell,运行arm-linux-insight(前提是已经安装好了arm-linux-gdb、arm-linux-insight)
代码: 全选
kanson@kanson:~/.../skyeye$ arm-linux-insight u-boot
代码: 全选
Connection
Target: Remote/TCP
Hostname:为空
Port:12345
好像不能调试汇编文件(start.S),不知道什么原因,有高手知道为什么麻烦告诉我一下,但可以直接在board.c文件中的start_armboot函数上加断点,从此处开始调试C代码。
下图是我电脑上的截图