STM32_Programmer_CLI 使用笔记

环境部署

  1. 直接使用绝对路径,如 "D:\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe",这种方法可以在 PowerShell 或 cmd 直接使用。
  2. "D:\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin 添加到 系统环境变量 中,这种方法只有 PowerShell 可以使用,cmd 还是不可以。
image-20220615134109619

使用说明

STM32_Programmer_CLI 的指令参数有多种分类,包括适用于 STM32 MCUSTM32 MPUMCU安全烧录STM32WBxx 三个部分。

下面是这个软件的官方说明:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
      -------------------------------------------------------------------
STM32CubeProgrammer v2.9.0
-------------------------------------------------------------------


Usage :
STM32_Programmer_CLI.exe [command_1] [Arguments_1][[command_2] [Arguments_2]...]

Generic commands:

-?, -h, --help : Show this help
-c, --connect : Establish connection to the device
<port=<PortName> : Interface identifier. ex COM1, /dev/ttyS0, usb1,
JTAG, SWD...)
USB port optional parameters:
[sn=<serialNumber>] : Serial number of the usb dfu
[PID=<Product ID>] : Product ID. ex: 0xA38F, etc, default 0xDF11
[VID=<Vendor ID>] : Vendor ID. ex: 0x0389, etc, default x0483
UART port optional parameters:
[br=<baudrate>] : Baudrate. ex: 115200, 9600, etc, default 115200
[P=<parity>] : Parity bit, value in {NONE,ODD,EVEN}, default EVEN
[db=<data_bits>] : Data bit, value in {6, 7, 8} ..., default 8
[sb=<stop_bits>] : Stop bit, value in {1, 1.5, 2} ..., default 1
[fc=<flowControl>] : Flow control
Value in {OFF,Hardware,Software} ..., default OFF
rts=<status> : low or high
dtr=<status> : low or high
Not supported for STM32MP
[noinit=noinit_bit]: Set No Init bits, value in {0,1} ..., default 0
[console] : Enter UART console mode
JTAG/SWD debug port optional parameters:
[freq=<frequency>] : Frequency in KHz. Default frequencies:
4000 SWD 9000 JTAG with STLINKv2
24000 SWD 21333 with STLINKv3
[index=<index>] : Index of the debug probe. default index 0
[sn=<serialNumber>]: Serial Number of the debug probe
[ap=<accessPort>] : Access Port index to connect to. default ap 0
[mode=<mode>] : Connection mode. Value in {UR/HOTPLUG/NORMAL/POWERDOWN}
default mode: NORMAL
[reset=<mode>] : Reset modes: SWrst/HWrst/Crst. Default mode: SWrst
Reset mode with UR connection mode is HWrst
[shared] : Enable shared mode allowing connection of two or more
instances of STM32CubeProgrammer or other debugger
to the same ST-LINK probe.
[tcpport=<Port>] : Port used for running ST-Link Server, default 7184
[LPM] : Enable debug in Low Power mode(default mode)
[dLPM] : Disable debug in Low Power mode
[getAuthID] : Get device identification (Option only for STM32U5 series)
[speed=<Reliable/fast>]: Choose flashing Reliable/fast (Option only for STM32U5 series)
SPI port optional parameters:
[br=<baudrate>] : Baudrate.
[cpha=<cpha_val>] : 1Edge or 2Edge. default 1Edge
[cpol=<cpol_val>] : low or high
[crc=<crc_val>] : enable or disable (0/1).
[crcpol=<crc_pol>] : crc polynom value.
[datasize=<size>] : 8bit/16bit
[direction=<val>] : Direction: 2LFullDuplex/2LRxOnly/1LRx/1LTx
[firstbit=<val>] : First Bit: MSB/LSB
[frameformat=<val>]: Frame Format: Motorola/TI
[mode=<val>] : Mode: master/slave
[nss=<val>] : NSS: soft/hard
[nsspulse=<val>] : NSS pulse: Pulse/NoPulse
[delay=<val>] : Delay: Delay/NoDelay, delay of few microseconds
[noinit=noinit_bit]: Set No Init bits, value in {0,1} ..., default 0
CAN port optional parameters:
[br=<rbaudrate>] : Baudrate : 125, 250, 500, 1000 Kbps, default 125
[mode=<canmode>] : CAN Mode : NORMAL, LOOPBACK..., default NORMAL
[ide=<type>] : CAN Type : STANDARD or EXTENDED, default STANDARD
[rtr=<format>] : Frame Format: DATA or REMOTE, default DATA
[fifo=<afifo>] : Msg Receive : FIFO0 or FIFO1, default FIFO0
[fm=<fmode] : Filter Mode : MASK or LIST, default MASK
[fs=<fscale>] : Filter Scale: 16 or 32, default 32
[fe=<fenable>] : Filter Activation : ENABLE or DISABLE, default ENABLE
[fbn=<fbanknb>] : Filter Bank Number : 0 to 13, default 0
[noinit=noinit_bit]: Set No Init bits, value in {0,1} ..., default 0
I2C port optional parameters:
[add=<ownadd>] : Slave address : address in hex format
[br=<sbaudrate>] : Baudrate : 100 or 400 Kbps, default 400
[sm=<smode>] : Speed Mode : STANDARD or FAST, default FAST
[am=<addmode>] : Address Mode : 7 or 10 bits, default 7
[af=<afilter>] : Analog filter : ENABLE or DISABLE, default ENABLE
[df=<dfilter>] : Digital filter : ENABLE or DISABLE, default DISABLE
[dnf=<dnfilter>] : Digital noise filter : 0 to 15, default 0
[rt=<rtime>] : Rise time : 0-1000(STANDARD), 0-300(FAST), default 0
[ft=<ftime>] : Fall time : 0-300 (STANDARD), 0-300(FAST), default 0
[noinit=noinit_bit]: Set No Init bits, value in {0,1} ..., default 0
-version, --version : Displays the tool's version
-l, --list : List all available communication interfaces
<uart> : UART interface
<usb> : USB interface
<st-link> : st-link interface
-q, --quietMode : Enable quiet mode. No progress bar displayed
-log, --log : Store the detailed output in log file
[<file_Path.log>] : Path of the log file,
default path = $HOME/.STM32Programmer/trace.log
-vb, --verbosity : Specify verbosity level
<Level> : Verbosity level, value in {1, 2, 3}
-y, --yes : Ignore confirmation prompt message

