linux下编译keil下调试,U-Boot调试——使用JLink在Keil(MDK)下调试U-Boot

以前有文章写了使用J-Link在AXD下的调试过程,考虑到当下MDK比较常用,先整理了这篇文章,后续再整理AXD下调试的文章。

感谢zzm24的文章,在我的测试中,发现参考文章中有些步骤可以省略(如修改u-boot为u-boot.axf,修改输出文件及修改RO/RW等),目前没有发现有什么问题,如有问题请大家加上并告知。

目前有几个问题:

1、上面提到的调试时要手动添加源文件(使用AXD时只需在第一次指定文件,以后就可正常调试了)。不能自动加载,这个很烦人,哪位兄台如果有可行的办法望告知。

2、我用这个方法调试最新的u-boot-2011.06,使用了arm-linux-gcc-4.3.2和arm-linux-gcc-4.4.3(根据网上资料gcc加了-gdwarf-2选项)编译通过,只能进行二进制(汇编)调试。无法进行C语言级调试,猜想MDK不能解析新版的gcc生成的调试信息,或者需要加一些什么编译选项,如有知道也请告知,不胜感激。

PS:以后等再使用新的4.5.X再试试

PS:编译u-boot-2010.03-tekkaman时使用的是arm-linux-gcc-4.3.2,可以进行源码调试。

3、开始时使用arm-linux-gcc-4.3.2编译u-boot 1.1.6,出现以下错误

arm-linux-ld: ERROR: Source object /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_udivdi3.o) has EABI version 5, but target u-boot has EABI version 0

arm-linux-ld: failed to merge target specific data of file /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_udivdi3.o)

arm-linux-ld: ERROR: Source object /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_udivsi3.o) has EABI version 5, but target u-boot has EABI version 0

arm-linux-ld: failed to merge target specific data of file /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_udivsi3.o)

arm-linux-ld: ERROR: Source object /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_dvmd_lnx.o) has EABI version 5, but target u-boot has EABI version 0

arm-linux-ld: failed to merge target specific data of file /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_dvmd_lnx.o)

arm-linux-ld: ERROR: Source object /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_clz.o) has EABI version 5, but target u-boot has EABI version 0

arm-linux-ld: failed to merge target specific data of file /usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_clz.o)

/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/armv4t/libgcc.a(_dvmd_lnx.o): In function `__aeabi_ldiv0':

(.text+0x8): undefined reference to `raise'

make: *** [u-boot] 错误 1

在以下页面中给出一些解释:

U-Boot is not a GNU/Linux application.  However, you're using the

GNU/Linux toolchain to compile it -- so the libraries assume the

presence of a GNU/Linux C library.  In this case, the division routine

wants to call "raise" to signal a division-by-zero exception.

People often try to abuse the GNU/Linux toolchain to build U-Boot

because they want to use the same toolchain that they use to build the

Linux kernel and GNU/Linux applications.  But, U-Boot is really a

bare-metal application, and, as such, should be built with a bare-metal

toolchain, like our "ARM EABI" toolchains.  There are often these kinds

of problems with U-Boot when moving between different architectures or

toolchain versions because the U-Boot source code has tricks to try to

make the GNU/Linux toolchain work, and those tricks only work with

particular toolchains.

That's the long story.

The short story is that you can probably provide an __aeabi_ldiv0

routine that just returns zero, overriding the default implementation.

看来,友善给的u-boot是太旧了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值