Ubuntu下使用J-Link烧录.bin程序到STM32单片机

时间:2024-02-24 14:42:56

参考文章:(4条消息) ubuntu中使用jlink烧录stm32程序_allen0804_的博客-CSDN博客

在ubuntu下使用J-Link,首先需要先下载J-Link驱动,网址:https://www.segger.com/downloads/jlink/

我下载的是Linux 64bit DEB版本的。

 

 下载好后,直接双击运行.deb文件,系统会自动安装驱动;

安装好驱动后进入如下目录 cd /opt/SEGGER/JLink,运行./JLinkExe;

驱动运行起来以后进行如下操作即可:

gd@gd-virtual-machine:/opt/SEGGER/JLink$ ./JLinkExe              //运行J-Link驱动
SEGGER J-Link Commander V7.52c (Compiled Aug 10 2021 17:34:38)
DLL version V7.52c, compiled Aug 10 2021 17:34:21

Connecting to J-Link via USB...O.K.
Firmware: J-Link ARM-OB STM32 compiled Aug 22 2012 19:52:04
Hardware version: V7.00
S/N: 20090930
License(s): RDI,FlashDL,FlashBP,JFlash,GDBFull
VTref=3.300V


Type "connect" to establish a target connection, \'?\' for help
J-Link>connect                                //连接J-Link   
Please specify device / core. <Default>: STM32F103C8
Type \'?\' for selection dialog
Device>stm32f103c8                             //选择驱动
Please specify target interface:
J) JTAG (Default)
S) SWD
T) cJTAG
TIF>S                                   //选择模式
Specify target interface speed [kHz]. <Default>: 4000 kHz
Speed>4000                                //选择速度,默认值即可
Device "STM32F103C8" selected.


Connecting to target via SWD
InitTarget() start
InitTarget() end
Found SW-DP with ID 0x1BA01477
DPv0 detected
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x14770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x411FC231. Implementer code: 0x41 (ARM)
Found Cortex-M3 r1p1, Little endian.
FPUnit: 6 code (BP) slots and 2 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 001BB000 SCS
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 001BB002 DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB003 FPB
ROMTbl[0][3]: E0000000, CID: B105E00D, PID: 001BB001 ITM
ROMTbl[0][4]: E0040000, CID: B105900D, PID: 001BB923 TPIU-Lite
Cortex-M3 identified.
J-Link>loadbin /home/gd/Led.bin,0x8000000                //输入loadbin指令格式为loadbin <filename>,<addr>      (addr取值可参考MDK里面的默认设置)
Halting CPU for downloading file.
Downloading file [/home/gd/Led.bin]...
J-Link: Flash download: Bank 0 @ 0x08000000: Skipped. Contents already match
O.K.                                  //看到OK即为烧录成功
J-Link>