Available commands for STM32 MCU:

--skipErase : Skip sector erase before programming
-sl, --safelib : Add a segment into a firmware file (elf,bin
hex,srec) containing computed CRC values
To use only with the safety lib component
<file_path> : File path to be modified
<start_address> : Flash memory start address
<end_address> : Flash memory end address
<slice_size> : Size of data per CRC value
-ms, --mergesbsfu : Add a binary header and a sbsfu segment to an elf file
<elf_file_path> : File path to be modified
<header_file_path> : Header file path
<sbsfu_file_path> : SBSFU file path
-e, --erase : Erase memory pages/sectors devices:
Not supported for STM32MP
[all] : Erase all sectors
[<sectorsCodes>] : Erase the specified sectors identified by sectors
codes. ex: 0, 1, 2 to erase sectors 0, 1 and 2
for EEPROM : ed1 & ed2
[<[start end]>] : Erase the specified sectors starting from
start code to end code, ex: -e [5 10]
-w, --write
-d, --download : Download the content of a file into device memory
<file_path> : File path name to be downloaded: (bin, hex, srec,
elf, stm32 or tsv file)
[<address>] : Start address of download
-w64 : Write a 64-bits data into device memory
<address> : Start address of download
<64-bit_data> : 64-bit data to be downloaded
values should not be separated by space
-w32 : Write a 32-bits data into device memory
<address> : Start address of download
<32-bit_data> : 32-bit data to be downloaded
values should be separated by space
-w16 : Write a 16-bits data into device memory
<address> : Start address of download
<16-bit_data> : 16-bit data to be downloaded
values should be separated by space
-w8 : Write a 8-bits data into device memory
<address> : Start address of download
<8-bit_data> : 8-bit data to be downloaded
values should be separated by space
-v, --verify : Verify if the programming operation is achieved
successfully
-r32 : Read a 32-bit data from device memory
<address> : Read start address
<size> : Size of data
-r16 : Read a 16-bit data from device memory
<address> : Read start address
<size> : Size of data
-r8 : Read a 8-bit data from device memory
<address> : Read start address
<size> : Size of data
-rst : Reset system
-hardRst : Hardware reset
Available only with JTAG/SWD debug port
-halt : Halt core
-run : Run core
-step : Step core
Available only with JTAG/SWD debug port
-score : Get core status
Available only with JTAG/SWD debug port
-coreReg : Read/Write core registers
[<core_register>] R0/../R15/PC/LR/PSP/MSP/XPSR/APSR/IPSR/EPSR/
PRIMASK/BASEPRI/FAULTMASK/CONTROL
[core_reg=<value>] value in case of write opration
Note: multiple registers can be handled at once
Available only with JTAG/SWD debug port
-bkpt : Set a breakpoint
<address> : Breakpoint address
-clrbkpt : Clear a breakpoint
<address> : Breakpoint address
-r, --read
-u, --upload : Upload the device memory content to a .bin/.hex/.srec file
<address> : Start address of read and upload
<size> : Size of memory content to be read
<file_path> : file path with .bin/.hex/.srec extension

