Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General fixes and improvements #1295

Merged
merged 8 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ labels: code/feature-request
In order to allow developers to isolate and target your respective issue, please take some time to select the check boxes below and fill out each of the following items appropriate to your specific request.

- [ ] Programmer/board type: [enter here] (e.g STLINK /V1, /V2, /V2-onboard, /V2-clone, /V3)
- [ ] Operating system an version: [enter here] (e.g Linux, macOS, Windows)
- [ ] Operating system an version: [enter here] (e.g Linux, Windows)
- [ ] **stlink tools version** and/or git commit hash: [enter here] (e.g v1.6.1/git-d0416149)
- [ ] stlink commandline tool name: [enter here] (e.g `st-info`, `st-flash`, `st-trace`, `st-util`)
- [ ] Target chip (and board, if applicable): [enter here] (e.g STM32F103C8T6 (NUCLEO-F103RB))
Expand Down
17 changes: 12 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -18,18 +18,20 @@ 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))
- Added writing and reading for STM32WL option bytes ([#1226](https://github.com/stlink-org/stlink/pull/1226), [#1227](https://github.com/stlink-org/stlink/pull/1227))
- 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))
Expand All @@ -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))
Expand All @@ -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

Expand Down Expand Up @@ -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))
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down
46 changes: 24 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,13 @@ include(${CMAKE_MODULE_PATH}/get_version.cmake) # Determine project version

include(GNUInstallDirs) # Define GNU standard installation directories

# Define install directory /usr/local/share [not /usr/share on MacOS]
# Define install directory /usr/local/share
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)
Expand Down Expand Up @@ -170,35 +166,41 @@ add_subdirectory(inc)
set(STLINK_HEADERS
inc/backend.h
inc/stlink.h
Nightwalker-87 marked this conversation as resolved.
Show resolved Hide resolved
src/common_flash.h
src/calculate.h
src/stlink-lib/commands.h
src/stlink-lib/libusb_settings.h
src/stlink-lib/reg.h
inc/stm32.h
inc/stm32flash.h
src/stlink-lib/calculate.h
src/stlink-lib/chipid.h
src/stlink-lib/commands.h
src/stlink-lib/common_flash.h
src/stlink-lib/common.h
src/stlink-lib/flash_loader.h
src/stlink-lib/flashloader.h
src/stlink-lib/helper.h
src/stlink-lib/libusb_settings.h
src/stlink-lib/logging.h
src/stlink-lib/map_file.h
src/stlink-lib/md5.h
src/stlink-lib/option_bytes.h
src/stlink-lib/reg.h
src/stlink-lib/sg.h
src/stlink-lib/usb.h
src/stlink-lib/helper.h
)

set(STLINK_SOURCE
src/read_write.c
src/common.c
src/option_bytes.c
src/common_flash.c
src/map_file.c
src/flashloader.c
src/calculate.c
src/stlink-lib/calculate.c
src/stlink-lib/chipid.c
src/stlink-lib/common_flash.c
src/stlink-lib/common.c
src/stlink-lib/flash_loader.c
src/stlink-lib/flashloader.c
src/stlink-lib/helper.c
src/stlink-lib/logging.c
src/stlink-lib/map_file.c
src/stlink-lib/md5.c
src/stlink-lib/option_bytes.c
src/stlink-lib/read_write.c
src/stlink-lib/sg.c
src/stlink-lib/usb.c
src/stlink-lib/helper.c
)

if (WIN32)
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -78,11 +78,6 @@ 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: **Support for macOS will end with v1.7.1.** Please use v1.7.0 (current ***master*** branch) and the related documentation instead.

Expand Down
2 changes: 1 addition & 1 deletion config/chips/L41x_L42x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dev_type STM32L41x_L42x
ref_manual_id 0394
chip_id 0x464 // STM32_CHIPID_L41x_L42x
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x800 // 2 KB
sram_size 0xa000 // 40 KB
Expand Down
2 changes: 1 addition & 1 deletion config/chips/L43x_L44x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dev_type STM32L41x_L42x
ref_manual_id 0392
chip_id 0x435 // STM32_CHIPID_L43x_L44x
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x800 // 2 KB
sram_size 0xc000 // 48 KB
Expand Down
2 changes: 1 addition & 1 deletion config/chips/L45x_L46x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dev_type STM32L45x_L46x
ref_manual_id 0394
chip_id 0x462 // STM32_CHIPID_L45x_L46x
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x800 // 2 KB
sram_size 0x20000 // 128 KB
Expand Down
2 changes: 1 addition & 1 deletion config/chips/L47x_L48x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dev_type STM32L47x_L48x
ref_manual_id 0351
chip_id 0x415 // STM32_CHIPID_L4
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x800 // 2 KB
sram_size 0x18000 // 96 KB
Expand Down
2 changes: 1 addition & 1 deletion config/chips/L496x_L4A6x.chip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dev_type STM32L496x_L4A6x
ref_manual_id 0351
chip_id 0x461 // STM32_CHIPID_L496x_L4A6x
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x800 // 2 KB
sram_size 0x50000 // 320 KB
Expand Down
10 changes: 5 additions & 5 deletions config/chips/L4Px.chip → config/chips/L4Px_L4Qx.chip
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Chip-ID file for STM32L4Px device
# Chip-ID file for STM32L4Px / STM32L4Qx device
#
dev_type STM32L4Px
dev_type STM32L4Px_L4Qx
ref_manual_id 0432
chip_id 0x471 // STM32_CHIPID_L4PX
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x1000 // 4 KB
sram_size 0xa0000 // 640 KB
bootrom_base 0x1fff0000
bootrom_size 0x7000 // 28 KB
option_base 0x0
option_size 0x0
option_base 0x1ff00000
option_size 0x4 // 4 B
flags swo
2 changes: 1 addition & 1 deletion config/chips/L4Rx.chip
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
dev_type STM32L4Rx
ref_manual_id 0432
chip_id 0x470 // STM32_CHIPID_L4RX
flash_type L4_L4P
flash_type L4
flash_size_reg 0x1fff75e0
flash_pagesize 0x1000 // 4 KB
sram_size 0xa0000 // 640 KB
Expand Down
15 changes: 0 additions & 15 deletions config/chips/L5x5.chip.txt

This file was deleted.

2 changes: 1 addition & 1 deletion doc/compiling.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compiling from sources

## Microsoft Windows (10, 8.1)
## Microsoft Windows (10, 11)

### Common Requirements

Expand Down
22 changes: 0 additions & 22 deletions doc/dev/app-example/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions doc/dev/app-example/README.md

This file was deleted.

28 changes: 0 additions & 28 deletions doc/dev/app-example/main.c

This file was deleted.

Loading