kopia lustrzana https://github.com/stlink-org/stlink
Merge branch 'develop' of https://github.com/texane/stlink into develop
commit
07ec1998c5
|
@ -19,13 +19,27 @@ On Windows users should ensure that the following software is installed:
|
||||||
Ensure that you add cmake to the $PATH system variable when following the instructions by the setup assistant.
|
Ensure that you add cmake to the $PATH system variable when following the instructions by the setup assistant.
|
||||||
4. Install
|
4. Install
|
||||||
- _EITHER_: **MinGW-w64** from <https://sourceforge.net/projects/mingw-w64> (mingw-w64-install.exe)<br />
|
- _EITHER_: **MinGW-w64** from <https://sourceforge.net/projects/mingw-w64> (mingw-w64-install.exe)<br />
|
||||||
- _OR_: **Visual Studio 2017 CE** (other versions will likely work as well, but are untested; the Community edition is free for open source
|
- _OR_: **MSVC toolchain** from Visual Studio Build Tools 2019
|
||||||
development)
|
|
||||||
5. Create a new destination folder at a place of your choice
|
5. Create a new destination folder at a place of your choice
|
||||||
6. Open the command-line (cmd.exe) and execute `cd C:\$Path-to-your-destination-folder$\`
|
6. Open the command-line (cmd.exe) and execute `cd C:\$Path-to-your-destination-folder$\`
|
||||||
7. Fetch the project sourcefiles by running `git clone https://github.com/stlink-org/stlink.git`from the command-line (cmd.exe)<br />
|
7. Fetch the project sourcefiles by running `git clone https://github.com/stlink-org/stlink.git`from the command-line (cmd.exe)<br />
|
||||||
or download the stlink zip-sourcefolder from the Release page on GitHub
|
or download the stlink zip-sourcefolder from the Release page on GitHub
|
||||||
|
|
||||||
|
#### MSVC toolchain - minimal installation
|
||||||
|
|
||||||
|
Visual Studio IDE is not necessary, only Windows SDK & build tools are required (~3,3GB).
|
||||||
|
|
||||||
|
1. Open <https://visualstudio.microsoft.com/downloads/>
|
||||||
|
2. Navigate through menus as follows (might change overtime)
|
||||||
|
|
||||||
|
`All downloads > Tools for Visual Studio 2019 > Build Tools for Visual Studio 2019 > Download`
|
||||||
|
3. Start downloaded executable. After Visual Studio Installer bootstraps and main window pops up, open `Individual Components` tab, and pick
|
||||||
|
- latest build tools (eg. `MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.25)`)
|
||||||
|
- latest Windows SDK (eg. `Windows 10 SDK (10.0.18362.0)`)
|
||||||
|
4. After installation finishes, you can press `Launch` button in Visual Studio Installer's main menu.
|
||||||
|
- Thus you can open `Developer Command Prompt for VS 2019`. It is `cmd.exe` instance with adjusted PATHs including eg. `msbuild`.
|
||||||
|
- Alternatively, you can use `Developer Powershell for VS 2019` which is the same thing for `powershell.exe`. Both are available from Start menu.
|
||||||
|
- Another option is to add `msbuild` to PATH manually. Its location should be `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin`. Then, it should be available from any `powershell.exe` or `cmd.exe` session.
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
#### MinGW-w64
|
#### MinGW-w64
|
||||||
|
@ -39,19 +53,32 @@ When installing different toolchains make sure to update the path in the `mingw6
|
||||||
This can be achieved by opening the .bat file with a common text editor.
|
This can be achieved by opening the .bat file with a common text editor.
|
||||||
|
|
||||||
|
|
||||||
#### Visual Studio (32 bit)
|
#### MSVC toolchain
|
||||||
|
|
||||||
1. In a command prompt, change the directory to the folder where the stlink files were cloned (or unzipped) to.
|
1. In a command prompt, change the directory to the folder where the stlink files were cloned (or unzipped) to.
|
||||||
2. Make sure the build folder exists (`mkdir build` if not).
|
2. Make sure the build folder exists (`mkdir build` if not).
|
||||||
3. From the build folder, run cmake (`cd build; cmake ..`).
|
3. From the build folder, run cmake (`cd build; cmake ..`).
|
||||||
|
|
||||||
This will create a solution (stlink.sln) in the build folder. Open it in Visual Studio, select the Solution Configuration (Debug or
|
This will create a solution file `stlink.sln` in the build folder.
|
||||||
Release) and build the solution normally (F7).
|
Now, you can build whole `stlink` suite using following command:
|
||||||
|
```
|
||||||
|
msbuild /m /p:Configuration=Release stlink.sln
|
||||||
|
```
|
||||||
|
Options:
|
||||||
|
- `/m` - compilation runs in parallel utilizing multiple cores
|
||||||
|
- `/p:Configuration=Release` - generates *Release*, optimized build.
|
||||||
|
|
||||||
NOTE:<br />
|
Directory `<project_root>\build\Release` contains final executables.
|
||||||
This solution will link to the dll version of libusb-1.0.y<br />
|
(`st-util.exe` is located in `<project_root>\build\src\gdbserver\Release`).
|
||||||
To debug or run the executable, the dll version of libusb-1.0 must be either on the path, or in the same folder as the executable.<br />
|
|
||||||
It can be copied from here: `build\3rdparty\libusb-1.0.21\MS32\dll\libusb-1.0.dll`.
|
**NOTE 1:**
|
||||||
|
|
||||||
|
Executables link against libusb.dll library. It has to be placed in the same directory as binaries or in PATH.
|
||||||
|
It can be copied from: `<project_root>\build\3rdparty\libusb-{version}\MS{arch}\dll\libusb-1.0.dll`.
|
||||||
|
|
||||||
|
**NOTE 2:**
|
||||||
|
|
||||||
|
[ST-LINK drivers](https://www.st.com/en/development-tools/stsw-link009.html) are required for `stlink` to work.
|
||||||
|
|
||||||
## Linux
|
## Linux
|
||||||
### Common requirements
|
### Common requirements
|
||||||
|
|
|
@ -81,11 +81,11 @@ extern "C" {
|
||||||
|
|
||||||
enum stlink_flash_type {
|
enum stlink_flash_type {
|
||||||
STLINK_FLASH_TYPE_UNKNOWN = 0,
|
STLINK_FLASH_TYPE_UNKNOWN = 0,
|
||||||
STLINK_FLASH_TYPE_F0,
|
STLINK_FLASH_TYPE_F0, /* used by f0, f1 (except f1xl),f3. */
|
||||||
STLINK_FLASH_TYPE_L0,
|
STLINK_FLASH_TYPE_F1_XL, /* f0 flash with dual bank, apparently */
|
||||||
STLINK_FLASH_TYPE_F4,
|
STLINK_FLASH_TYPE_F4, /* used by f2, f4, f7 */
|
||||||
STLINK_FLASH_TYPE_L4,
|
STLINK_FLASH_TYPE_L0, /* l0, l1 */
|
||||||
STLINK_FLASH_TYPE_F1_XL,
|
STLINK_FLASH_TYPE_L4, /* l4, l4+ */
|
||||||
STLINK_FLASH_TYPE_G0,
|
STLINK_FLASH_TYPE_G0,
|
||||||
STLINK_FLASH_TYPE_G4,
|
STLINK_FLASH_TYPE_G4,
|
||||||
STLINK_FLASH_TYPE_WB
|
STLINK_FLASH_TYPE_WB
|
||||||
|
|
|
@ -53,7 +53,9 @@ static const struct stlink_chipid_params devices[] = {
|
||||||
.flash_pagesize = 0x20000,
|
.flash_pagesize = 0x20000,
|
||||||
.sram_size = 0x20000,
|
.sram_size = 0x20000,
|
||||||
.bootrom_base = 0x1fff0000,
|
.bootrom_base = 0x1fff0000,
|
||||||
.bootrom_size = 0x7800
|
.bootrom_size = 0x7800,
|
||||||
|
.option_base = 0x1FFFC000,
|
||||||
|
.option_size = 4,
|
||||||
},
|
},
|
||||||
{ // PM0063
|
{ // PM0063
|
||||||
.chip_id = STLINK_CHIPID_STM32_F1_LOW,
|
.chip_id = STLINK_CHIPID_STM32_F1_LOW,
|
||||||
|
@ -218,7 +220,9 @@ static const struct stlink_chipid_params devices[] = {
|
||||||
.flash_pagesize = 0x20000,
|
.flash_pagesize = 0x20000,
|
||||||
.sram_size = 0x20000,
|
.sram_size = 0x20000,
|
||||||
.bootrom_base = 0x1fff0000,
|
.bootrom_base = 0x1fff0000,
|
||||||
.bootrom_size = 0x7800
|
.bootrom_size = 0x7800,
|
||||||
|
.option_base = 0x1FFFC000,
|
||||||
|
.option_size = 4,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// STM32F410 MCUs. Support based on DM00180366.pdf (RM0401) document.
|
// STM32F410 MCUs. Support based on DM00180366.pdf (RM0401) document.
|
||||||
|
|
906
src/common.c
906
src/common.c
Plik diff jest za duży
Load Diff
Ładowanie…
Reference in New Issue