-el, --extload : Select a custom external memory-loader for JTAG/SWD
<file_path> : External memory-loader file path
-elbl, --extloadbl : Select a custom external memory-loader for Bootloader interface (SFIx only)
<file_path> : External memory-loader file path
-s, --start
-g, --go : Run the code at the specified address.
[<address>] : Start address
-rdu, --readunprotect: Remove memory's Read Protection by shifting the RDP
level from level 1 to level 0.

-tzenreg, --tzenregression: Remove TrustZone Protection by disabling the TZEN
from 1 to 0.

-ob, --optionbytes : This command allows the user to manipulate the device
's OptionBytes by displaying or modifying them.
[displ] : This option allows the user to display the whole set
of Option Bytes.
[OptByte=<value>] : This option allows the user to program the given
Option Byte.

-lockRDP1 : Lock RDP level 1
<first_half> : First 32-bit of password
<second_half> : Second 32-bit of password
-unlockRDP1 : Unlock RDP level 1
<first_half> : First 32-bit of password
<second_half> : Second 32-bit of password
-lockRDP2 : Lock RDP level 2
<first_half> : First 32-bit of password
<second_half> : Second 32-bit of password
-unlockRDP2 : Unlock RDP level 2
<first_half> : First 32-bit of password
<second_half> : Second 32-bit of password
-ssigfoxc : Save the chip Certificate,
supported for STM32WL devices
<file_path> : Certificate file path

-wsigfoxc : Write the Sigfox credential,
supported for STM32WL devices
<file_path> : Certificate file path (binary, header)
<address> : start address for write

-fillmemory : Fill memory with the given pattern from the chosen address.
<start_address> : Start address for write. The address 0x08000000 is used by default
[size=<value>] : Size of the data to write
[pattern=<value>] : The pattern value to write.
[dataWidth=8|16|32]: The filling data size:
8 bits is selected by default.
-blankcheck : Verifies that the STM32 Flash memory is blank.
If the Flash memory is not blank, the first address with data is highlighted in a message.
Beta commands:

-regdump : Read and dump Core and MCU registers
<file_path.log> : Log file path
[choice=<number>] : Device number from the list of compatible devices (optional), this list
is displayed if the command is performed without this optional argument
-hf : Hard fault analyzer
Helps to identify system faults that occur when the CPU
is driven into a fault condition by the application code.

Available commands for STM32 MPU:

