打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
AXD 调试汇总(整理来源于网页)

AXD命令:

1.reload

当调试想重新载入image从头开始调试时用这个命令。

2.where

用于确定在哪个源文件,及映像文件的位置处

3.help

打开AXD帮助

4.run

全速运行程序。

5.reg

查看registers的值

6.setpc

setpc 0x00000020设置pc的地址,可用于开始时定位pc指针

7.stk

查看堆栈

8.va

查看变量

9.step

步步运行。

10.runtopos==>rto

11.setbreakprops===>sbp

12.setmem==>smem

13.setpc==>pc

14.setreg===>sreg

//-------------------------------------------------------------------------------------------

1、ads是由arm公司提供的编译和调试环境,非常好,不容质疑!搞arm开发的人员,不能不用ads,例如要开发一个驱动,首先是在ads中编译、调试通过,才会加入操作系统中,这是开发过程。

2、Ads中codewarria是编译环境,在这个环境中,应正确设置程序工作或调试的地址,这两个地址不一定同址,每次只能设置一种,除非它们相同。设置是通过菜单项edit->target setting完成的。编译环境中的这个地址是由链结器标记在程序上的(暂且这样说吧,因为这部分实际涉及的是编译原理中的链接定位问题,它主要涉及的是程序中的跳转地址,这是与软件相关的)。这两个地址都必须与硬件地址配合,程序才能正常工作。因为mcu(arm)是硬件寻址的,比如4510在正常初始化后,flash被定位在0x0地址,这时如果mcu有一条指令是跳转到0x0地址,那么mcu一定会将PC指向flash的0x0地址,mcu却是由软件控制的。如果这时remap了,flash被定位在0x1000000地址,但写在flash中的程序仍然控制mcu跳转到0x0地址,那么PC就指向了sdram的0x0地址,那里写着什么是你的事情了。

3、工作地址是指编译好的程序(一般是*.bin文件)写入flash的地址,如软件程序工作地址从0x0开始,flash也应该定位在0x0地址开始,软件与硬件地址要相同,才能正常工作。当然,如果做remap,把程序拷贝到新的 0x0地址处,也就是sdram中,程序也可以正常工作的。

4、如果用axd调试,则是另外一种情况:程序必须写在sdram中,而不是 flash中。Sdram的地址在那里呢?4510上电后,一般设置在0x1000000,而把flash设置在0x0地址。如果codewarria编译时把程序设置在0x0地址,调试时就会把软件加载在一个“虚”位置,这个位置(地址)是flash的地址,mcu是无法把程序写入flash中,程序就成为空中飘荡的幽灵,这时如果用反汇编,可以看到有些内容已经变质了,不是你的程序了,明白是为什么吗?而执行的话,mcu读取flash中的内容,它们并非你的程序,结果是跑飞了。解决办法是remap(对4510。如是44b0,请在codewarria编译环境中把程序定位在 sdram段,如需中断,请在flash中0x0地址先写入相关中断向量,并跳转到sdram中),把sdram设置在0x0地址,再加载程序。

5、Remap时,请用axd中的命令行方式,程序是实现不了的。即:system view->command line interface。只有先把硬件地址设置的与程序相同了、程序段可以被装入sdram中时,才可加载程序。

6、切记这两点:调试程序一定要放在sdram中、sdram地址与程序地址一定要相同。

7、 0x8000这个地址是怎么来的呢?原来:0x0地址是中断向量地址,这要占用几十个字节,有些操作系统利用中断向量之后、0x8000地址之前的部分做点事情,Linux就是其一。所以,编程人员默认的把0x8000这个地址作为一般程序的开始地址。调试程序时,可以把程序起始地址定在0x8000,这个地址一定要是sdram覆盖的地址(我再强调一次吧),mcu执行时,仍然是从0x0开始的,是谁把PC挪到0x8000的,是ads在编译的时候,连接器加进的代码实现的。如果不是调试程序,是工作程序,要写入flash的,程序应该定位在0x0地址,而不是0x8000。

