OpenOCD - Using JLink For ubuntu and Windows 7(Cygwin)

OpenOCD is an open-source project  aiming providing a online debugger, originating from a thesis.

for more information, please go to http://openocd.sourceforge.net/

you can compile yourself, thus you can know more and modify according to situation. 

Or you can download the complied one: windows version by Freddie Choplin

http://www.freddiechopin.info/en/download/category/4-openocd

Step 0: some preparations for windows 

Install cygwin and additional tools from the development package:

 

- autoconf: Wrapper scripts for autoconf commands 

- automake: Wrapper scripts for automake and aclocals 

- gcc: C compiler upgrade helper 

- libusb-win32: libusb-win32: USB programming library 

- make: The GNU version og the 'make' utility 

- subversion: A version control system 


Step1: install Jlink drivers

for Linux(ubuntu)

$./configure

if there is an error like   "cannot find usb.h"

you need to install libusb:

please refer to 

http://hi.baidu.com/cndx100/blog/item/2b933f19b6a8b265dbb4bdf7.html


for windows

(forcygwin, you need to use cygwin to install libusb)

because openocd talks to jlink via libusb, not the jlink.dll provided from segger.com

so you need to download the libusb-win32 driver to replace segger driver

http://cdnetworks-kr-2.dl.sourceforge.net/project/libusb-win32/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip

and run the inf-wizard.exe in its bin folder




and then installation comes to you, just go ahead.  or you can update your driver yourself.

you can check in the device manager, 


Step2  openocd installation

firstly, down OpenOCD files

http://sourceforge.net/projects/openocd/files/openocd/

$./configure --enable-jlink  //configure to situation, generate makefiles; for more configure options,you need to refer to the official documents.

 $./make 

.$/make install

 then you can test

$openocd -v 

Open On-ChipDebugger 0.5.0 (2012-04-02-02:11)

Licensed under GNUGPL v2

For bug reports,read

http://openocd.berlios.de/doc/doxygen/bugs.html


Step 3 OpenOCD Using JLink


For Ubuntu 

Platform :STM32F103VCT6 and Jlink

 

$~/Desktop/openocd-0.5.0$cd tcl

$~/Desktop/openocd-0.5.0/tcl$openocd -f interface/jlink.cfg -f target/stm32f1x.cfg

Open On-ChipDebugger 0.5.0 (2012-04-02-02:11)

Licensed under GNUGPL v2

For bug reports,read

http://openocd.berlios.de/doc/doxygen/bugs.html

Warn : Adapterdriver 'jlink' did not declare which transports it allows; assuming legacyJTAG-only

Info : only onetransport option; autoselect 'jtag'

1000 kHz

adapter_nsrst_delay:100

jtag_ntrst_delay:100

cortex_m3reset_config sysresetreq

Info : J-Linkinitialization started / target CPU reset initiated

Info : J-Link ARM V8compiled Dec  6 2011 18:57:44

Info : J-Link caps0xb9ff7bbf

Info : J-Link hwversion 80000

Info : J-Link hwtype J-Link

Info : J-Link maxmem block 9440

Info : J-Linkconfiguration

Info : USB-Address:0x0

Info : Kickstartpower on JTAG-pin 19: 0xffffffff

Info : Vref = 3.280TCK = 1 TDI = 0 TDO = 1 TMS = 0 SRST = 0 TRST = 0

Info : J-Link JTAGInterface ready

Info : clock speed1000 kHz

Info : JTAG tap:stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)

Info : JTAG tap:stm32.bs tap/device found: 0x06414041 (mfg: 0x020, part: 0x6414, ver: 0x0)


For Windows(Cygwin)

a exe file in the src folder is generated after make

type in cygwin 

$openocd -f interface/jlink.cfg -f target/stm32f1x.cfg

or cmd

c:\>openocd -f interface/jlink.cfg -f target/stm32f1x.cfg 

// openocd has been added to path in environmental variables and you 

//you need to copy cygwin.dll and cygusb0.dll to src folder.




### 回答1: openocd-20211118.7z是一个用于嵌入式系统开发的工具包。openocd是一个开源的(Open On-Chip Debugger)开发和调试工具,可以用于连接和调试各种嵌入式系统。这个包中的.7z文件是对openocd软件的最新版本20211118进行压缩的文件。 通过使用openocd,开发者可以通过调试接口(例如JTAG或SWD)与嵌入式芯片通信,对其进行调试和编程。它支持多种芯片架构,例如ARM、MIPS、RISC-V等,并且可以运行在多个操作系统上,如Windows、Linux和macOS。 这个.7z压缩文件包含了openocd软件的所有必要文件和资源,以方便用户进行安装和使用。用户可以通过解压这个文件,获取openocd软件的执行文件以及相关的配置文件、工具和示例代码。 通过openocd,开发者可以进行单步调试、断点设置、内存读写、寄存器查看等操作,还可以对芯片进行编程、烧录和擦除等操作。它提供了强大的调试功能,可以帮助开发者快速定位和解决嵌入式系统中的问题。 总而言之,openocd-20211118.7z是一个用于嵌入式系统开发和调试的工具包,通过解压这个文件,开发者可以获取最新版本的openocd软件及相关资源,方便进行嵌入式系统的调试和开发工作。 ### 回答2: openocd-20211118.7z是一个压缩文件,用于存储OpenOCD软件的安装包。OpenOCD是一款开源的调试和编程工具,主要用于与嵌入式系统中的调试器和处理器进行通信。它可以通过调试接口(如JTAG、SWD)与目标设备相连,并提供命令行工具和图形界面来进行调试操作。 openocd-20211118.7z文件包含了OpenOCD软件在2021年11月18日的版本。.7z是一种压缩文件格式,常用于压缩大型文件和文件夹。通过解压缩该文件,可以得到OpenOCD安装包的内容。 使用openocd-20211118.7z进行OpenOCD的安装可以通过以下步骤进行: 1. 首先,下载openocd-20211118.7z文件,并将其保存到本地计算机中。 2. 然后,使用压缩软件(如7-Zip、WinRAR等)将该文件解压缩到指定的目录。 3. 解压缩后,您将得到包含OpenOCD安装包的文件夹。 4. 进入该文件夹,根据您的操作系统选择正确的安装文件(如Windows、Linux等)。 5. 运行安装文件,并按照提示完成OpenOCD的安装过程。 6. 安装完成后,您可以在命令行终端或图形界面中运行OpenOCD,并与目标设备进行调试和编程操作。 总之,openocd-20211118.7z是OpenOCD软件2021年11月18日版本的安装包,通过解压缩和安装该文件,您可以使用OpenOCD进行嵌入式系统的调试和编程。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值