Jetson平台使用Jlink给stm32下载程序

为了方便想用jetson nano来给stm32下载程序。网上的ubuntu使用SEGGER官网驱动的方式在jetson的平台好像并不适用,因此使用了openocd来作为程序下载工具。

sudo apt-get install openocd

发现可以直接使用该指令进行安装,不用网上说的繁琐步骤。

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

使用该条指令之后报错如下

Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: stm32f1x.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Error: Invalid ACK (7) in DAP response
Error: JTAG-DP STICKY ERROR
Error: Could not initialize the debug port

看了一下,这是因为默认是JTAG,因为我使用的为JlinkOB,是SWD的,因此需要额外如下步骤

cd /usr/share/openocd/scripts/interface
sudo cp jlink.cfg jlink_swd.cfg
sudo vi jlink_swd.cfg

在里面添加一行

# http://www.segger.com/jlink.html
#

interface jlink
transport select swd
# The serial number can be used to select a specific device in case more than

保存退出。

openocd -f /interface/jlink——swd.cfg  -f /target/stm32f1x.cfg

看到

Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints

这样一行,证明可以开始调试了。

参考:https://blog.csdn.net/zjx923759789/article/details/84335178

烧写文件参考:https://blog.csdn.net/SMarxX/article/details/8486052

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值