8、有一本书 “ARM应用开发系统祥解--S3C4510B”写的非常好,我读过有7、8遍了。但有一点是错的。书中写到:“针对本书所介绍的目标板,就可以使用这个默认地址值(0x8000)。”实际上,只要是4510的板子,不做remap,0x8000地址就是flash,是不能加载程序的。

9、在axd中,注意菜单options->configure processor选项,如果不会用,就把它们都关了。带中断的程序和有跳转到0x0地址的程序执行不了,多是由这项引起的。其实它们非常有用,不提了。

10、所有我以上提到的,均是有程序重定位和跳转情况的,象简单的跑马灯实验,不需要中断、跳转的,把程序直接定位在高位sdram中,remap也不用做,就可以跑的不错了。

11、顺便提一下banyan的接口包非常好,支持ads,不用怀疑它。

//-------------------------------------------------------------------------------------------

Here lists common commands that you can issue using the command-line interface: break br[ expr|posn [ n]]
where:
expr|posn Is either an expression or a position that defines where a new breakpoint is to be created.
n Specifies the number of times execution must arrive at the breakpoint in
order to trigger it. The default value is 1.

e.g.:br 0x8000 Sets a breakpoint at address 0x8000
br @main Sets a breakpoint on main.
br c:\test\main.c|130 100 Sets a breakpoint on line 130 of file main.c, requiring 100 arrivals to trigger it.
br #5|150 Sets a breakpoint at line 150 of file number 5. The index #5 must have been obtained using the files command. clearbreak

cbr breakpoint|all

e.g.:cbr #2 Clears breakpoint number 2. The index #2 must have been obtained using the break command. unbreak all Clears all current breakpoints. The parameter all is case-sensitive.
clearwatch cwpt watchpoint|all

e.g:cwpt #2 Clears watchpoint number 2. The index #2 must have been obtained using the watchpt command.
unwatch all Clears all current watchpoints. The parameter all is case-sensitive. disassemble
dis expr1[ [+]expr2[ asm]]

where:
expr1 Is an expression that evaluates to the starting address of the area of memory you want to see disassembled.
expr2 Is an expression that either evaluates to the end address of the area of memory you want to see disassembled or, if preceded by +, evaluates to the number of bytes you want disassembled. If a value is not supplied on the command line, the value from the Bytes to display property box is used.
asm Can be set to ARM, Thumb, ByteCode or auto. If not specified, the current value of the Instruction Size field of the CLI
properties dialog is used. e.g.:dis 0x8200 +64 ARM
Displays disassembled instructions that represent the ARM code currently stored in the 64 bytes of memory starting at address 0x8200.
dis 0x8000 +10 ByteCode
Displays disassembled instructions that represent the Jazelle code currently stored in the 10 bytes of memory starting at address 0x8000.
loadbinary lb file addrexpr
where:
file Specifies the file containing the data to be loaded.
addrexpr Is an expression that evaluates to a memory address.

e.g.:lb sbtest.bin 0x8300 memory
mem expr1[ [+]expr2[ memory[ format]]]

where:
expr1 Is an expression that evaluates to the starting address of the area of memory that you want to examine.
expr2 Is an expression that either evaluates to the end address of the area of memory that you want to examine or, if preceded by a +, evaluates to the number of bytes that you want to examine. If expr2 is not present, the number of bytes displayed uses the value in the Bytes to display dialog box.
memory Can be set to 8, 16, or 32.
format Can be set to the RDI name as shown in the last displayed format list or to the index number of any available format. e.g.:mem 0x8300 +256 8 hex
obey obey file
where:
file Identifies a file containing valid CLI commands, each separated by a carriage return, with the end of file at the beginning of a new line. registers
reg[ regbank[ format]]

where:
regbank Specifies the register bank to be listed. If you do not specify a register bank, the one named Current is listed.
format Specifies the format to be used in the list if you do not want the default format. e.g.:reg user Displays the number, name, and contents of each of the registers in the user register bank. You can issue a regbk command to see a list of the current register banks.
run r[ processor]
where:
processor Specifies the processor (the current processor is the default). savebinary
sb file expr1 [+]expr2

