环境:

硬件:PC机<------>ARM仿真器v8.00<------>已下载好bit流的Xinlinx SoC开发板(其上有arm cortex-a9核)

软件:Redhat Linux6(或虚拟机) + openocd

使用openocd下载程序,调试arm cortex-a9核。

一、openocd安装

  1. 下载libusb库安装或直接yum install libusb*
  2. 下载openocd-0.10.0.zip:https://sourceforge.net/projects/openocd/解压,进入目录
  3. $ ./configure --prefix=/home/benben/openocd --enable-jlink
  4. $ make                                    #若编译有错根据提示信息修改
  5. $ 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安装与调试的更多相关文章

  1. OpenOCD安装与使用(JTAG调试)

    本文介绍openocd开源软件的安装以及搭配JTAG对Xilinx u500VC707devkit的调试 PC OS: Ubuntu20.04 LTS Target ARCH: riscv64 JTA ...

  2. 安装ARM调试器

    一.概述 1.调试ARM应用程序的软硬件组成 硬件JTAG/SWD仿真器 Eclipse调试插件 GDB调试客户端 GDB服务器端 JTAG/SWD需要的硬件驱动 2.GNU ARM Eclipse推 ...

  3. Windows Service 开发,安装与调试

    Visual Studio.net 2010 Windows Service 开发,安装与调试 本示例完成一个每隔一分钟向C:\log.txt文件写入一条记录为例,讲述一个Windows Servic ...

  4. ubuntu14.04下nodejs + npm + bower的安装、调试和部署

      1. 简介 本文介绍ubuntu14.04下nodejs+npm+bower的安装.调试和部署 参考文档 https://docs.npmjs.com/getting-started https: ...

  5. postgresql编译安装与调试(二)

    接前文postgresql编译安装与调试(一),继续说说postgresql的编译安装与调试. 上一篇已经详细说明了如何在Linux系统上编译安装postgresql,这次我们在此基础上简单讲讲如何在 ...

  6. Redis安装与调试

    Redis安装与调试 Redis安装与调试linux版本:64位CentOS 6.5 Redis版本:2.8.17  (更新到2014年10月31日) Redis官网:http://redis.io/ ...

  7. ubuntu安装带调试功能的bochs

    ①进入bochs官网下载源码包 说明 用安装包直接安装没有调试功能 下载源码包步骤 a.输入网址:http://bochs.sourceforge.net/ b.单击图中红色标注图标 c.单击图中红色 ...

  8. APM的3DR无线数传的安装和调试

    APM飞控修改数传模块方法 http://www.cnblogs.com/wsine/p/4909903.html APM的3DR无线数传的安装和调试 http://tieba.baidu.com/p ...

  9. docker n2n安装与调试

    docker n2n安装与调试 yum install -y docker docker pull pahud/n2n-docker cd / 10 mkdir data 11 cd data 12 ...

随机推荐

  1. 思维体操: HDU1008 Elevator

    Elevator Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total S ...

  2. Text Autosizer&&解决移动端网页文本字体怪异增大问题

    在做移动端页面时,有时你设置了字体大小,有的部分即使设置了行内样式也不生效,而有些显示正常,这个特性就是Text Autosizer在搞鬼. 以下是解决方案: ①给元素设置 -webkit-text- ...

  3. 使用form表单提交请求如何获取后台返回的数据?

    问题描述 一般的form表单提交是单向的:只能给服务器发送数据,但是无法获取服务器返回的数据,也就是无法读取HTTP应答包. 想要真正的半双工通讯一般需要使用Ajax, 但是Ajax对文件传输也很麻烦 ...

  4. git基本命令和仓库操作

    首先git是什么?git是github上的一个代码托管工具,是一款代码版本管理工具,github上的代码是基于git来进行托管的.github是全球的开源社区.Git 保存的不是文件的变化或者差异,而 ...

  5. 流畅的Python (Fluent Python) —— 前言

    本书重点: 这本书并不是一本完备的 Python 使用手册,而是会强调 Python 作为编程语言独有的特性,这些特性或者是只有 Python 才具备的,或者是在其他大众语言里很少见的. Python ...

  6. Nginx和Apache 转发网络问题

    Linux 环境下,Apache 正常安装,httpd.conf也已正常配置,经测试80端口也已开通,但在外网测试时仍然是提示503错误.经过查资料和分析怀疑是SELinux的原因,于是查看果然是: ...

  7. django + celery的队列,路由与弹性

    #celery_app.py #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import ...

  8. At grand 022 GCD序列构造 dp/floyd二进制变换最少费用

    A diverse words指的是每一个字母在单词中出现的次数不超过1的单词 题目要求你求出字典序比当前给定单词大的字典序最小单词 1.如果给定的单词长度小于26 就遍历一次在单词尾部加上字典序最小 ...

  9. docker安装MySQL5.7示例!!坑

    docker  pull  mysql 一.错误的启动 [root@localhost  ~]#  docker  run  ‐‐name  mysql01  ‐d  mysql 42f0981990 ...

  10. Spring Boot 整合Spring Data JPA

    Spring Boot整合Spring Data JPA 1)加入依赖 <dependency> <groupId>org.springframework.boot</g ...