-c, --connect : Establish connection to the device
<port=<PortName> : Interface identifer. ex COM1, /dev/ttyS0, usb1)
USB port optional parameters:
[sn=<serialNum>] : Serial number of the usb dfu
[serial] : Activate USB serial Gadget for MPU devices
UART port optional parameters:
[br=<baudrate>] : Baudrate. ex: 115200, 9600, etc, default 115200
[P=<parity>] : Parity bit, value in {NONE,ODD,EVEN}, default NONE
[db=<data_bits>] : Data bit, value in {6, 7, 8} ..., default 8
[sb=<stop_bits>] : Stop bit, value in {1, 1.5, 2} ..., default 1
[fc=<flowControl>] : Flow control (Not yet supported for STM32MP)
Value in {OFF,Hardware,Software} ..., default OFF
[noinit=noinit_bit]: Set No Init bits, value in {0,1} ..., default 0
-s, --start
-g, --go : Run the code at the specified partition ID.
[<partitionID>] : Partition ID
If not specified, last loaded partition
will be started

[<startAdress>] : Start address
If not specified, last loaded segment address
[<noack>] : No acknowledgment required
If not specified, acknowledgment will be required

-detach : Send detach command to DFU

-wb : Write blob

<blob_file_path> : Blob file path
-pmic : Program PMIC NVM

<PMIC file_path> : PMIC file_path
-gc, --getcertificate : Get the chip Certificate,
supported for devices with security features
<file_path> : Certificate file path into which the chip
certificate will be uploaded

-p, --phaseID : Display the current partition ID to be loaded

