General fixes and improvements

- Bugfix: "Failed to parse flash type or unrecognized flash type"
(Closes #1240) (Closes #1242) (Closes #1290) (Closes #1291)
- Updated README.md on OS-support
- Updated version_support.md
- Removed remnants of macOS support in CMakeLists.txt
- Minor code formatting fixes
- Updated CHANGELOG.md
pull/1295/head
nightwalker-87 2022-12-30 18:01:06 +01:00
rodzic 194e6e9c6b
commit aee9a47e35
8 zmienionych plików z 134 dodań i 112 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
# v1.7.1
Release date: 2022-xx-xx
Release date: 2023-xx-xx
This release drops support for some older operating systems. Check project README for details.
@ -18,7 +18,7 @@ Features:
- Added option byte info for STM32F411XX ([#1141](https://github.com/stlink-org/stlink/pull/1141))
- Expanded and revised list of chips ([#1145](https://github.com/stlink-org/stlink/pull/1145), [#1164](https://github.com/stlink-org/stlink/pull/1164))
- [STM32H72X/3X]: Added full access to all device memory ([#1158](https://github.com/stlink-org/stlink/pull/1158), [#1159](https://github.com/stlink-org/stlink/pull/1159))
- Added support for STM32WLEx ([#1173](https://github.com/stlink-org/stlink/pull/1173))
- Added support for STM32WLEx ([#1173](https://github.com/stlink-org/stlink/pull/1173), [#1273](https://github.com/stlink-org/stlink/pull/1273))
- Added support for STLINK-V3 devices with no MSD ([#1185](https://github.com/stlink-org/stlink/pull/1185))
- Updated gdb-server.c to allow external memory access on STM32H73xx ([#1196](https://github.com/stlink-org/stlink/pull/1196), [#1197](https://github.com/stlink-org/stlink/pull/1197))
- Erase addr size / section of the flash memory with st-flash ([#1213](https://github.com/stlink-org/stlink/pull/1213))
@ -26,10 +26,12 @@ Features:
- Added parametres option_base, option_size for F401xD_xE ([#1235](https://github.com/stlink-org/stlink/pull/1235))
- Added support for option bytes to F1xx_XLD (GD32F30x) ([#1250](https://github.com/stlink-org/stlink/pull/1250))
- Added option byte address for L4Rx devices ([#1254](https://github.com/stlink-org/stlink/pull/1254))
- Added udev-rule rule for the STLink v3 MINIE programmer ([#1274](https://github.com/stlink-org/stlink/pull/1274), [#1281](https://github.com/stlink-org/stlink/pull/1281))
Updates & changes:
- [refactoring] Moved chip-specific parameters into separate files ([#237](https://github.com/stlink-org/stlink/pull/237), [#1129](https://github.com/stlink-org/stlink/pull/1129))
- [refactoring] General maintenance for code structure ([#903](https://github.com/stlink-org/stlink/pull/903), [#1090](https://github.com/stlink-org/stlink/pull/1090), [#1199](https://github.com/stlink-org/stlink/pull/1199), [#1212](https://github.com/stlink-org/stlink/pull/1212), [#1216](https://github.com/stlink-org/stlink/pull/1216))
- Added instructions for bug-reports and feature-requests to contribution guidelines ([#906](https://github.com/stlink-org/stlink/pull/906))
- Added travis CI configuration for macOS 10.14 to maintain capability for 32-bit compilation (commit [#f5ada94](https://github.com/stlink-org/stlink/commit/f5ada9474cdb87ff37de0d4eb9e75622b5870646))
- Updated description of chip id 0x0457 to L01x/L02x ([#1143](https://github.com/stlink-org/stlink/pull/1143), [#1144](https://github.com/stlink-org/stlink/pull/1144))
@ -45,6 +47,7 @@ Updates & changes:
- [doc] Linux Install from code Documentation improvement ([#1263](https://github.com/stlink-org/stlink/pull/1263), (commit [#43498de](https://github.com/stlink-org/stlink/commit/43498dedf651260ef34197e512d35e3ad7142401))
Fixes:
- cmake: Install shared libraries in proper directories ([#1098](https://github.com/stlink-org/stlink/pull/1098), [#1138](https://github.com/stlink-org/stlink/pull/1138), [#1154](https://github.com/stlink-org/stlink/pull/1154))
- cmake: Install shared libraries in proper directories ([#1142](https://github.com/stlink-org/stlink/pull/1142))
- Fixed clearance of the H7 dual bank flag ([#1146](https://github.com/stlink-org/stlink/pull/1146), [#1147](https://github.com/stlink-org/stlink/pull/1147))
- Fix for 'libusb_devices were leaked' when no ST-LINK programmer was found ([#1150](https://github.com/stlink-org/stlink/pull/1150))
@ -66,6 +69,10 @@ Fixes:
- Fixed compilation with gcc-12 ([#1257](https://github.com/stlink-org/stlink/pull/1257), [#1267](https://github.com/stlink-org/stlink/pull/1267))
- Fixed flash regs addr for STM32L152RET6 in common_flash.c ([#1265](https://github.com/stlink-org/stlink/pull/1265))
- Fixed flash, dbgmcu and rcc registers for STM32L1 ([#1266](https://github.com/stlink-org/stlink/pull/1266))
- Fixed compilation with gcc-12 ([#1257](https://github.com/stlink-org/stlink/pull/1257), [#1267](https://github.com/stlink-org/stlink/pull/1267))
- Fixes for project compilation ([#1270](https://github.com/stlink-org/stlink/pull/1270), [#1271](https://github.com/stlink-org/stlink/pull/1271), [#1283](https://github.com/stlink-org/stlink/pull/1283), [#1286](https://github.com/stlink-org/stlink/pull/1286),commit [#f93adb9](https://github.com/stlink-org/stlink/commit/f93adb92f2e4ecf05a9361cb723c98693586929d))
- [compilation] Corrected path to stlink/chips subdirectory ([#1276](https://github.com/stlink-org/stlink/pull/1276), [#1279](https://github.com/stlink-org/stlink/pull/1279))
- [compilation] Fixed GUI compilation failure on OpenBSD i386 ([#1284](https://github.com/stlink-org/stlink/pull/1284))
# v1.7.0
@ -96,7 +103,7 @@ Updates & changes:
- [doc] Updated documentation on target resetting ([#261](https://github.com/stlink-org/stlink/pull/261), [#533](https://github.com/stlink-org/stlink/pull/533), [#1107](https://github.com/stlink-org/stlink/pull/1107))
- [doc] Added note on `(gdb) run` command (commit [#03793d4](https://github.com/stlink-org/stlink/commit/03793d42b6078344a9ef8ad55f1d5d0fc19e486e), [#267](https://github.com/stlink-org/stlink/pull/267))
- [doc] `st-flash --reset` parameter (one solution for #356) ([#642](https://github.com/stlink-org/stlink/pull/642))
- [refactoring] General maintenance ([#864](https://github.com/stlink-org/stlink/pull/864), [#976](https://github.com/stlink-org/stlink/pull/976), [#978](https://github.com/stlink-org/stlink/pull/978))
- [refactoring] General maintenance ([#864](https://github.com/stlink-org/stlink/pull/864). [#978](https://github.com/stlink-org/stlink/pull/978))
- Imported debian pkg-settings ([#986](https://github.com/stlink-org/stlink/pull/986))
- Add support for FreeBSD's `libusb` reimplementation ([#992](https://github.com/stlink-org/stlink/pull/992), [#993](https://github.com/stlink-org/stlink/pull/993))
- [doc] Added explanation about STM32F103 fake chips (commit [#a66557a](https://github.com/stlink-org/stlink/commit/a66557a102d48e69feb0a9746e8e42c4baf31fe2), [#1024](https://github.com/stlink-org/stlink/pull/1024))
@ -117,7 +124,7 @@ Fixes:
- doc/man: Fixed installation directory ([#970](https://github.com/stlink-org/stlink/pull/970))
- Fixed installation path for desktop-file and icons ([#972](https://github.com/stlink-org/stlink/pull/972))
- Fix for static linking of `libssp` ([#973](https://github.com/stlink-org/stlink/pull/973), [#974](https://github.com/stlink-org/stlink/pull/974))
- [regression] Fixed wrong formatting for library install path ([#978](https://github.com/stlink-org/stlink/pull/978), [#1089](https://github.com/stlink-org/stlink/pull/1089))
- [regression] Fixed wrong formatting for library install path ([#978](https://github.com/stlink-org/stlink/pull/978), [#1089](https://github.com/stlink-org/stlink/pull/1089), [#1277](https://github.com/stlink-org/stlink/pull/1277))
- Fixed installation of header files needed for compiling with `libstlink.so.1.6.1` (commit [#31b1fa1](https://github.com/stlink-org/stlink/commit/31b1fa16201521e2aaf464576f2f169981abede0), [#982](https://github.com/stlink-org/stlink/pull/982))
- Fixed `connect under reset` for `st-flash` and `st-util` ([#983](https://github.com/stlink-org/stlink/pull/983))
- Fix for `mmap() size_t overflow` in `st-flash` ([#988](https://github.com/stlink-org/stlink/pull/988), [#989](https://github.com/stlink-org/stlink/pull/989))
@ -190,7 +197,7 @@ Updates & changes:
- [doc] `st-flash --flash=n[k][m]` command line option to override device model ([#902](https://github.com/stlink-org/stlink/pull/902))
- [refactoring] Improved cmake build process ([#912](https://github.com/stlink-org/stlink/pull/912))
- Set up a `libusb` log level accordingly to verbosity ([#894](https://github.com/stlink-org/stlink/pull/894)
- [compatibility] Updated `libusb` to v1.0.23 ([#895](https://github.com/stlink-org/stlink/pull/895, [#1089](https://github.com/stlink-org/stlink/pull/1089))
- [compatibility] Updated `libusb` to v1.0.23 ([#895](https://github.com/stlink-org/stlink/pull/895)
- Updated compiling doc & version support ([#896](https://github.com/stlink-org/stlink/pull/896), [#897](https://github.com/stlink-org/stlink/pull/897), [#899](https://github.com/stlink-org/stlink/pull/899))
- Version requirements & pkg-maintainer
- Fixed install paths in build script

Wyświetl plik

@ -78,13 +78,9 @@ include(GNUInstallDirs) # Define GNU standard installation directories
cmake_host_system_information(RESULT OS_NAME QUERY OS_NAME)
message(STATUS "Checking for OS_NAME: ${OS_NAME}")
if (OS_NAME STREQUAL "macOS")
message(STATUS "set(CMAKE_INSTALL_SHAREDIR /usr/local/share)")
set(CMAKE_INSTALL_SHAREDIR /usr/local/share/)
else ()
message(STATUS "set(CMAKE_INSTALL_SHAREDIR /usr/share)")
set(CMAKE_INSTALL_SHAREDIR /usr/share/)
endif ()
message(STATUS "set(CMAKE_INSTALL_SHAREDIR /usr/share)")
set(CMAKE_INSTALL_SHAREDIR /usr/share/)
## Set C build flags
if (NOT MSVC)

Wyświetl plik

@ -67,7 +67,7 @@ Please ensure to select the correct version for your system (i686 or x86_64). Th
Alternatively one may compile and install from source as described in our [compiling manual](doc/compiling.md#Windows).
**Linux**:
**Linux / Unix**:
We recommend to install `stlink-tools` from the package repository of the used distribution:
@ -78,13 +78,7 @@ We recommend to install `stlink-tools` from the package repository of the used d
- Arch Linux: [(Link)](https://www.archlinux.org/packages/community/x86_64/stlink)
- Alpine Linux: [(Link)](https://pkgs.alpinelinux.org/packages?name=stlink)
- Fedora: [(Link)](https://src.fedoraproject.org/rpms/stlink)
- Gentoo Linux: [(Link)](https://packages.gentoo.org/packages/dev-embedded/stlink)
**Other Operating Systems**:
- RedHat/CentOS 8: Users can install from [EPEL repository](https://src.fedoraproject.org/rpms/stlink/branch/epel8)
- FreeBSD: Users can install from [freshports](https://www.freshports.org/devel/stlink)
- MacOS: Users can open a terminal window and then follow the same procedure as for installing on Linux
## Installation from source (advanced users)

Wyświetl plik

@ -8,88 +8,94 @@ On Windows users should ensure that cmake **3.10.2** or any later version is ins
Up on compiling c-make will **automatically** download and install the latest compatible version of `libusb`.
- Windows 10
- Windows 8.1
- Windows 11
### Linux-/Unix-based:
| Operating System | libusb | cmake | libgtk-dev | Notes |
| ------------------------- | ------------------------------ | ---------- | ----------- | ------------------------ |
| Debian Sid | 1.0.24 | 3.22.1 | 3.24.31 | |
| Debian 11 (Bullseye) | 1.0.24 | 3.18.4 | 3.24.24 | |
| Debian 10 (Buster) | 1.0.**22** | **3.13.4** | 3.24.**5** | |
| | | | | |
| Ubuntu 20.04 LTS (Focal) | 1.0.23 | 3.16.3 | 3.24.**18** | |
| Ubuntu 18.04 LTS (Bionic) | 1.0.**21** | **3.10.2** | 3.**22.30** | End of Support: Apr 2023 |
| | | | | |
| Fedora Rawhide [x64] | 1.0.24 | 3.22.3 | 3.24.31 | |
| Fedora 35 [x64] | 1.0.24 | 3.21.3 | 3.24.30 | |
| Fedora 34 [x64] | 1.0.24 (`libusbx`) | 3.19.7 | 3.24.28 | |
| | | | | |
| openSUSE Tumbleweed [x64] | 1.0.24 | 3.22.1 | 3.24.31 | |
| openSUSE Leap 15.3 [x64] | 1.0.**21** | 3.17.0 | 3.24.20 | End of Support: Dec 2022 |
| | | | | |
| Alpine 3.15 | 1.0.24 | 3.21.3 | 3.24.30 | |
| Alpine 3.14 | 1.0.24 | 3.20.3 | 3.24.28 | |
| Alpine 3.13 | 1.0.24 | 3.18.4 | 3.24.23 | End of Support: Nov 2022 |
| Alpine 3.12 | 1.0.23 | 3.17.2 | 3.24.22 | End of Support: May 2022 |
| | | | | |
| FreeBSD 13.x | 1.0.**16-18** (API 0x01000102) | 3.22.1 | 3.24.31 | |
| FreeBSD 12.x | 1.0.**16-18** (API 0x01000102) | 3.22.1 | 3.24.31 | |
| | | | | |
| NetBSD 9.x | 1.0.24 | 3.21.2 | 3.24.30 | |
| NetBSD 8.x | 1.0.24 | 3.19.7 | 3.24.27 | |
| | | | | |
| CentOS 9 Stream [x64] | 1.0.24 (`libusbx`) | 3.20.3 | 3.24.30 | |
| CentOS 8 Stream [x64] | 1.0.23 (`libusbx`) | 3.20.2 | 3.**22.30** | |
| | | | | |
| ALT Linux Sisyphus | 1.0.24 | 3.22.1 | 3.24.31 | |
| ALT Linux P10 | 1.0.24 | 3.20.5 | 3.24.31 | |
| ALT Linux P9 | 1.0.**22** | 3.16.3 | 3.24.29 | |
| | | | | |
| OpenMandriva Rolling | 1.0.24 | 3.22.1 | 3.24.31 | |
| OpenMandriva Cooker | 1.0.24 | 3.22.1 | 3.24.31 | |
| OpenMandriva Lx 4.2 | 1.0.24 | 3.19.3 | 3.24.24 | |
| | | | | |
| Arch Linux | 1.0.24 | 3.22.1 | - | |
| KaOS [x64] | 1.0.24 | 3.22.1 | 3.24.31 | |
| Mageia Cauldron | 1.0.24 | 3.22.1 | 3.24.31 | |
| PCLinuxOS [x64] | ? | 3.22.1 | 3.24.31 | |
| Solus [x64] | 1.0.24 | 3.22.1 | 3.24.30 | |
| Void Linux | 1.0.24 | 3.22.1 | 3.24.31 | |
| Slackware Current | 1.0.24 | 3.21.4 | 3.24.31 | |
| AlmaLinux 8 | 1.0.23 (`libusbx`) | 3.20.2 | 3.**22.30** | |
| Rocky Linux 8 [x64] | 1.0.23 | 3.20.2 | 3.**22.30** | |
| Mageia 8 | 1.0.24 | 3.19.2 | 3.24.24 | End of Support: Aug 2022 |
| Adélie 1.0 | 1.0.23 | 3.16.4 | 3.24.23 | |
Maintained versions of:
- Debian
- Ubuntu
- Fedora
- openSUSE
- OpenMandriva
- Arch Linux
- FreeBSD
- NetBSD
Other Linux-/Unix-based Operating Systems:
| Operating System | libusb | cmake | libgtk-dev | Notes |
| ------------------------ | ------------------------------ | ---------- | ----------- | ------------------------ |
| Debian Sid | 1.0.24 | 3.22.1 | 3.24.31 | |
| Debian 11 (Bullseye) | 1.0.24 | 3.**18.4** | 3.24.24 | |
| Debian 10 (Buster) | 1.0.**22** | 3.**13.4** | 3.24.**5** | |
| | | | | |
| Ubuntu 20.04 LTS (Focal) | 1.0.23 | 3.**16.3** | 3.24.**18** | |
| | | | | |
| Alpine 3.15 | 1.0.24 | 3.21.3 | 3.24.30 | End of Support: Nov 2023 |
| Alpine 3.14 | 1.0.24 | 3.20.3 | 3.24.28 | End of Support: May 2023 |
| | | | | |
| FreeBSD 13.x | 1.0.**16-18** (API 0x01000102) | 3.22.1 | 3.24.31 | |
| FreeBSD 12.x | 1.0.**16-18** (API 0x01000102) | 3.22.1 | 3.24.31 | |
| | | | | |
| NetBSD 9.x | 1.0.24 | 3.21.2 | 3.24.30 | |
| NetBSD 8.x | 1.0.24 | 3.**19.7** | 3.24.27 | |
| | | | | |
| CentOS 9 Stream [x64] | 1.0.24 (`libusbx`) | 3.20.3 | 3.24.30 | |
| CentOS 8 Stream [x64] | 1.0.23 (`libusbx`) | 3.20.2 | 3.**22.30** | |
| | | | | |
| ALT Linux Sisyphus | 1.0.24 | 3.22.1 | 3.24.31 | |
| ALT Linux P10 | 1.0.24 | 3.20.5 | 3.24.31 | |
| ALT Linux P9 | 1.0.**22** | 3.**16.3** | 3.24.29 | |
| | | | | |
| OpenMandriva Rolling | 1.0.24 | 3.22.1 | 3.24.31 | |
| OpenMandriva Cooker | 1.0.24 | 3.22.1 | 3.24.31 | |
| OpenMandriva Lx 4.2 | 1.0.24 | 3.**19.3** | 3.24.24 | |
| | | | | |
| Arch Linux | 1.0.24 | 3.22.1 | - | |
| KaOS [x64] | 1.0.24 | 3.22.1 | 3.24.31 | |
| Mageia Cauldron | 1.0.24 | 3.22.1 | 3.24.31 | |
| PCLinuxOS [x64] | (?) | 3.22.1 | 3.24.31 | |
| Solus [x64] | 1.0.24 | 3.22.1 | 3.24.30 | |
| Void Linux | 1.0.24 | 3.22.1 | 3.24.31 | |
| Slackware Current | 1.0.24 | 3.21.4 | 3.24.31 | |
| AlmaLinux 8 | 1.0.23 (`libusbx`) | 3.20.2 | 3.**22.30** | |
| Rocky Linux 8 [x64] | 1.0.23 | 3.20.2 | 3.**22.30** | |
| Adélie 1.0 | 1.0.23 | 3.**16.4** | 3.24.23 | |
## Unsupported Operating Systems (as of Release v1.7.1)
Systems with highlighted versions remain compatible with this toolset.
| Operating System | libusb | cmake | End of<br />OS-Support |
| ------------------------ | ------------------------------ | ---------- | ---------------------- |
| CentOS 8 [x64] | 1.0.**23** (`libusbx`) | 3.**20.3** | Dec 2021 |
| Ubuntu 21.04 (Hirsute) | 1.0.**24** | 3.**18.4** | Jan 2022 |
| Fedora 33 [x64] | 1.0.**23** (`libusbx`) | 3.**18.3** | Nov 2021 |
| Fedora 32 [x64] | 1.0.**23** (`libusbx`) | 3.**17.0** | May 2021 |
| openSUSE Leap 15.2 [x64] | 1.0.**21** | 3.**17.0** | Dec 2021 |
| Ubuntu 20.10 (Groovy) | 1.0.**23** | 3.**16.3** | Jul 2021 |
| NetBSD 7.x | 1.0.**22** | 3.**16.1** | Jun 2020 |
| Alpine 3.11 | 1.0.**23** | 3.**15.5** | Nov 2021 |
| FreeBSD 11.x | 1.0.**16-18** (API 0x01000102) | 3.**15.5** | Sep 2021 |
| Alpine 3.10 | 1.0.**22** | 3.**14.5** | May 2021 |
| Fedora 31 [x64] | 1.0.**22**(`libusbx`) | 3.**14.5** | Nov 2020 |
| Mageia 7.1 | 1.0.**22** | 3.**14.3** | Jun 2021 |
| Fedora 30 | 1.0.**22**(`libusbx`) | 3.**14.2** | May 2020 |
| Ubuntu 19.10 (Eoan) | 1.0.**23** | 3.**13.4** | Jul 2020 |
| Alpine 3.9 | 1.0.**22** | 3.**13.0** | Jan 2021 |
| openSUSE Leap 15.1 [x64] | 1.0.**21** | 3.**10.2** | Jan 2021 |
| Debian 9 (Stretch) | 1.0.**21** | 3.7.2 | Jun 2022 |
| Slackware 14.2 | 1.0.20 | 3.5.2 | |
| OpenMandriva Lx 3.0x | 1.0.20 | 3.4.2 | |
| CentOS 7 [x64] | 1.0.**21** (`libusbx`) | 2.8.12.2 | Jun 2024 |
| Slackware 14.1 | 1.0.9 | 2.8.12 | |
| Slackware 14.0 | 1.0.9 | 2.8.8 | |
| Operating System | libusb | cmake | End of<br />OS-Support |
| ------------------------- | ------------------------------ | ---------- | ---------------------- |
| Fedora 35 [x64] | 1.0.**24** | 3.**21.3** | Dec 2022 |
| CentOS 8 [x64] | 1.0.**23** (`libusbx`) | 3.**20.3** | Dec 2021 |
| Fedora 34 [x64] | 1.0.**24** (`libusbx`) | 3.**19.7** | Jun 2022 |
| Mageia 8 | 1.0.**24** | 3.**19.2** | Aug 2022 |
| Alpine 3.13 | 1.0.**24** | 3.**18.4** | Nov 2022 |
| Ubuntu 21.04 (Hirsute) | 1.0.**24** | 3.**18.4** | Jan 2022 |
| Fedora 33 [x64] | 1.0.**23** (`libusbx`) | 3.**18.3** | Nov 2021 |
| Alpine 3.12 | 1.0.**23** | 3.**17.2** | May 2022 |
| openSUSE Leap 15.3 [x64] | 1.0.**21** | 3.**17.0** | Dec 2022 |
| Fedora 32 [x64] | 1.0.**23** (`libusbx`) | 3.**17.0** | May 2021 |
| openSUSE Leap 15.2 [x64] | 1.0.**21** | 3.**17.0** | Dec 2021 |
| Ubuntu 20.10 (Groovy) | 1.0.**23** | 3.**16.3** | Jul 2021 |
| NetBSD 7.x | 1.0.**22** | 3.**16.1** | Jun 2020 |
| Alpine 3.11 | 1.0.**23** | 3.**15.5** | Nov 2021 |
| FreeBSD 11.x | 1.0.**16-18** (API 0x01000102) | 3.**15.5** | Sep 2021 |
| Alpine 3.10 | 1.0.**22** | 3.**14.5** | May 2021 |
| Fedora 31 [x64] | 1.0.**22**(`libusbx`) | 3.**14.5** | Nov 2020 |
| Mageia 7.1 | 1.0.**22** | 3.**14.3** | Jun 2021 |
| Fedora 30 | 1.0.**22**(`libusbx`) | 3.**14.2** | May 2020 |
| Ubuntu 19.10 (Eoan) | 1.0.**23** | 3.**13.4** | Jul 2020 |
| Alpine 3.9 | 1.0.**22** | 3.**13.0** | Jan 2021 |
| Ubuntu 18.04 LTS (Bionic) | 1.0.**21** | 3.**10.2** | **Apr 2023** |
| openSUSE Leap 15.1 [x64] | 1.0.**21** | 3.**10.2** | Jan 2021 |
| Debian 9 (Stretch) | 1.0.21 | 3.7.2 | Jun 2022 |
| Slackware 14.2 | 1.0.20 | 3.5.2 | |
| OpenMandriva Lx 3.0x | 1.0.20 | 3.4.2 | |
| CentOS 7 [x64] | 1.0.21 (`libusbx`) | 2.8.12.2 | Jun 2024 |
_All other operating systems which are not listed are unsupported._

Wyświetl plik

@ -71,6 +71,7 @@ int main(int ac, char** av) {
if (sl->flash_type == STM32_FLASH_TYPE_UNKNOWN) {
printf("Failed to connect to target\n");
fprintf(stderr, "Failed to parse flash type or unrecognized flash type\n");
goto on_error;
}
@ -98,8 +99,10 @@ int main(int ac, char** av) {
goto on_error;
}
if (o.cmd == FLASH_CMD_WRITE) { // write
if (o.cmd == FLASH_CMD_WRITE) {
size_t size = 0;
// write
if (o.format == FLASH_FORMAT_IHEX) {
err = stlink_parse_ihex(o.filename, stlink_get_erased_pattern(sl), &mem, &size, &o.addr);
@ -108,8 +111,7 @@ int main(int ac, char** av) {
goto on_error;
}
}
if ((o.addr >= sl->flash_base) &&
(o.addr < sl->flash_base + sl->flash_size)) {
if ((o.addr >= sl->flash_base) && (o.addr < sl->flash_base + sl->flash_size)) {
if (o.format == FLASH_FORMAT_IHEX) {
err = stlink_mwrite_flash(sl, mem, (uint32_t)size, o.addr);
} else {
@ -120,8 +122,7 @@ int main(int ac, char** av) {
printf("stlink_fwrite_flash() == -1\n");
goto on_error;
}
} else if ((o.addr >= sl->sram_base) &&
(o.addr < sl->sram_base + sl->sram_size)) {
} else if ((o.addr >= sl->sram_base) && (o.addr < sl->sram_base + sl->sram_size)) {
if (o.format == FLASH_FORMAT_IHEX) {
err = stlink_mwrite_sram(sl, mem, (uint32_t)size, o.addr);
} else {
@ -132,8 +133,7 @@ int main(int ac, char** av) {
printf("stlink_fwrite_sram() == -1\n");
goto on_error;
}
} else if ((o.addr >= sl->option_base) &&
(o.addr < sl->option_base + sl->option_size)) {
} else if ((o.addr >= sl->option_base) && (o.addr < sl->option_base + sl->option_size)) {
err = stlink_fwrite_option_bytes(sl, o.filename, o.addr);
if (err == -1) {
@ -170,11 +170,11 @@ int main(int ac, char** av) {
goto on_error;
}
} else if (o.cmd == FLASH_CMD_ERASE) {
if (o.size > 0 && o.addr > 0)
if (o.size > 0 && o.addr > 0) {
err = stlink_erase_flash_section(sl, o.addr, o.size, false);
else
} else {
err = stlink_erase_flash_mass(sl);
}
if (err == -1) {
printf("stlink_erase_flash_mass() == -1\n");
goto on_error;
@ -184,7 +184,9 @@ int main(int ac, char** av) {
printf("Failed to reset device\n");
goto on_error;
}
} else { // read
} else {
// read
if ((o.area == FLASH_MAIN_MEMORY) || (o.area == FLASH_SYSTEM_MEMORY)) {
if ((o.size == 0) && (o.addr >= sl->flash_base) && (o.addr < sl->flash_base + sl->flash_size)) {
o.size = sl->flash_size;

Wyświetl plik

@ -171,8 +171,7 @@ bool parse_options(int argc, char **argv, st_settings_t *settings) {
settings->serial_number = NULL;
ugly_init(settings->logging_level);
while ((c = getopt_long(argc, argv, "hVv::c:ns:f", long_options,
&option_index)) != -1) {
while ((c = getopt_long(argc, argv, "hVv::c:ns:f", long_options, &option_index)) != -1) {
switch (c) {
case 'h':
settings->show_help = true;

Wyświetl plik

@ -67,20 +67,22 @@ void process_chipfile(char *fname) {
sscanf(buf, "%s %s", word, value);
if (strcmp (word, "dev_type") == 0) {
// ts->dev_type = strdup (value);
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
ts->dev_type = strdup(buf + nc);
} else if (strcmp(word, "ref_manual_id") == 0) {
// ts->ref_manual_id = strdup (value);
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
ts->ref_manual_id = strdup(buf + nc);
} else if (strcmp(word, "chip_id") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->chip_id) < 1) {
fprintf(stderr, "Failed to parse chip-id\n");
}
} else if (strcmp(word, "flash_type") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (strcmp(value, "F0_F1_F3") == 0) {
ts->flash_type = STM32_FLASH_TYPE_F0_F1_F3;
} else if (strcmp(value, "F1_XL") == 0) {
@ -105,37 +107,52 @@ void process_chipfile(char *fname) {
ts->flash_type = STM32_FLASH_TYPE_WB_WL;
} else {
ts->flash_type = STM32_FLASH_TYPE_UNKNOWN;
fprintf(stderr, "Failed to parse flash type or unrecognized flash type\n");
}
} else if (strcmp(word, "flash_size_reg") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->flash_size_reg) < 1) {
fprintf(stderr, "Failed to parse flash size reg\n");
}
} else if (strcmp(word, "flash_pagesize") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->flash_pagesize) < 1) {
fprintf(stderr, "Failed to parse flash page size\n");
}
} else if (strcmp(word, "sram_size") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->sram_size) < 1) {
fprintf(stderr, "Failed to parse SRAM size\n");
}
} else if (strcmp(word, "bootrom_base") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->bootrom_base) < 1) {
fprintf(stderr, "Failed to parse BootROM base\n");
}
} else if (strcmp(word, "bootrom_size") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->bootrom_size) < 1) {
fprintf(stderr, "Failed to parse BootROM size\n");
}
} else if (strcmp(word, "option_base") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->option_base) < 1) {
fprintf(stderr, "Failed to parse option base\n");
}
} else if (strcmp(word, "option_size") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
if (sscanf(value, "%i", &ts->option_size) < 1) {
fprintf(stderr, "Failed to parse option size\n");
}
} else if (strcmp(word, "flags") == 0) {
buf[strlen(buf) - 1] = 0; // chomp newline
sscanf(buf, "%*s %n", &nc);
p = strtok (buf, " \t\n");
while ((p = strtok (NULL, " \t\n"))) {
@ -153,8 +170,7 @@ void process_chipfile(char *fname) {
sscanf(value, "%x", &ts->flags);
} else {
fprintf(stderr, "Unknown keyword in %s: %s\n",
fname, word);
fprintf(stderr, "Unknown keyword in %s: %s\n", fname, word);
}
}
fclose(fp);
@ -164,6 +180,7 @@ void process_chipfile(char *fname) {
#if defined(STLINK_HAVE_DIRENT_H)
#include <dirent.h>
void init_chipids(char *dir_to_scan) {
DIR *d;
size_t nl; // namelen
@ -198,6 +215,7 @@ void init_chipids(char *dir_to_scan) {
#if defined(_WIN32) && !defined(STLINK_HAVE_DIRENT_H)
#include <fileapi.h>
#include <strsafe.h>
void init_chipids(char *dir_to_scan) {
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATAA ffd;

Wyświetl plik

@ -414,7 +414,7 @@ int stlink_status(stlink_t *sl) {
}
// 257
int stlink_version(stlink_t *sl) {
DLOG("*** looking up stlink version\n");
DLOG("*** looking up stlink version ***\n");
if (sl->backend->version(sl)) {
return (-1);