where:
file Specifies the file in which you want to save the contents of the specified area of memory.
expr1 Is an expression that evaluates to the starting address of the area of memory to save.
expr2 Is an expression that evaluates either to the end address of the area of memory to save or, if preceded by +, to the number of bytes to save. e.g.:sb sbtest.bin 0x8300 +256
setmem smem addrexpr valexpr[ memory]
where:
addrexpr Evaluates to the memory address at which you want to insert the new value.
valexpr Evaluates to the value that you want to insert at the specified memory
address. This evaluation results in an 8-bit, a 16-bit, or a 32-bit value
depending on the setting of the memory parameter, or of the current
global variable value if you do not specify the memory parameter.
memory If used must be set to 8, 16, or 32.

e.g.:smem 0x83A8 0x41424344 32 setpc
pc expr
setreg sreg [regbank|]register expr

e.g.:sreg r12 100 Sets register r12 in register bank current to the value 100.
sreg FIQ|r12 IRQ|r13 Sets register r12 in register bank FIQ to the value of register r13 in register bank IRQ. setwatch
swat expr1 expr2

where:
expr1 Specifies an expression to which you want to assign a value.
expr2 Specifies a new value to be assigned to the expression.

e.g.:swat a1 100 Sets variable a1 to the value 100.
swat a b Sets variable a to the value of variable b.

step st[ step][ instr]
where:
step Can be set to in or out.
instr Can be set to line or instr.

e.g.:step in line Steps one source line. If the line contains a subroutine call, steps into the subroutine.
step out instr Steps out of the current stack. If no stack frame information is available, steps one instruction.
step Steps, without forcing a step in or out, one instruction or source line depending on the setting of instr. If a subroutine call is encountered, this command steps over it. stop
stop[ processor]
watch wat expr[ format]

//-------------------------------------------------------------------------------------------

我在用AXD在线调试的时候,首先载入程序,点全速执行,程序在MAIN函数那停下来,然后无论点单步还是全速执行,程序都不动了。点全速执行时候的出错信息:DBE Warning 00256: Execution stopped, because of an unknown breakpoint (this indicates an internal error).单步执行的时候信息是:DBE Warning 00056: The statement into which was stepped is singular (i.e. it has no exit)小弟刚开始学习ARM,请高手指点,先谢了!

配置的原因
这个问题,我昨天遇到过,你的运行域和加载域没有设置好,还有就是程序里面读取的地址是不是在你的系统的地址范围之内啊?总之,就是检查一下ADS和AXD的配置,配置好了就应该没有问题了。

//--------------------------------------------------------------------------------

待续---

好好看看datasheet吧
2410 ro是0x30000000 比如你sdram是64M的 那最高也就是0x34000000
当然不对了

调试的时候要接wiggler接口,JTAG接口只是用来烧写FLASH的

调试时:RO设置为0即可(设置成0x30100000是SDRAM的地址,如果VIVI启动了也是可以的),RW不用设置

如果是烧写,设为0也是可以的,不过就要写到FLASH的0地址,这样会把VIVI覆盖了

此问题以解决,因为并口线不稳定,程序没有下到芯片上去。所以程序调试时会跑飞。

谢谢各位
是jtag代理软件的问题,换成banyan就好了

Error : (Fatal) L6015U: Could not find any input files to link.
Not enough information to list the image sizes and/or totals.
Finished: 1 information, 0 warning, 0 error and 1 fatal error messages.

其实,这样的错误也许是我这种初学者容易犯的错误,这个错误提示已经说明:没有找到任何的输入文件进行连接。我出现该错误的原因是:没有把编译的文件添加到工程里面,那么,就会造成工程项目中没有可以编译的文件。所以,这个问题解决的办法当然就是把相关的文件添加到相应工程项目中,避免出现找不到文件的错误...
下面是在ADS 1.2 Build Tools - Errors and Warnings文章中出现的提示和处理,相信对有相关问题的朋友得到一些启示:
L6015U: Could not find any input files to link.
The linker must be provided with at least one object file to link.
Example:
If you try to link with
armlink -o foo.axf
you will get the above error. Instead, you must use, for example:
armlink foo_1.o foo_2.o -o foo.axf