-w, --write
-d, --download : Download the content of a file into device memory
<file_path> : File path name to be downloaded: (bin, stm32 file
<partition_id> : Partition ID to be downloaded
-rp, --readPart : Upload a memory partion ID content to a .bin file
<partionID> : Partion to be read
[<offset address>] : Offset address of read and upload
<size> : Size of partion content to be read
<file_path> : Binary file path

-ssp, --ssp : Program an SSP file
<ssp_file_path> : SSP file path to be programmed, bin or ssp extension
<ssp-fw-path> : SSP signed firmware path
[hsm=0|1] : Set user option for HSM use
value in {0 (do not use HSM), 1 (use HSM)}
Default value : hsm=0
<lic_path|slot=slotID> : Path to the license file (if hsm=0)
or reader slot ID if HSM is used (hsm=1)
-tm : Force timeout
<value> : Number of milliseconds
-rst : Reset USB device

OTP structure v1 commands (for STM32MP15xx):
-otp program : This command allows the user to program SAFMEM
memory by modifying the OTP words
[wordID=<value>] : This field contains the OTP word number
[value=<value>] : Loads value into the chosen OTP word
[sha_rsl=<value>] : Loads value into the corresponding shadow read
sticky lock bit
[sha_wsl=<value>] : Loads value into the corresponding shadow write
sticky lock bit
[sl=<value>] : Loads value into the corresponding programming sticky
lock bit
[pl=<value>] : Loads value into the corresponding programming perma-
nent lock bit

-otp displ : This command allows the user to display all or parts
of the OTP structure
[upper] : Displays the loaded upper OTP shadow registers
values and status
[lower] : Displays the loaded lower OTP shadow registers
values and status
[ctrl] : Displays the loaded BSEC control registers

OTP structure v2 commands (except STM32MP15xx):
-otp displ : This command allows the user to display all or parts
of the OTP structure
[word=<id>] : {Optional} display a specific OTP registers {values and status}
Up to 96 OTP words [0 to 95], id value in hex/dec format

-otp write : This command allows to fuse or update OTP words
Up to 96 OTP words [0 to 95] at the same command line
[lock] : {Optional} indicate the operation type, update or permanent lock
[word=<id>] : This field contains the OTP word number in hex/dec format
[value=<value>] : Value to be written in hex format

-otp lock : This command allows to fuse permanently OTP words
Up to 96 OTP words [0 to 95] at the same command line
[word=<id>] : This field contains the OTP word number in hex/dec format

-otp fwrite : This command allows to program a binary file
[lock] : {Optional} indicate the operation type, update or permanent lock
<bin_path> : Binary file path, 32-bits aligned
[word=<id>] : OTP word number in hex/dec format, start word of program

MCU Secure programming specific commands:

-sfi, --sfi : Program an sfi file
[<protocol=Ptype>] : Protocol type to be used : static/live
Only static protocol is supported so far
Default value static
<file_path> : Path of sfi file to be programmed
[hsm=0|1] : Set user option for HSM use
value in {0 (do not use HSM), 1 (use HSM)}
Default value : hsm=0
<lic_path|slot=slotID> : Path to the SFI license file (if hsm=0)
or reader slot ID if HSM is used (hsm=1)
[<licMod_path>|slot=slotID]: list of the integrated SMI license files paths
if HSM is not used (hsm=0)
Or readers slot IDs list if HSM is used (hsm=1)
Used only in combined case
the list order should correspond to
modules integration order within the SFI file

-smi, --smi : Program an smi file
<protocol=Ptype> : Protocol type to be used : static/live
Only static protocol is supported so far
Default value static
<file_path> : Path of smi file to be programmed
[hsm=0|1] : Set user option for HSM use
value in {0 (do not use HSM), 1 (use HSM)}
Default value : hsm=0
[<address>] : Destination address of the smi module
needed only for relocatable SMI
<lic_path|slot=slotID> : Path to the SMI license file (if hsm=0)
or reader slot ID if HSM is used (hsm=1)

-rsse, --rsse : Set the RSSe file path,
supported for devices with security extension
<file_path> : RSSe file path

-a, --abort : This command allows the user
to clean a not properly finished process.
The currently ongoing operation will stop
and the system will return to idle state

-dsecurity : Disable the security for STM32WL

-setdefaultob : Set default Option Bytes for STM32WL

-rssgetversion, --rssgetversion : get the version of RSS
HSM related commands:
-hsmgetinfo : Read the HSM available information
[slot=<SlotID>] : Slot ID of the Smart Card Reader
Default value: slot=1 (the PC integrated SC reader)
-hsmgetcounter : Read the current value of the license counter
[slot=<SlotID>] : Slot ID of the Smart Card Reader
Default value: slot=1 (the PC integrated SC reader)
-hsmgetfwid : Read the Firmware/Module Identifier
[slot=<SlotID>] : Slot ID of the Smart Card Reader
Default value: slot=1 (the PC integrated SC reader)
-hsmgetstatus : Read the current card life-cycle state
[slot=<SlotID>] : Slot ID of the Smart Card Reader
Default value: slot=1 (the PC integrated SC reader)
-hsmgetlicense : Get a license for the current chip
if counter is not null
<file_path> : File path into which the received license
will be stored
[slot=<SlotID>] : Slot ID of the Smart Card Reader
Default value: slot=1 (the PC integrated SC reader)
[protocol=<Ptype>] : Protocol type to be used : static/live
Only static protocol is supported so far
Default value static

-hsmgetlicensefromcertifbin, -hsmglfcb : Get a license for the input certificate
if counter is not null
<certif_file_path.bin> : Input certificate file path
<license_file_path.bin> : File path into which the received license
will be stored
[slot=<SlotID>] : Slot ID of the Smart Card Reader
Default value: slot=1 (the PC integrated SC reader)
[protocol=<Ptype>] : Protocol type to be used : static/live
Only static protocol is supported so far
Default value static

STM32WBxx specific commands:

-getuid64 : Read the device UID
-fusgetstate : Read the FUS state
-fusopgetversion : Read the FUS Operator version
-antirollback : Perform the antirollback operation (Only on Bootloader interface)
-startfus : Perform the startfus operation
Firmware Upgrade commands:
-fwdelete : Delete the BLE stack firmware
-fwupgrade : Upgrade the BLE stack firmware or the FUS firmware
<file_path> : New firmware image file path
<address> : Start address of download
[firstinstall=0|1] : 1 if it is a first install otherwise 0
optional, Default value: firstinstall=0
[startstack=0|1] : 1 to start the stack after the upgrade otherwise 0
optional, Default value: startstack=1
-autoupgrade : Automatically recognize the stack address and Upgrade the BLE stack firmware
<file_path> : New firmware image file path
-v : Verify if the download operation is achieved
successfully before starting upgrade
-startwirelessstack : Start the wireless stack
Key management commands:
-authkeyupdate : Authentication key update
<file_path> : New authentication key file path.
: This is the public key generated by
: STM32TrustedPackageCreator using -sign command.
-authkeylock : Authentication key lock
: Once locked, it's no longuer possible to change it
: using authkeyupdate command
-wusrkey : Write user key
<file_path> : User key file path
<keytype=1|2|3> : User key type, values : 1, 2 or 3.
: 1 = simple key, 2 = master key, 3 = encrypted key.
Serial Wire Viewer specific commands:

-swv : Printf via SWO
<freq=<frequency>> : System Clock in MHz
<portnumber=0-31|all> : ITM port number, values : 0-31, or all for All ports
[<file_Path.log>] : Path of the SWV log file (optional),
: default path = $USER_HOME/STMicroelectronics/STM32Programmer/SWV_Log/swv.log
-RA : Start the reception of swv automatically
-startswv : Printf via SWO & Start the reception of swv automatically
Script Manager command:

-script : Start the execution of Script File
<file_Path.prg> : Path of the script file (.prg)

查看设备列表

下面语句可以查看所有连接至PC端的设备。

1
STM32_Programmer_CLI -l
设备列表

详见:

1
2
3
4
-l,     --list         : List all available communication interfaces
<uart> : UART interface
<usb> : USB interface
<st-link> : st-link interface

设备连接

可以使用多种连接方式,将ST的从设备与PC上位机进行连接,包括 USB / UART / JTAG / SWD / SPI / CAN / I2C 。

使用指令 STM32_Programmer_CLI -c port=SWD 即可自动连接至设备。

设备自动连接

内容读取

使用指令 STM32_Programmer_CLI -c port=SWD -r32 0x08000000 0x400 可以从 地址 0x08000000 起,以 32bit 格式(-r32 )读取 0x400 byte 数据。

以32bit格式读取数据

-r32 可以更换成 -r16-r8

以16bit格式读取数据
以8bit格式读取数据

内容擦除

大面积擦除(Mass erase)所有内容,一般来说烧录的时候不会去擦除全部内容,这部分应该看情况。

1
STM32_Programmer_CLI -c port=SWD -e all
擦除全部内容

详见:

1
2
3
4
5
6
7
8
-e,     --erase        : Erase memory pages/sectors devices:
Not supported for STM32MP
[all] : Erase all sectors
[<sectorsCodes>] : Erase the specified sectors identified by sectors
codes. ex: 0, 1, 2 to erase sectors 0, 1 and 2
for EEPROM : ed1 & ed2
[<[start end]>] : Erase the specified sectors starting from
start code to end code, ex: -e [5 10]

下面两张图是烧录完某 .bin 文件后,flash内部结束尾部临界处的数据。交替烧录两个大小不易的 .bin 文件,可以观察到结尾处都是正常的,并没有出现异常。

临界处数据
image-20220615130543343

程序烧录

1
STM32_Programmer_CLI -c port=SWD -d "\\wsl.localhost\kali-linux\home\liewzheng\Workspace\stm32\20220511-galileo-manifest\out\mixosense_apps\data_collection_irq\data_collection_irq.bin" 0x00 -v
  • -d 是指 文件下载,后方接 文件路径 以及 起始地址 0x00 。这个起始地址应该是 0x08000000 还是 0x00 我也还没搞清楚。

  • -v 是指 代码验证。

image-20220615123114639

详见:

1
2
3
4
-d,     --download     : Download the content of a file into device memory
<file_path> : File path name to be downloaded: (bin, hex, srec,
elf, stm32 or tsv file)
[<address>] : Start address of download

设备复位和运行

1
2
STM32_Programmer_CLI -c port=SWD -hardRst
STM32_Programmer_CLI -c port=SWD -s
image-20220615124508137

报错

端口占用报错

image-20220615121045036