Difference between revisions of "STLink"
(3 intermediate revisions by the same user not shown) | |||
Line 17: | Line 17: | ||
{{:Templateimpl:geninfo | initials=BS | title=STLink | desc=The following page can be used to get familiarized with STLink on EMAC products. | project=OE 5.0 }} | {{:Templateimpl:geninfo | initials=BS | title=STLink | desc=The following page can be used to get familiarized with STLink on EMAC products. | project=OE 5.0 }} | ||
=== Tools Required === | === Tools Required === | ||
+ | * STLink Programmer | ||
+ | * USB to MiniUSB cable | ||
+ | * JTAG cable for interfacing the STLink with the target board | ||
=== Setup === | === Setup === | ||
+ | * Plug in the USB side of the USB-to-miniUSB cable to your PC and the other side to the STLink programmer. | ||
+ | * Connect the STLink programmer and your target board with the JTAG cable. | ||
+ | * Ensure the target board has power. | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> | ||
<!-- /***************************************** Using/Working With ******************************************/ --> | <!-- /***************************************** Using/Working With ******************************************/ --> | ||
Line 38: | Line 44: | ||
5. In the upper left, click 'Target', then 'Program & Verify'. The following window should appear. Click 'Start'. | 5. In the upper left, click 'Target', then 'Program & Verify'. The following window should appear. Click 'Start'. | ||
[[File:STLinkProgram.PNG|800px|thumb|left|STLink Program]] | [[File:STLinkProgram.PNG|800px|thumb|left|STLink Program]] | ||
+ | <br clear=all> | ||
+ | |||
+ | 6. You should see the following message the programming was successful. | ||
+ | [[File:STLinkDone.PNG|800px|thumb|left|STLink Done]] | ||
<br clear=all> | <br clear=all> | ||
Line 44: | Line 54: | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> | ||
{{:Templateimpl:using | initials=BS | title=STLink on Linux | desc=The following page can be used to get familiarized with STLink on EMAC products. | project=OE 5.0 }} | {{:Templateimpl:using | initials=BS | title=STLink on Linux | desc=The following page can be used to get familiarized with STLink on EMAC products. | project=OE 5.0 }} | ||
+ | 1. Go to https://github.com/texane/stlink, clone the repository, and follow the instructions for installation. | ||
+ | |||
+ | 2. Once installed, you can simply open a terminal and issue the following commands: | ||
+ | * To erase the chip: | ||
+ | ** {{cli | username=developer | hostname=linux |st-flash erase }} | ||
+ | * To program board using a hex file: | ||
+ | ** {{cli | username=developer | hostname=linux |st-flash --format ihex write filename.hex}} | ||
+ | * To program a board using binary files: | ||
+ | ** {{cli | username=developer | hostname=linux |st-flash write firmware0.bin 0x08000000 }} | ||
+ | ** {{cli | username=developer | hostname=linux |st-flash --reset write firmware1.bin 0x08020000 }} | ||
<!-- /*********************************************************************************************************/ --> | <!-- /*********************************************************************************************************/ --> |
Latest revision as of 16:24, 29 May 2018
The STLink is a debugger and programmer for the STM8 and STM32 microcontroller families.
Contents
General Information
Tools Required
- STLink Programmer
- USB to MiniUSB cable
- JTAG cable for interfacing the STLink with the target board
Setup
- Plug in the USB side of the USB-to-miniUSB cable to your PC and the other side to the STLink programmer.
- Connect the STLink programmer and your target board with the JTAG cable.
- Ensure the target board has power.
STLink on Windows
1 Start by downloading the STLink utility software here: http://www.st.com/en/development-tools/stsw-link004.html
2 Open the STLink Utility
3 Click on the 'Binary File' tab in the upper left. A file browser should appear. Navigate to the directory that contains the binary file you plan to use and click 'Open'
4 [Optional] Before programming the unit, it is recommended to erase the chip. In the upper left, click 'Target' and then click 'Erase Chip'. You should see the following message if it completes successfully.
5. In the upper left, click 'Target', then 'Program & Verify'. The following window should appear. Click 'Start'.
6. You should see the following message the programming was successful.
STLink on Linux
1. Go to https://github.com/texane/stlink, clone the repository, and follow the instructions for installation.
2. Once installed, you can simply open a terminal and issue the following commands:
- To erase the chip:
developer
@
linux
:
~
#
st-flash erase
- To program board using a hex file:
developer
@
linux
:
~
#
st-flash --format ihex write filename.hex
- To program a board using binary files:
developer
@
linux
:
~
#
st-flash write firmware0.bin 0x08000000
developer
@
linux
:
~
#
st-flash --reset write firmware1.bin 0x08020000