在调试程序从汇编程序跳转到c程序时(如在init.s文件的程序中最后有一句BL main,在main.c文件中有一个main函数),一般都遇到下面的情况:
1) pc指针在运行到BL main处是不再改变;
2) 在debug log框中出现调试信息“DBT Warning 00135: Cannot set breakpoints in literal pools”

我的办法就是在BL main后加上“B . ”就可以正常调试

当执行单步运行时,PC一直停留在RO Base中设置的FLASH存储器的地址处(如0x0),而且Debug Log窗口中显示“RDI Warning 00148: Can't set point”。
原因是仿真器在ROM中设置的断点数是有限的,且单步运行时内部还要占用断点。可以使用“Option->Config Processor”打开“Processor Properties-ARM7TDMI”窗口,且按照下图设置以关断相的断点。

ADS 编译时出现警告:“Warning : L6305W : Image does not have an entry point”。该编译警告将引起运行AXD调试的时候,程序直接就从__main标号的地方或者其他地方开始执行,同时在debug log 信息框还会出现“DBT Warning 00136:Image has no entry point”的提示信息。
这个问题出现的原因是由于ENTRY顶格书写,造成编译器认为ENTRY是一个普通的标号,不是关键字。所以,该问题解决办法就不言而喻了...(在ENTRY前加空格或tab键,总之就是不能顶格书写)
另外,出现该警告还跟OPTION选项里的ARM Linker设置有关,先设置好,再编译连接.具体参考如下:
1. output 页里 RO Base 设成 0x40000000,RW Base 设成 0x40003000
2. options 页里 image entry point 设成 0x40000000
3. layout 页里 object /symbol 设成init.o ,section 设成init

本文转自http://hi.baidu.com/wangy0919/blog/item/1f2c3b602cab7d47ebf8f8c1.html

 

//----------------------------------------------------------------------------

以NandFlash测试程序为例来说明AXD工具使用方法.在CodeWarrior中执行Debug,ADS编译器会自动调用AXD工具.

(一)使用H-JTAG的AXD调试
(1)使用AXD工具前需要指定H-JTAG来调试开发板.
开发板不上电,在CodeWarrior中执行Debug,ADS编译器自动调用AXD工具.在AXD界面内执行菜单Options/Configure Target,单击Add来添加H-JTAG配置文件.该配置文件是在H-JTAG安装目录下的H-JTAG.dll(常见安装目录c:/Program Files/H-JTAG/H-JTAG.dll).选中H-JTAG,单击Configure,这样就工程配置了AXD工具的H-JTAG.

(2)接入Debug串口线、USB线、JTAG线,打开H-JTAG代理调试软件、SecureCRT,打开开发板电源.注意,如果要使用AXD进行调试,NandFlash内不能有程序,否则会使要调试的程序运行不正常.所以,使用前先擦除NandFlash.

(3)在CodeWarrior中执行Debug,ADS编译器会自动调用AXD工具.如果AXD图标变色,说明已成功连接至开发板.

(4)配置SDRAM.由于需要将程序下载到SDRAM中运行,所以使用AXD调试前需要正确配置SDRAM.天祥电子提供了SDRAM的初始化脚本"2440init.txt",用户在运行AXD前应该先运行该初始化脚本.在AXD界面内执行菜单Options/Configure Interface/Session File,选择Run Configuration Script,单击Browse,找到该初始化脚本.注意,初始化脚本"2440init.txt"必须放在英文目录下.注意,再次运行AXD工具时,在AXD界面内的Command Line Interface可以看到AXD是否运行了该初始化脚本.

(5)AXD的简单调试

