Merge branch 'develop' of https://github.com/texane/stlink into develop

pull/960/head
Oleksiy Slyshyk 2020-04-22 13:11:53 +03:00
commit 07ec1998c5
4 zmienionych plików z 471 dodań i 498 usunięć

Wyświetl plik

@ -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.
4. Install
- _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
development)
- _OR_: **MSVC toolchain** from Visual Studio Build Tools 2019
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$\`
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
#### 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
#### 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.
#### 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.
2. Make sure the build folder exists (`mkdir build` if not).
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
Release) and build the solution normally (F7).
This will create a solution file `stlink.sln` in the build folder.
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 />
This solution will link to the dll version of libusb-1.0.y<br />
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`.
Directory `<project_root>\build\Release` contains final executables.
(`st-util.exe` is located in `<project_root>\build\src\gdbserver\Release`).
**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
### Common requirements

Wyświetl plik

@ -81,11 +81,11 @@ extern "C" {
enum stlink_flash_type {
STLINK_FLASH_TYPE_UNKNOWN = 0,
STLINK_FLASH_TYPE_F0,
STLINK_FLASH_TYPE_L0,
STLINK_FLASH_TYPE_F4,
STLINK_FLASH_TYPE_L4,
STLINK_FLASH_TYPE_F1_XL,
STLINK_FLASH_TYPE_F0, /* used by f0, f1 (except f1xl),f3. */
STLINK_FLASH_TYPE_F1_XL, /* f0 flash with dual bank, apparently */
STLINK_FLASH_TYPE_F4, /* used by f2, f4, f7 */
STLINK_FLASH_TYPE_L0, /* l0, l1 */
STLINK_FLASH_TYPE_L4, /* l4, l4+ */
STLINK_FLASH_TYPE_G0,
STLINK_FLASH_TYPE_G4,
STLINK_FLASH_TYPE_WB

Wyświetl plik

@ -53,7 +53,9 @@ static const struct stlink_chipid_params devices[] = {
.flash_pagesize = 0x20000,
.sram_size = 0x20000,
.bootrom_base = 0x1fff0000,
.bootrom_size = 0x7800
.bootrom_size = 0x7800,
.option_base = 0x1FFFC000,
.option_size = 4,
},
{ // PM0063
.chip_id = STLINK_CHIPID_STM32_F1_LOW,
@ -218,7 +220,9 @@ static const struct stlink_chipid_params devices[] = {
.flash_pagesize = 0x20000,
.sram_size = 0x20000,
.bootrom_base = 0x1fff0000,
.bootrom_size = 0x7800
.bootrom_size = 0x7800,
.option_base = 0x1FFFC000,
.option_size = 4,
},
{
// STM32F410 MCUs. Support based on DM00180366.pdf (RM0401) document.

Plik diff jest za duży Load Diff