Difference between revisions of "J-Link STM32 Utility"
(→Parameter) |
|||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:Software Tools]] |
||
[[File:STM32Unlock.png | thumb | right | 600px | J-Link STM32 Unlock]] |
[[File:STM32Unlock.png | thumb | right | 600px | J-Link STM32 Unlock]] |
||
J-Link STM32 Unlock (JLinkSTM32.exe) is a free command line based tool which can be used with STM32 devices, to disable the hardware watchdog (activated by programming the option bytes). |
J-Link STM32 Unlock (JLinkSTM32.exe) is a free command line based tool which can be used with STM32 devices, to disable the hardware watchdog (activated by programming the option bytes). |
||
Additionally, on connect, it unsecures a read-protected STM32 device by re-programming the option bytes to factory defaults. |
Additionally, on connect, it unsecures a read-protected STM32 device by re-programming the option bytes to factory defaults. |
||
The J-Link STM32 Unlock utility is part of the [[J-Link Software and Documentation Pack]], which is available for download on the [https://www.segger.com/jlink-software.html SEGGER webpage]. |
The J-Link STM32 Unlock utility is part of the [[J-Link Software and Documentation Pack]], which is available for download on the [https://www.segger.com/jlink-software.html SEGGER webpage]. |
||
+ | {{Note|1=Unsecuring a secured device will cause a mass erase of the flash memory.}} |
||
− | |||
− | '''Note:''' Unsecuring a secured device will cause a mass erase of the flash memory. |
||
<div class="toclimit-3"> |
<div class="toclimit-3"> |
||
Line 11: | Line 11: | ||
<br clear=all> |
<br clear=all> |
||
− | = Command Line Options = |
+ | == Command Line Options == |
The following command line options can be passed to the J-Link STM32 Unlock utility. |
The following command line options can be passed to the J-Link STM32 Unlock utility. |
||
− | {| class=" |
+ | {| class="seggertable" |
|- |
|- |
||
! Command line option !! Explanation |
! Command line option !! Explanation |
||
Line 33: | Line 33: | ||
|} |
|} |
||
− | == -IP == |
+ | === -IP === |
Selects IP as host interface to connect to J-Link. |
Selects IP as host interface to connect to J-Link. |
||
Default host interface is USB. |
Default host interface is USB. |
||
− | === Syntax === |
+ | ==== Syntax ==== |
-IP <IPAddr> |
-IP <IPAddr> |
||
− | === Example === |
+ | ==== Example ==== |
JLinkSTM32.exe -IP 192.168.1.17 |
JLinkSTM32.exe -IP 192.168.1.17 |
||
− | === Additional information === |
+ | ==== Additional information ==== |
To select from a list of all available emulators on Ethernet, please use * as <IPAddr>. |
To select from a list of all available emulators on Ethernet, please use * as <IPAddr>. |
||
− | == -USB == |
+ | === -USB === |
Connect to a J-Link with a specific serial number via USB. |
Connect to a J-Link with a specific serial number via USB. |
||
Useful if multiple J-Links are connected to the same PC. |
Useful if multiple J-Links are connected to the same PC. |
||
− | === Syntax === |
+ | ==== Syntax ==== |
-USB <SerialNo> |
-USB <SerialNo> |
||
− | === Example === |
+ | ==== Example ==== |
JLinkSTM32.exe -USB 580011111 |
JLinkSTM32.exe -USB 580011111 |
||
− | == -Speed == |
+ | === -Speed === |
Starts J-Link STM32 Unlock Utility with a given initial speed. |
Starts J-Link STM32 Unlock Utility with a given initial speed. |
||
Available parameters are "adaptive", "auto" or a freely selectable integer value in kHz. |
Available parameters are "adaptive", "auto" or a freely selectable integer value in kHz. |
||
It is recommended to use either a fixed speed or, if it is available on the target, adaptive speeds. |
It is recommended to use either a fixed speed or, if it is available on the target, adaptive speeds. |
||
Default interface speed is 1000 kHz. |
Default interface speed is 1000 kHz. |
||
− | === Syntax === |
+ | ==== Syntax ==== |
-Speed <Speed_kHz> |
-Speed <Speed_kHz> |
||
− | === Example === |
+ | ==== Example ==== |
-Speed 1000 |
-Speed 1000 |
||
− | == -SetPowerTarget == |
+ | === -SetPowerTarget === |
The connected debug probe will power the target via pin 19 of the debug connector. |
The connected debug probe will power the target via pin 19 of the debug connector. |
||
− | === Syntax === |
+ | ==== Syntax ==== |
-SetPowerTarget <Mode> |
-SetPowerTarget <Mode> |
||
− | === Example === |
+ | ==== Example ==== |
JLinkSTM32.exe -SetPowerTarget 1 |
JLinkSTM32.exe -SetPowerTarget 1 |
||
− | == -SetDeviceFamily == |
+ | === -SetDeviceFamily === |
This command allows to specify a device family, so that no user input is required to start the unlocking process. |
This command allows to specify a device family, so that no user input is required to start the unlocking process. |
||
− | === Syntax === |
+ | ==== Syntax ==== |
-SetDeviceFamily <Parameter> |
-SetDeviceFamily <Parameter> |
||
− | === Parameter === |
+ | ==== Parameter ==== |
There are two different options to specify the device family to be used:<br> |
There are two different options to specify the device family to be used:<br> |
||
+ | <ol style="list-style-type:lower-alpha"> |
||
− | a) Pass the list index from the list which shows all supported families on start up<br> |
||
+ | <li>By passing the corresponding list index (ID) of the specific family.</li> |
||
− | b) Pass the defined device name |
||
+ | <li>By passing the corresponding device string of the specific family.</li> |
||
− | {| class="wikitable" |
||
+ | </ol> |
||
+ | {| class="seggertable" |
||
+ | ! ID !! Device string || Device family |
||
+ | |- |
||
+ | | style="text-align:right;" | 1 || <tt>STM32F0xxxx</tt> || STM32F0xxxx |
||
+ | |- |
||
+ | | style="text-align:right;" | 2 || <tt>STM32F1xxxx</tt> || STM32F1xxxx |
||
+ | |- |
||
+ | | style="text-align:right;" | 3 || <tt>STM32F2xxxx</tt> || STM32F2xxxx |
||
+ | |- |
||
+ | | style="text-align:right;" | 4 || <tt>STM32F3xxxx</tt> || STM32F3xxxx |
||
|- |
|- |
||
+ | | style="text-align:right;" | 5 || <tt>STM32F4xxxx</tt> || STM32F4xxxx |
||
− | ! ID !! Device |
||
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 6 || <tt>STM32F72xxx, STM32F73xxx</tt> || STM32F72xxx, STM32F73xxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 7 || <tt>STM32F74xxx, STM32F75xxx</tt> || STM32F74xxx, STM32F75xxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 8 || <tt>STM32F76xxx, STM32F77xxx</tt> || STM32F76xxx, STM32F77xxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 9 || <tt>STM32G0x0xx</tt> || STM32G0x0xx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 10 || <tt>STM32G0x1xx</tt> || STM32G0x1xx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 11 || <tt>STM32G4xxxx</tt> || STM32G4xxxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 12 || <tt>STM32H743_53_50</tt> || STM32H743, STM32H750, STM32H753 |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 13 || <tt>STM32H745_47_55_57</tt> || STM32H745, STM32H747, STM32H755, STM32H757 |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 14 || <tt>STM32L0xxxx</tt> || STM32L0xxxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 15 || <tt>STM32L1xxxx</tt> || STM32L1xxxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 16 || <tt>STM32L4xxxx</tt> || STM32L4xxxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 17 || <tt>STM32L5xxxx</tt> || STM32L5xxxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 18 || <tt>STM32U5xxxx</tt> || STM32U5xxxx |
|- |
|- |
||
− | | style="text-align:right;" | |
+ | | style="text-align:right;" | 19 || <tt>STM32WBxxxx</tt> || STM32WBxxxx |
|- |
|- |
||
+ | | style="text-align:right;" | 20 || <tt>STM32WLxxxx</tt> || STM32WLxxxx |
||
|} |
|} |
||
− | === Example === |
+ | ==== Example ==== |
JLinkSTM32.exe -SetDeviceFamily 10 // Selects STM32L1 series |
JLinkSTM32.exe -SetDeviceFamily 10 // Selects STM32L1 series |
||
JLinkSTM32.exe -SetDeviceFamily STM32F2xxxx // Selects STM32F2 series |
JLinkSTM32.exe -SetDeviceFamily STM32F2xxxx // Selects STM32F2 series |
||
− | == -Exit == |
+ | === -Exit === |
In general, the J-Link STM32 utility waits at the end of the unlock process for any user input before application closes. |
In general, the J-Link STM32 utility waits at the end of the unlock process for any user input before application closes. |
||
This option allows to skip this step, so that the utility closes automatically. |
This option allows to skip this step, so that the utility closes automatically. |
||
− | === Syntax === |
+ | ==== Syntax ==== |
-Exit <Mode> |
-Exit <Mode> |
||
− | === Example === |
+ | ==== Example ==== |
JLinkSTM32.exe -Exit 1 // J-Link STM32 utility closes automatically |
JLinkSTM32.exe -Exit 1 // J-Link STM32 utility closes automatically |
Latest revision as of 13:19, 16 May 2024
J-Link STM32 Unlock (JLinkSTM32.exe) is a free command line based tool which can be used with STM32 devices, to disable the hardware watchdog (activated by programming the option bytes). Additionally, on connect, it unsecures a read-protected STM32 device by re-programming the option bytes to factory defaults. The J-Link STM32 Unlock utility is part of the J-Link Software and Documentation Pack, which is available for download on the SEGGER webpage.
Unsecuring a secured device will cause a mass erase of the flash memory.
Contents
Command Line Options
The following command line options can be passed to the J-Link STM32 Unlock utility.
Command line option | Explanation |
---|---|
-IP | Selects IP as host interface to connect to J-Link. Default host interface is USB. |
-SelectEmuBySN | See -USB |
-USB | Connects to a J-Link with a specific S/N over USB |
-Speed | Starts the J-Link STM32 Unlock Utility with a given initial interface speed. |
-SetPowerTarget | Enables target power supply via pin 19. |
-SetDeviceFamily | Specifies a device family |
-Exit | J-Link STM32 Unlock will close automatically |
-IP
Selects IP as host interface to connect to J-Link. Default host interface is USB.
Syntax
-IP <IPAddr>
Example
JLinkSTM32.exe -IP 192.168.1.17
Additional information
To select from a list of all available emulators on Ethernet, please use * as <IPAddr>.
-USB
Connect to a J-Link with a specific serial number via USB. Useful if multiple J-Links are connected to the same PC.
Syntax
-USB <SerialNo>
Example
JLinkSTM32.exe -USB 580011111
-Speed
Starts J-Link STM32 Unlock Utility with a given initial speed. Available parameters are "adaptive", "auto" or a freely selectable integer value in kHz. It is recommended to use either a fixed speed or, if it is available on the target, adaptive speeds. Default interface speed is 1000 kHz.
Syntax
-Speed <Speed_kHz>
Example
-Speed 1000
-SetPowerTarget
The connected debug probe will power the target via pin 19 of the debug connector.
Syntax
-SetPowerTarget <Mode>
Example
JLinkSTM32.exe -SetPowerTarget 1
-SetDeviceFamily
This command allows to specify a device family, so that no user input is required to start the unlocking process.
Syntax
-SetDeviceFamily <Parameter>
Parameter
There are two different options to specify the device family to be used:
- By passing the corresponding list index (ID) of the specific family.
- By passing the corresponding device string of the specific family.
ID | Device string | Device family |
---|---|---|
1 | STM32F0xxxx | STM32F0xxxx |
2 | STM32F1xxxx | STM32F1xxxx |
3 | STM32F2xxxx | STM32F2xxxx |
4 | STM32F3xxxx | STM32F3xxxx |
5 | STM32F4xxxx | STM32F4xxxx |
6 | STM32F72xxx, STM32F73xxx | STM32F72xxx, STM32F73xxx |
7 | STM32F74xxx, STM32F75xxx | STM32F74xxx, STM32F75xxx |
8 | STM32F76xxx, STM32F77xxx | STM32F76xxx, STM32F77xxx |
9 | STM32G0x0xx | STM32G0x0xx |
10 | STM32G0x1xx | STM32G0x1xx |
11 | STM32G4xxxx | STM32G4xxxx |
12 | STM32H743_53_50 | STM32H743, STM32H750, STM32H753 |
13 | STM32H745_47_55_57 | STM32H745, STM32H747, STM32H755, STM32H757 |
14 | STM32L0xxxx | STM32L0xxxx |
15 | STM32L1xxxx | STM32L1xxxx |
16 | STM32L4xxxx | STM32L4xxxx |
17 | STM32L5xxxx | STM32L5xxxx |
18 | STM32U5xxxx | STM32U5xxxx |
19 | STM32WBxxxx | STM32WBxxxx |
20 | STM32WLxxxx | STM32WLxxxx |
Example
JLinkSTM32.exe -SetDeviceFamily 10 // Selects STM32L1 series JLinkSTM32.exe -SetDeviceFamily STM32F2xxxx // Selects STM32F2 series
-Exit
In general, the J-Link STM32 utility waits at the end of the unlock process for any user input before application closes. This option allows to skip this step, so that the utility closes automatically.
Syntax
-Exit <Mode>
Example
JLinkSTM32.exe -Exit 1 // J-Link STM32 utility closes automatically