单击go按钮,可以运行程序.如果正常运行,程序会自动跳到main函数处.当程序没有跳到main函数时,表明程序已跑飞.单击stop按钮,可以停止程序的运行.
<1>再次单击go按钮,在SecureCRT内会打印出调试信息.
<2>输入2,选择NandFlash K9F2G08.在SecureCRT内列出测试选项.
<3>输入0: 读取NandFlash ID号.
<4>输入1: 复位NandFlash.
<5>输入2: 擦除NandFlash,并输入要擦除的块.输入1,擦除Block 0.
<6>输入3: 读取页数据,并输入要读取的块,输入1;输入要读取的页,输入2.
<7>输入4: 页写入,并输入要写入的块,输入2;输入要写入的页,输入1.

(二)使用J-Link的AXD调试

如果用户的计算机没有并口,也可以使用J-link来连接开发板.

(1)安装J-link驱动.
(2)将J-link的一端接计算机的USB口,另一端接开发板的JTAG端口.
(3)接入Debug串口线、USB线,打开H-JTAG代理调试软件、SecureCRT,打开开发板电源.如果J-link绿灯亮起,表明连接正常.
(4)关闭开发板电源,添加J-link配置文件.
在AXD界面内执行菜单Options/Configure Target,单击Add来添加J-link配置文件.该配置文件是在J-link安装目录下的JLinkRDI.dll.常见安装目录c:/Program Files/SEGGER/JLinkARM_V402a/JLinkRDI.dll.选中Multi-ICE,单击Configure,这样就配置了AXD工具的J-link.
(5)在CodeWarrior中执行Debug,ADS编译器会调用AXD工具.如果AXD图标变色,说明已成功连接至开发板.注意,如果要使用AXD进行调试,NandFlash内不能有程序,否则会使要调试的程序运行不正常.所以,使用前先擦除NandFlash.
(6)配置SDRAM.由于需要将程序下载到SDRAM中运行,所以使用AXD调试前需要正确配置SDRAM.天祥电子提供了SDRAM的初始化脚本"2440init.txt",用户在运行AXD前应该先运行该初始化脚本.在AXD界面内执行菜单Options/Configure Interface/Session File,选择Run Configuration Script,单击Browse,找到该初始化脚本.注意,初始化脚本"2440init.txt"必须放在英文目录下.在AXD界面内的Command Line Interface,可以看到AXD是否运行了该初始化脚本.
(7)单击go按钮,可以运行程序.如果正常运行,程序会自动跳到main函数处.当程序没有跳到main函数时,表明程序已跑飞.单击stop按钮,可以停止程序的运行.再次单击go按钮,在SecureCRT内会打印出调试信息.
<1>输入2,选择NandFlash K9F2G08.在SecureCRT内列出测试选项.
<2>输入0: 读取NandFlash ID号.
<3>输入1: 复位NandFlash.
<4>输入2: 擦除NandFlash,并输入要擦除的块.输入1,擦除Block 0.
<5>输入3: 读取页数据,并输入要读取的块,输入1;输入要读取的页,输入2.
<6>输入4: 页写入,并输入要写入的块,输入2;输入要写入的页,输入1.

(三)AXD常见问题分析
(1)单击debug按钮后进入AXD调试界面,单击go(全速运行),但程序总是跑飞.跑飞的现象是单击停止按钮,出现如下图所示,图中都是汇编语言.

解决步骤:
<1>在AXD界面内执行菜单Options/Configure Target,查看是否添加了H-JTAG配置文件.
<2>在AXD界面内执行菜单Options/Configure Interface/Session File,选择Run Configuration Script,单击Browse,找到SDRAM初始化脚本"2440init.txt".注意,初始化脚本"2440init.txt"必须放在英文目录下.注意,再次运行AXD工具时,在AXD界面内的Command Line Interface可以看到AXD是否运行了该初始化脚本.
<3>要使用AXD进行调试,NandFlash内不能有程序,否则会使要调试的程序运行不正常.所以,使用前先擦除NandFlash.
<4>如果执行了以上的步骤,程序仍然跑飞,则需要关闭AXD,关闭开发板电源.然后再次上电,再次进行Debug调试.

//-----------------------------------------------------------------------

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
浅谈S3C6410裸板调试
调试U-Boot笔记(四)
AXD+H
从单片机步入Linux之uboot编译、烧录与启动
【笔记】2014-01至2014-02
norflash启动和nandflash启动
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服