JTAG篇(3)——Ubuntu OpenOCD communicating with FT2232H

本文档介绍了如何在Ubuntu 20.04系统上安装OpenOCD v0.10.0,并通过FT2232H适配器进行通信。首先,通过apt-get安装OpenOCD,然后查看其版本和安装路径。接着,通过lsusb或dmesg确认FT2232H已连接。最后,使用特定的OpenOCD配置文件启动OpenOCD,实现与FT2232H的交互,进行标准的LED点灯测试。
摘要由CSDN通过智能技术生成

Ubuntu OpenOCD communicating with FT2232H

dependencies

  1. ubuntu 系统 + 安装openocd
  2. OpenOCD User’s Guide

Installing OpenOCD on Ubuntu

注: 本次实验中使用的系统为ubuntu 20.04

  • ubuntu 20.04 安装 openocd version 0.10.0 (偷懒式安装) , 最新版本为version 0.11
$ sudo apt-get install openocd
  • 查看openocd安装版本以及安装路径
$ openocd -v
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.org/doc/doxygen/bugs.html

$ dpkg -S openocd
openocd: /usr/share/openocd/scripts/chip/st/stm32/stm32_rcc.tcl
openocd: /usr/share/openocd/scripts/target/test_syntax_error.cfg
openocd: /usr/share/doc/openocd/loaders/flash/fm4/Makefile
openocd: /usr/share/doc/openocd/loaders/flash/xmc1xxx/xmc1xxx.S
openocd: /usr/share/openocd/scripts/board/keil_mcb1700.cfg
openocd: /usr/share/openocd/scripts/target/lpc2148.cfg
openocd: /usr/share/openocd/scripts/target/kl25z_hla.cfg
openocd: /usr/share/openocd/scripts/target/fm4_s6e2cc.cfg
openocd: /usr/share/doc/openocd/loaders/watchdog/armv7m_kinetis_wdog.inc
openocd: /usr/share/openocd/scripts/target/at91sam3nXX.cfg
openocd: /usr/share/doc/openocd/loaders/flash/xmc1xxx/erase.inc
openocd: /usr/share/openocd/scripts/interface/ftdi/luminary-lm3s811.cfg
openocd: /usr/share/openocd/scripts/target/lpc4370.cfg
openocd: /usr/share/info/openocd.info-1.gz
openocd: /usr/share/openocd/scripts/board/ek-lm3s9b9x.cfg
openocd: /usr/share/openocd/scripts/cpu/arm/arm7tdmi.tcl
....
  • 连接FT2232H适配器,输入lsusb看到 ****Ltd FT2232C/D/H ****
$ lsusb 
Bus 001 Device 009: ID 0403:6010 Future Technology Devices International, Ltd FT2232C/D/H Dual UART/FIFO IC
  • 或连接FT2232H适配器,输入dmesg
$ dmesg
......
[82466.144555] usb 1-1: Detected FT2232H
[82466.164331] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
[82466.186438] ftdi_sio 1-1:1.1: FTDI USB Serial Device converter detected
[82466.186538] usb 1-1: Detected FT2232H
[82466.204076] usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB1
[82974.227511] ftdi_sio ttyUSB1: FTDI USB Serial Device converter now disconnected from ttyUSB1

Communicating with FT2232H

注: OpenOCD v0.11.0 与 OpenOCD v0.10.0由些许命令不一样会报错!!!!!!

标准冒烟测试——点灯:通过OpenOCD的配置文件点亮,FT2232H硬件板上的led灯。

在ubuntu终端输入,openocd -f openocd.cfg,即可点亮两颗LED(原理图见FT2232H入门)。

# openocd.cfg

interface ftdi
ftdi_vid_pid 0x0403 0x6010

# ftdi_channel 0 is port ADBUS, ftdi_channel 1 is port BDBUS.
ftdi_channel 1

# transport select transport_name
# Select which of the supported transports to use in this OpenOCD session
transport select jtag
adapter_khz 1000

# ftdi_layout_init data direction
# Specifies the initial values of the FTDI GPIO data and direction registers
ftdi_layout_init 0x00F8 0x00fb


ftdi_layout_signal nSRST -oe 0x0040
ftdi_layout_signal ntRST -oe 0x0010
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值