openocd安装与调试
环境:
硬件:PC机<------>ARM仿真器v8.00<------>已下载好bit流的Xinlinx SoC开发板(其上有arm cortex-a9核)
软件:Redhat Linux6(或虚拟机) + openocd
使用openocd下载程序,调试arm cortex-a9核。
一、openocd安装
- 下载libusb库安装或直接yum install libusb*
- 下载openocd-0.10.0.zip:https://sourceforge.net/projects/openocd/解压,进入目录
- $ ./configure --prefix=/home/benben/openocd --enable-jlink
- $ make #若编译有错根据提示信息修改
- $ sudo make install
二、openocd使用
$ lsusb
能查到仿真器usb信息...
$ openocd -f em8302_jtag.cfg(其中引用了jlink.cfg与v7arm.cfg) #连接开发板
打印出一些无Error的信息...
$ telnet localhost 4444 #启动守护程序
> resume 0 #从0地址开始运行
> halt #暂停cpu
> mdw 0 12 #从0地址读12个数(32位)
>mww 地址 写的数 #向某地址写数(32位)
>reg #查看寄存器
em8302_jtag.cfg内容
# The 8301 Board use jlink to Debug
source [find interface/jlink.cfg]
transport select jtag
# THe 8301 Board use a single v7arm chip
source [find target/v7arm.cfg]
echo "8302 Board Loaded."
# Set reset type and may be changed in some particular cases
reset_config trst_only
#reset_config separate
#reset_config trst_open_drain srst_open_drain
adapter_khz 200
# Wait after deasserting nTRST before starting new JTAG operations
#jtag_ntrst_delay 200
jlink.cfg内容(指定类型为jlink)
#
# Segger J-Link
#
# http://www.segger.com/jlink.html
#
interface jlink
# The serial number can be used to select a specific interface in case more than one
# is connected to the host.
#
# Segger software omits leading zeros in serial number displays,
# OpenOCD requires them.
#
# Example: Select J-Link with serial 123456789
#
# jlink serial 000123456789
v7arm.cfg(指定cpu信息)
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME ecictv7
}
# CoreSight Debug Access Port
if { [info exists DAP_TAPID] } {
set _DAP_TAPID $DAP_TAPID
} else {
set _DAP_TAPID 0x4ba00477
}
jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x01 -irmask 0x0f \
-expected-id $_DAP_TAPID
#
# Cortex A9 target
#
# GDB target: Cortex-A9, using DAP, configuring only one core
# Base addresses of cores:
# core 0 - 0x1fffc000
# core 1 - 0x2fffc000
set _TARGETNAME1 $_CHIPNAME.cpu.0
set _TARGETNAME2 $_CHIPNAME.cpu.1
# A9 core 0
target create $_TARGETNAME1 cortex_a -chain-position $_CHIPNAME.dap \
-coreid 0 -dbgbase 0x80090000
# -coreid 0 -dbgbase 0xc0000000
#$_TARGETNAME1 configure -work-area-phys 0x80000000 -work-area-size 8096
$_TARGETNAME1 configure -event reset-start { adapter_khz 50 }
#$_TARGETNAME1 configure -event reset-assert-post "cycv_dbginit $_TARGETNAME1"
$_TARGETNAME1 configure -event gdb-attach { halt }
#smp mode cannot halt only one cpu core, have no idea, by yzq
# A9 core 1
#target create $_TARGETNAME2 cortex_a -chain-position $_CHIPNAME.dap \
# -coreid 1 -dbgbase 0xc0002000
#$_TARGETNAME2 configure -event reset-start { adapter_khz 1000 }
#$_TARGETNAME2 configure -event reset-assert-post "cycv_dbginit $_TARGETNAME2"
#$_TARGETNAME2 configure -event gdb-attach { halt }
#target smp $_CHIPNAME.cpu.1 $_CHIPNAME.cpu.0
proc cycv_dbginit {target} {
# General Cortex A8/A9 debug initialisation
cortex_a dbginit
}
openocd安装与调试的更多相关文章
- OpenOCD安装与使用(JTAG调试)
本文介绍openocd开源软件的安装以及搭配JTAG对Xilinx u500VC707devkit的调试 PC OS: Ubuntu20.04 LTS Target ARCH: riscv64 JTA ...
- 安装ARM调试器
一.概述 1.调试ARM应用程序的软硬件组成 硬件JTAG/SWD仿真器 Eclipse调试插件 GDB调试客户端 GDB服务器端 JTAG/SWD需要的硬件驱动 2.GNU ARM Eclipse推 ...
- Windows Service 开发,安装与调试
Visual Studio.net 2010 Windows Service 开发,安装与调试 本示例完成一个每隔一分钟向C:\log.txt文件写入一条记录为例,讲述一个Windows Servic ...
- ubuntu14.04下nodejs + npm + bower的安装、调试和部署
1. 简介 本文介绍ubuntu14.04下nodejs+npm+bower的安装.调试和部署 参考文档 https://docs.npmjs.com/getting-started https: ...
- postgresql编译安装与调试(二)
接前文postgresql编译安装与调试(一),继续说说postgresql的编译安装与调试. 上一篇已经详细说明了如何在Linux系统上编译安装postgresql,这次我们在此基础上简单讲讲如何在 ...
- Redis安装与调试
Redis安装与调试 Redis安装与调试linux版本:64位CentOS 6.5 Redis版本:2.8.17 (更新到2014年10月31日) Redis官网:http://redis.io/ ...
- ubuntu安装带调试功能的bochs
①进入bochs官网下载源码包 说明 用安装包直接安装没有调试功能 下载源码包步骤 a.输入网址:http://bochs.sourceforge.net/ b.单击图中红色标注图标 c.单击图中红色 ...
- APM的3DR无线数传的安装和调试
APM飞控修改数传模块方法 http://www.cnblogs.com/wsine/p/4909903.html APM的3DR无线数传的安装和调试 http://tieba.baidu.com/p ...
- docker n2n安装与调试
docker n2n安装与调试 yum install -y docker docker pull pahud/n2n-docker cd / 10 mkdir data 11 cd data 12 ...
随机推荐
- 8. golang 基本类型转换
golang 类型转换只能显性转换 不能自动转换 基本数据类型间的转换 var x1 int = 2 var x2 int16 var x3 int8 x2 = 200 + x1 x3 = 200 + ...
- lambda map() filter() zip()练习
练习: 用map来处理字符串列表,把列表中所有人都变成sb,比方alex_sb l=[{'name':'alex'},{'name':'y'}] l=[{'name':'alex'},{'name': ...
- python中输入三个整数x,y,z,请把这三个数由小到大输出。
输入三个整数x,y,z,请把这三个数由小到大排序,再把数组由大到小排序,再输出最大值和最小值! #定义一个空数组 numbers = [] #循环遍历,下面的4是控制循环次数 for i in ran ...
- SCUT - 482 - 生成树上的点 - Prufer
https://scut.online/p/482 没听说过这个东西. 洛谷也有这个,所以还是要去接触一些奇奇怪怪的知识才行. https://www.luogu.org/problem/P2290 ...
- neo4j 初探
neo4j 初探 参考 转载:http://shomy.top/2018/06/08/neo4j-start/ 近期需要处理图数据,考察后打算使用neo4j, 相比其他一些图数据库,neo4j开源,跨 ...
- 前端UI库推荐(pc和移动)
此推荐个人喜好,不喜勿喷. 1. pc 端 elementUI (生态强大,样式生硬) iview (推荐,组件丰富) bootStrap layUI easyUi 2. 移动端 mintUI ant ...
- Linux安装Jenkins并部署springboot项目
安装步骤: 1.跳转连接https://pkg.jenkins.io/redhat-stable/下载安装包 2.安装命令: sudo rpm -ih jenkins-2.73.2-1.1.noarc ...
- Netty入门搭建
什么是Netty Netty 是一个基于 JAVA NIO 类库的异步通信框架,它的架构特点是:异步非阻塞.基于事件驱动.高性能.高可靠性和高可定制性. 为什么选择netty而不是使用NIO 1.使用 ...
- centos虚拟机配置网卡连接
本地连接 centos虚拟机连接设置: 换过ip之后需要重启网络服务新ip才生效 #service network restart 修改dns:
- Windows Neovim
配置文件路径C:\Users\UserName\AppData\Local\nvim\init.vim Vim-plug配置文件路径:C:\Users\UserName\AppData\Local ...