Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
nightwalker-87 a1fc8b70b1
Merge branch 'testing' into pollh 2024-02-18 19:12:55 +01:00
nightwalker-87 20c4ae1e0f Updated debian package config
- Switched to gbp workflow
- binary OSX blobs no longer included
- Install chips definitions in stlink-tools
- Updated symbols files for v1.8.0
- Updated changelog for v1.8.0-1 release
2024-02-16 15:34:37 +01:00
nightwalker-87 6a6718b334 Post release patch for v1.8.0
- Fixed terminal screen output (Closes #1363)
- Fixed compatibility with gcc-14 (Closes #1365)
- Updated contact info in CODE_OF_CONDUCT
- Updated man files & related install path
- Updated libusb to v1.0.27 for Windows builds
- Updated cmake_policy to CM0153 NEW
2024-02-16 14:55:41 +01:00
nightwalker-87 65f062fce5 Merge remote-tracking branch 'origin/develop' into testing 2024-02-04 22:59:57 +01:00
30 zmienionych plików z 170 dodań i 134 usunięć

1
.gitignore vendored
Wyświetl plik

@ -1,6 +1,7 @@
build
build-mingw-32
build-mingw-64
3rdparty
.project
.cmake/

Wyświetl plik

@ -3,7 +3,7 @@
###
cmake_minimum_required(VERSION 3.10.2)
cmake_policy(SET CMP0042 NEW)
cmake_policy(SET CMP0153 NEW)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@ -254,35 +254,22 @@ add_library(${STLINK_LIB_SHARED} SHARED ${STLINK_HEADERS} ${STLINK_SOURCE})
set(STLINK_SHARED_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
message(STATUS "STLINK_LIB_SHARED: ${STLINK_LIB_SHARED}")
message(STATUS "PROJECT_VERSION_MAJOR: ${PROJECT_VERSION_MAJOR}")
message(STATUS "VERSION: ${STLINK_SHARED_VERSION}")
set_target_properties(${STLINK_LIB_SHARED} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${STLINK_SHARED_VERSION}
OUTPUT_NAME ${PROJECT_NAME}
)
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${STLINK_SHARED_VERSION}
OUTPUT_NAME ${PROJECT_NAME}
)
# Link shared library
if (WIN32) # ... with Windows libraries
if (WIN32)
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB} wsock32 ws2_32)
else ()
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB})
endif()
install(TARGETS ${STLINK_LIB_SHARED}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Copy libusb DLL-library to binary output folder
if (WIN32)
file(COPY ${LIBUSB_WIN_OUTPUT_FOLDER}/MinGW64/dll/libusb-1.0.dll
DESTINATION ${CMAKE_INSTALL_BINDIR})
file(COPY ${LIBUSB_WIN_OUTPUT_FOLDER}/MinGW64/dll/libusb-1.0.dll
DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR})
endif()
install(TARGETS ${STLINK_LIB_SHARED} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
###
@ -300,17 +287,16 @@ add_library(${STLINK_LIB_STATIC} STATIC ${STLINK_HEADERS} ${STLINK_SOURCE})
set(STLINK_STATIC_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
message(STATUS "STLINK_LIB_STATIC: ${STLINK_LIB_STATIC}")
message(STATUS "PROJECT_VERSION_MAJOR: ${PROJECT_VERSION_MAJOR}")
message(STATUS "VERSION: ${STLINK_STATIC_VERSION}")
set_target_properties(${STLINK_LIB_STATIC} PROPERTIES
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${STLINK_STATIC_VERSION}
OUTPUT_NAME ${STLINK_LIB_STATIC_OUTPUT_NAME}
)
SOVERSION ${PROJECT_VERSION_MAJOR}
VERSION ${STLINK_STATIC_VERSION}
OUTPUT_NAME ${STLINK_LIB_STATIC_OUTPUT_NAME}
)
# Link static library
if (WIN32) # ... with Windows libraries
if (WIN32)
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB} wsock32 ws2_32)
else ()
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB})
@ -341,15 +327,15 @@ add_executable(st-util ${ST-UTIL_SOURCES})
add_executable(st-trace ${ST-TRACE_SOURCES})
if (WIN32)
target_link_libraries(st-flash ${STLINK_LIB_STATIC} ${SSP_LIB})
target_link_libraries(st-info ${STLINK_LIB_STATIC} ${SSP_LIB})
target_link_libraries(st-util ${STLINK_LIB_STATIC} ${SSP_LIB})
target_link_libraries(st-trace ${STLINK_LIB_STATIC} ${SSP_LIB})
target_link_libraries(st-flash ${STLINK_LIB_STATIC})
target_link_libraries(st-info ${STLINK_LIB_STATIC})
target_link_libraries(st-util ${STLINK_LIB_STATIC})
target_link_libraries(st-trace ${STLINK_LIB_STATIC})
else ()
target_link_libraries(st-flash ${STLINK_LIB_SHARED} ${SSP_LIB})
target_link_libraries(st-info ${STLINK_LIB_SHARED} ${SSP_LIB})
target_link_libraries(st-util ${STLINK_LIB_SHARED} ${SSP_LIB})
target_link_libraries(st-trace ${STLINK_LIB_SHARED} ${SSP_LIB})
target_link_libraries(st-flash ${STLINK_LIB_SHARED})
target_link_libraries(st-info ${STLINK_LIB_SHARED})
target_link_libraries(st-util ${STLINK_LIB_SHARED})
target_link_libraries(st-trace ${STLINK_LIB_SHARED})
endif()
install(TARGETS st-flash DESTINATION ${CMAKE_INSTALL_BINDIR})
@ -380,10 +366,10 @@ endif()
# MCU configuration files
if (WIN32)
set(CMAKE_CHIPS_DIR ${CMAKE_INSTALL_PREFIX}/config/chips)
set(CMAKE_CHIPS_DIR ${CMAKE_INSTALL_PREFIX}/config/chips)
else ()
set(CMAKE_CHIPS_DIR ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/chips)
endif ()
set(CMAKE_CHIPS_DIR ${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/config/chips)
endif()
add_definitions( -DSTLINK_CHIPS_DIR="${CMAKE_CHIPS_DIR}" )
file(GLOB CHIP_FILES ${CMAKE_SOURCE_DIR}/config/chips/*.chip)
install(FILES ${CHIP_FILES} DESTINATION ${CMAKE_CHIPS_DIR})
@ -396,6 +382,7 @@ add_subdirectory(src/stlink-gui) # contains subordinate CMakeLists to build GUI
add_subdirectory(tests) # contains subordinate CMakeLists to build test executables
add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages
###
# Uninstall target
###

Wyświetl plik

@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at texane@gmail.com. All
reported by contacting the project team [here](https://github.com/stlink-org/stlink/discussions). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.

Wyświetl plik

@ -10,41 +10,49 @@
include(FindPackageHandleStandardArgs)
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FreeBSD; libusb is integrated into the system
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FreeBSD; libusb is integrated into the system
# libusb header file
FIND_PATH(
LIBUSB_INCLUDE_DIR NAMES libusb.h
HINTS /usr/include
)
# libusb library
set(LIBUSB_NAME usb)
find_library(
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
HINTS /usr /usr/local /opt
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
if (NOT LIBUSB_FOUND)
message(FATAL_ERROR "Expected libusb library not found on your system! Verify your system integrity.")
endif()
elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") # OpenBSD; libusb-1.0 is available from ports
elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") # OpenBSD; libusb is available from ports
# libusb header file
FIND_PATH(
LIBUSB_INCLUDE_DIR NAMES libusb.h
HINTS /usr/local/include
PATH_SUFFIXES libusb-1.0
)
# libusb library
set(LIBUSB_NAME usb-1.0)
find_library(
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
HINTS /usr/local
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
if (NOT LIBUSB_FOUND)
message(FATAL_ERROR "No libusb-1.0 library found on your system! Install libusb-1.0 from ports or packages.")
endif()
elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-toolchain on Debian
# MinGW/MSYS/MSVC: 64-bit or 32-bit?
elseif (WIN32 OR (MINGW AND EXISTS "/etc/debian_version")) # Windows OR cross-build with MinGW-toolchain on Debian
# MinGW: 64-bit or 32-bit?
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
message(STATUS "=== Building for Windows (x86-64) ===")
set(ARCH 64)
@ -53,26 +61,20 @@ elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-to
set(ARCH 32)
endif()
if (WIN32 AND NOT EXISTS "/etc/debian_version") # Skip this for Debian...
if (NOT LIBUSB_FOUND)
# Preparations for installing libusb library
set(LIBUSB_WIN_VERSION 1.0.25) # set libusb version
set(LIBUSB_WIN_ARCHIVE libusb-${LIBUSB_WIN_VERSION}.7z)
if (WIN32 AND NOT EXISTS "/etc/debian_version") # ... on native Windows systems
set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_BINARY_DIR}/${LIBUSB_WIN_ARCHIVE})
set(LIBUSB_WIN_OUTPUT_FOLDER ${CMAKE_BINARY_DIR}/3rdparty/libusb-${LIBUSB_WIN_VERSION})
elseif (EXISTS "/etc/debian_version" AND MINGW) # ... only for cross-building on Debian
set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_SOURCE_DIR}/build-mingw-${ARCH}/${LIBUSB_WIN_ARCHIVE})
set(LIBUSB_WIN_OUTPUT_FOLDER ${CMAKE_SOURCE_DIR}/build-mingw-${ARCH}/3rdparty/libusb-${LIBUSB_WIN_VERSION})
endif()
set(LIBUSB_WIN_VERSION 1.0.27) # set libusb version
set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/libusb-${LIBUSB_WIN_VERSION}.7z)
set(LIBUSB_WIN_OUTPUT_FOLDER ${CMAKE_SOURCE_DIR}/3rdparty/libusb-${LIBUSB_WIN_VERSION})
# Get libusb package
if (EXISTS ${LIBUSB_WIN_ARCHIVE_PATH}) # ... should the package be already there (for whatever reason)
if (EXISTS ${LIBUSB_WIN_ARCHIVE_PATH}) # ... should the package be already there
message(STATUS "libusb archive already in build folder")
else () # ... download the package
message(STATUS "downloading libusb ${LIBUSB_WIN_VERSION}")
file(DOWNLOAD
https://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-${LIBUSB_WIN_VERSION}/libusb-${LIBUSB_WIN_VERSION}.7z/download
${LIBUSB_WIN_ARCHIVE_PATH} EXPECTED_MD5 aabe177bde869bfad34278335eaf8955
${LIBUSB_WIN_ARCHIVE_PATH} EXPECTED_MD5 c72153fc5a32f3b942427b0671897a1a
)
endif()
@ -84,7 +86,7 @@ elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-to
WORKING_DIRECTORY ${LIBUSB_WIN_OUTPUT_FOLDER}
)
# Find path to libusb library
# libusb header file
FIND_PATH(
LIBUSB_INCLUDE_DIR NAMES libusb.h
HINTS ${LIBUSB_WIN_OUTPUT_FOLDER}/include
@ -94,6 +96,7 @@ elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-to
)
if (MINGW OR MSYS)
# libusb library (static)
set(LIBUSB_NAME usb-1.0)
find_library(
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
@ -101,8 +104,8 @@ elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-to
NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
elseif (MSVC)
else (MSVC)
# libusb library
set(LIBUSB_NAME libusb-1.0.lib)
find_library(
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
@ -111,23 +114,28 @@ elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-to
NO_CMAKE_FIND_ROOT_PATH
)
endif()
message(STATUS "Missing libusb library has been installed")
endif()
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
else () # all other OS (unix-based)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
message(STATUS "Missing libusb library has been installed")
else () # all other OS (unix-based)
# libusb header file
FIND_PATH(
LIBUSB_INCLUDE_DIR NAMES libusb.h
HINTS /usr /usr/local /opt
HINTS /usr/include
PATH_SUFFIXES libusb-1.0
)
# libusb library
set(LIBUSB_NAME usb-1.0)
find_library(
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
HINTS /usr /usr/local /opt
HINTS /usr /usr/local
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
if (NOT LIBUSB_FOUND)

Wyświetl plik

@ -40,7 +40,7 @@ if (NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
add_cflag_if_supported("-Wredundant-decls")
endif()
if (NOT (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)))
if (NOT (WIN32 OR (MINGW AND EXISTS "/etc/debian_version")))
add_cflag_if_supported("-fPIC")
endif()

Wyświetl plik

@ -25,7 +25,7 @@ elseif (WIN32) # Wi
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-${TOOLCHAIN_PREFIX}")
set(CPACK_INSTALL_PREFIX "")
elseif (EXISTS "/etc/debian_version" AND NOT EXISTS WIN32) # Package-build is available on Debian/Ubuntu only
elseif (EXISTS "/etc/debian_version" AND (NOT EXISTS WIN32)) # Package-build on Debian/Ubuntu
message(STATUS "Debian-based Linux OS detected")
set(CPACK_GENERATOR "DEB;RPM") # RPM requires package `rpm`

Wyświetl plik

@ -2,4 +2,4 @@ add_subdirectory(deb)
add_subdirectory(rpm)
add_subdirectory(windows)
include(cpack_config.cmake)
include(${CMAKE_MODULE_PATH}/cpack_config.cmake)

Wyświetl plik

@ -7,10 +7,10 @@ string(REGEX REPLACE "\n" ";" files "${files}")
foreach (file ${files})
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
if (IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
exec_program("@CMAKE_COMMAND@"
ARGS "-E remove \"$ENV{DESTDIR}${file}\""
execute_process(
COMMAND "@CMAKE_COMMAND@" -E remove \"$ENV{DESTDIR}${file}\"
OUTPUT_VARIABLE rm_out
RETURN_VALUE rm_retval
RESULT_VARIABLE rm_retval
)
if (NOT "${rm_retval}" STREQUAL 0)
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")

10
debian/changelog vendored
Wyświetl plik

@ -1,3 +1,13 @@
stlink (1.8.0-1) unstable; urgency=medium
* Switch to gbp workflow, binary OSX blobs no longer included upstream
* Merge tag 'upstream/1.8.0' into debian
* Drop cross.patch, merged upstream
* Install chips definitions in stlink-tools
* Update symbols files for 1.8.0
-- Luca Boccassi <bluca@debian.org> Thu, 08 Feb 2024 19:28:19 +0000
stlink (1.7.0+ds-1) unstable; urgency=medium
* Merge tag 'v1.7.0' into debian. (Closes: #984356)

22
debian/control vendored
Wyświetl plik

@ -1,47 +1,43 @@
Source: stlink
Priority: optional
Maintainer: Luca Boccassi <bluca@debian.org>
Build-Depends: debhelper-compat (= 13), cmake (>= 3.4.2), libusb-1.0-0-dev, libgtk-3-dev
Standards-Version: 4.5.1
Build-Depends: debhelper-compat (= 13), cmake, libusb-1.0-0-dev, libgtk-3-dev, pkgconf, systemd-dev
Standards-Version: 4.6.2
Rules-Requires-Root: no
Section: electronics
Homepage: https://github.com/stlink-org/stlink
Vcs-Git: https://github.com/bluca/stlink.git -b debian
Vcs-Browser: https://github.com/bluca/stlink
Package: stlink-lib-dev
Package: libstlink-dev
Section: libdevel
Architecture: linux-any
Multi-Arch: same
Depends: stlink-lib (= ${binary:Version}), ${misc:Depends}
Replaces: libstlink-dev (<< 1.7.0+ds-1)
Breaks: libstlink-dev (<< 1.7.0+ds-1)
Depends: libstlink1 (= ${binary:Version}), ${misc:Depends}
Description: Open source version of the STMicroelectronics STLINK Tools
.
This package contains development files for stlink.
This package contains the development files for stlink.
Package: stlink-lib
Package: libstlink1
Section: libs
Architecture: linux-any
Multi-Arch: same
Depends: ${shlibs:Depends}, ${misc:Depends}
Replaces: libstlink1 (<< 1.7.0+ds-1)
Breaks: libstlink1 (<< 1.7.0+ds-1)
Description: Open source version of the STMicroelectronics STLINK Tools
.
This package contains the shared library for stlink.
Package: stlink-tools
Architecture: linux-any
Depends: stlink-lib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Depends: libstlink1 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Description: Open source version of the STMicroelectronics STLINK Tools
.
This package contains commandline utilities for stlink, as well as modprobe
This package contains commandline utilities for stlink, and modprobe
and udev rules.
Package: stlink-gui
Architecture: linux-any
Depends: stlink-lib (= ${binary:Version}), stlink-tools (= ${binary:Version}),
Depends: libstlink1 (= ${binary:Version}), stlink-tools (= ${binary:Version}),
${shlibs:Depends}, ${misc:Depends}
Description: Open source version of the STMicroelectronics STLINK Tools
.

3
debian/copyright vendored
Wyświetl plik

@ -2,9 +2,6 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: stlink
Upstream-Contact: Nightwalker-87 <15526941+Nightwalker-87@users.noreply.github.com>
Source: https://github.com/stlink-org/stlink
Comment: Upstream tarball has been repackaged to remove binary OSX kernel
drivers that are of unknown license and of no use to Debian.
Files-Excluded: stlinkv1_macos_driver
Files: *
Copyright: 2011-2021 The stlink project maintainers

11
debian/gbp.conf vendored
Wyświetl plik

@ -1,7 +1,12 @@
[buildpackage]
upstream-tag = %(version)s
[DEFAULT]
debian-branch = debian
upstream-branch = upstream
pristine-tar = True
sign-tags = True
[import-orig]
upstream-vcs-tag = v%(version)s
[dch]
git-log = --first-parent
customizations = /usr/share/doc/git-buildpackage/examples/wrap_cl.py
git-log = --first-parent

3
debian/rules vendored
Wyświetl plik

@ -10,12 +10,15 @@ include /usr/share/dpkg/default.mk
# see FEATURE AREAS in dpkg-buildflags(1)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export deb_udevdir = $(shell pkg-config --variable=udevdir udev | sed s,^/,,)
%:
dh $@ --buildsystem cmake
override_dh_auto_configure:
dh_auto_configure -- \
-DSTLINK_UDEV_RULES_DIR='/lib/udev/rules.d'
-DSTLINK_UDEV_RULES_DIR=/$(deb_udevdir)/rules.d
override_dh_auto_install:
dh_auto_install

Wyświetl plik

@ -1,4 +1,4 @@
stlink-lib.so.1 stlink-lib #MINVER#
libstlink.so.1 libstlink1 #MINVER#
Md5Calculate@Base 1.6.1
Md5Finalise@Base 1.6.1
Md5Initialise@Base 1.6.1
@ -62,13 +62,32 @@ stlink-lib.so.1 stlink-lib #MINVER#
calculate_F7_sectornum@Base 1.5.0
calculate_H7_sectornum@Base 1.7.0
calculate_L4_page@Base 1.5.0
check_file@Base 1.8.0
check_flash_error@Base 1.8.0
clear_flash_cr_pg@Base 1.8.0
clear_flash_error@Base 1.8.0
dump_a_chip@Base 1.8.0
get_stm32l0_flash_base@Base 1.8.0
init_chipids@Base 1.8.0
#MISSING: 1.7.0# is_bigendian@Base 1.5.0
is_flash_busy@Base 1.8.0
lock_flash@Base 1.8.0
lock_flash_option@Base 1.8.0
map_file@Base 1.8.0
md5_calculate@Base 1.8.0
process_chipfile@Base 1.8.0
read_flash_cr@Base 1.8.0
read_flash_sr@Base 1.8.0
read_uint16@Base 1.5.0
read_uint32@Base 1.5.0
send_recv@Base 1.5.0
send_usb_data_only@Base 1.5.0
send_usb_mass_storage_command@Base 1.5.0
stlink_calculate_pagesize@Base 1.5.0
stlink_check_address_alignment@Base 1.8.0
stlink_check_address_range_validity@Base 1.8.0
stlink_check_address_range_validity_otp@Base 1.8.0
stlink_checksum@Base 1.8.0
stlink_chip_id@Base 1.5.0
stlink_chipid_get_params@Base 1.5.0
stlink_close@Base 1.5.0
@ -80,6 +99,7 @@ stlink-lib.so.1 stlink-lib #MINVER#
stlink_enter_swd_mode@Base 1.5.0
stlink_erase_flash_mass@Base 1.5.0
stlink_erase_flash_page@Base 1.5.0
stlink_erase_flash_section@Base 1.8.0
stlink_exit_debug_mode@Base 1.5.0
stlink_exit_dfu_mode@Base 1.5.0
stlink_fcheck_flash@Base 1.5.0
@ -91,6 +111,7 @@ stlink-lib.so.1 stlink-lib #MINVER#
stlink_flashloader_write@Base 1.7.0
stlink_force_debug@Base 1.5.0
stlink_fread@Base 1.5.0
stlink_fwrite_finalize@Base 1.8.0
stlink_fwrite_flash@Base 1.5.0
stlink_fwrite_option_bytes@Base 1.6.0
#MISSING: 1.6.1# stlink_fwrite_option_bytes_32bit@Base 1.6.0
@ -112,20 +133,24 @@ stlink-lib.so.1 stlink-lib #MINVER#
stlink_read_debug32@Base 1.5.0
stlink_read_mem32@Base 1.5.0
stlink_read_option_bytes32@Base 1.6.1
stlink_read_option_bytes_Gx@Base 1.6.1
#MISSING: 1.8.0# stlink_read_option_bytes_Gx@Base 1.6.1
stlink_read_option_bytes_boot_add32@Base 1.7.0
stlink_read_option_bytes_boot_add_f7@Base 1.7.0
stlink_read_option_bytes_f2@Base 1.6.0
stlink_read_option_bytes_f4@Base 1.6.0
stlink_read_option_bytes_f7@Base 1.7.0
stlink_read_option_bytes_generic@Base 1.6.1
stlink_read_option_bytes_gx@Base 1.8.0
stlink_read_option_control_register1_32@Base 1.7.0
stlink_read_option_control_register1_f7@Base 1.7.0
stlink_read_option_control_register32@Base 1.7.0
stlink_read_option_control_register_Gx@Base 1.7.0
#MISSING: 1.8.0# stlink_read_option_control_register_Gx@Base 1.7.0
stlink_read_option_control_register_f0@Base 1.8.0
stlink_read_option_control_register_f2@Base 1.7.0
stlink_read_option_control_register_f4@Base 1.7.0
stlink_read_option_control_register_f7@Base 1.7.0
stlink_read_option_control_register_gx@Base 1.8.0
stlink_read_option_control_register_wb@Base 1.8.0
stlink_read_reg@Base 1.5.0
stlink_read_unsupported_reg@Base 1.5.0
stlink_reset@Base 1.5.0
@ -140,9 +165,9 @@ stlink-lib.so.1 stlink-lib #MINVER#
stlink_step@Base 1.5.0
stlink_target_connect@Base 1.7.0
stlink_target_voltage@Base 1.5.0
stlink_trace_disable@Base 1.7.0
stlink_trace_enable@Base 1.7.0
stlink_trace_read@Base 1.7.0
#MISSING: 1.8.0# stlink_trace_disable@Base 1.7.0
#MISSING: 1.8.0# stlink_trace_enable@Base 1.7.0
#MISSING: 1.8.0# stlink_trace_read@Base 1.7.0
stlink_v1_open@Base 1.5.0
stlink_v1_open_inner@Base 1.5.0
stlink_verify_write_flash@Base 1.5.0
@ -157,6 +182,7 @@ stlink-lib.so.1 stlink-lib #MINVER#
stlink_write_option_bytes_boot_add32@Base 1.7.0
stlink_write_option_control_register1_32@Base 1.7.0
stlink_write_option_control_register32@Base 1.7.0
stlink_write_otp@Base 1.8.0
stlink_write_reg@Base 1.5.0
stlink_write_unsupported_reg@Base 1.5.0
stm32l1_write_half_pages@Base 1.5.0
@ -164,6 +190,11 @@ stlink-lib.so.1 stlink-lib #MINVER#
ugly_init@Base 1.5.0
ugly_libusb_log_level@Base 1.6.1
ugly_log@Base 1.5.0
unlock_flash_if@Base 1.8.0
unlock_flash_option_if@Base 1.8.0
unmap_file@Base 1.8.0
wait_flash_busy@Base 1.8.0
write_buffer_to_sram@Base 1.5.0
write_flash_cr_psiz@Base 1.8.0
write_uint16@Base 1.5.0
write_uint32@Base 1.5.0
write_uint32@Base 1.5.0

Wyświetl plik

@ -1,3 +1,4 @@
/usr/bin/st-*
lib/udev/rules.d/*.rules
${env:deb_udevdir}/rules.d/*.rules
etc/modprobe.d/*.conf
usr/share/stlink/chips

2
debian/stlink.pc.in vendored
Wyświetl plik

@ -3,7 +3,7 @@ includedir=${prefix}/include/stlink
libdir=${prefix}/lib/@DEB_HOST_MULTIARCH@
Name: stlink
Description: Open source version of the STMicroelectronics STLINK Tools
Description: Open source version of the STMicroelectronics Stlink Tools
Version: @VERSION@
Requires: libusb-1.0
Libs: -L${libdir} -lstlink

4
debian/upstream/metadata vendored 100644
Wyświetl plik

@ -0,0 +1,4 @@
---
Bug-Database: https://github.com/stlink-org/stlink/issues
Bug-Submit: https://github.com/stlink-org/stlink/issues/new
Repository-Browse: https://github.com/stlink-org/stlink

2
debian/watch vendored
Wyświetl plik

@ -1,3 +1,3 @@
version=3
opts=dversionmangle=s/\+ds$//,repacksuffix=+ds,filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/stlink-$1\.tar\.gz/ \
opts=filenamemangle=s/.+\/v?(\d\S+)\.tar\.gz/stlink-$1\.tar\.gz/ \
https://github.com/stlink-org/stlink/tags .*/v?(\d\S+)\.tar\.gz

Wyświetl plik

@ -45,12 +45,7 @@ Options:
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:**
**NOTE:**
[ST-LINK drivers](https://www.st.com/en/development-tools/stsw-link009.html) are required for `stlink` to work.

Wyświetl plik

@ -2,7 +2,7 @@
# Generate manpages
###
set(MANPAGES st-util st-flash st-info)
set(MANPAGES st-info st-flash st-util)
# Only generate manpages with pandoc in Debug builds
if (${STLINK_GENERATE_MANPAGES})
@ -12,7 +12,7 @@ if (${STLINK_GENERATE_MANPAGES})
${manpage}.1
SOURCES ${manpage}.md
PANDOC_DIRECTIVES -s -t man
PRODUCT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
PRODUCT_DIRECTORY ${CMAKE_INSTALL_FULL_DATADIR}
)
endforeach ()
else ()
@ -21,16 +21,16 @@ endif()
# Install from output folder or this folder
foreach (manpage ${MANPAGES})
if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${manpage}.1)
set(f "${CMAKE_CURRENT_BINARY_DIR}/${manpage}.1")
elseif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1")
if (EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/${manpage}.1)
set(f "${CMAKE_INSTALL_FULL_DATADIR}/${manpage}.1")
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1)
set(f "${CMAKE_CURRENT_SOURCE_DIR}/${manpage}.1")
else()
else ()
message(AUTHOR_WARNING "Manpage ${manpage} not generated")
endif()
if (f AND NOT WIN32)
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1)
install(FILES ${f} DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/man/man1)
unset(f)
endif()
endforeach ()

Wyświetl plik

@ -1,6 +1,6 @@
% st-flash(1) Open Source STMicroelectronics Stlink Tools | stlink
% st-flash(1) Open source version of the STMicroelectronics STLINK Tools | stlink
%
% Feb 2018
% Feb 2023
# NAME

Wyświetl plik

@ -1,6 +1,6 @@
% st-flash(1) Open Source STMicroelectronics Stlink Tools | stlink
% st-flash(1) Open source version of the STMicroelectronics STLINK Tools | stlink
%
% Oct 2020
% Feb 2023
# NAME
st-info - Provides information about connected STLink and STM32 devices

Wyświetl plik

@ -1,6 +1,6 @@
% st-util(1) Open Source STMicroelectronics Stlink Tools | stlink
% st-util(1) Open source version of the STMicroelectronics STLINK Tools | stlink
%
% Feb 2018
% Feb 2023
# NAME

Wyświetl plik

@ -3,28 +3,26 @@
###
# Install this cross-compiler toolchain:
#sudo apt-get install mingw-w64
# sudo apt-get install mingw-w64
# x86_64
mkdir build-mingw-64
cd build-mingw-64
cmake -DCMAKE_SYSTEM_NAME=Windows \
-DTOOLCHAIN_PREFIX=x86_64-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=./../cmake/modules/set_toolchain.cmake ..
-DCMAKE_TOOLCHAIN_FILE=./cmake/modules/set_toolchain.cmake ..
make package
sudo cp dist/*.zip ../build/Release/dist
make clean
cd ..
rm -rf build-mingw-64
# i686
mkdir build-mingw-32
cd build-mingw-32
cmake -DCMAKE_SYSTEM_NAME=Windows \
-DTOOLCHAIN_PREFIX=i686-w64-mingw32 \
-DCMAKE_TOOLCHAIN_FILE=./../cmake/modules/set_toolchain.cmake ..
-DCMAKE_TOOLCHAIN_FILE=./cmake/modules/set_toolchain.cmake ..
make package
sudo cp dist/*.zip ../build/Release/dist
make clean
cd ..
rm -rf build-mingw-32

Wyświetl plik

@ -4,7 +4,7 @@ mkdir build-mingw
cd build-mingw
set PATH=C:\Program Files\CMake\bin;C:\mingw-w64\x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11-rev1\mingw64\bin;%PATH%
cmake -G "MinGW Makefiles" ..
mingw32-make
mingw32-make clean
mingw32-make install
mingw32-make package
cd ..

Wyświetl plik

@ -65,7 +65,7 @@ void process_chipfile(char *fname) {
return;
}
ts = calloc(sizeof(struct stlink_chipid_params), 1);
ts = calloc(1, sizeof(struct stlink_chipid_params));
while (fgets(buf, sizeof(buf), fp) != NULL) {

Wyświetl plik

@ -1223,7 +1223,7 @@ int32_t stlink_erase_flash_section(stlink_t *sl, stm32_addr_t base_addr, uint32_
return (-1);
}
fprintf(stdout, "-> Flash page at %#x erased (size: %#x)\r", addr, page_size);
fprintf(stdout, "-> Flash page at %#x erased (size: %#x)\n", addr, page_size);
fflush(stdout);
// check the next page is within the range to erase

Wyświetl plik

@ -471,7 +471,7 @@ int32_t stm32l1_write_half_pages(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
if (sl->verbose >= 1) {
// show progress; writing procedure is slow and previous errors are misleading
fprintf(stdout, "\r%3u/%3u halfpages written", count + 1, num_half_pages);
fprintf(stdout, "%3u/%3u halfpages written\n", count + 1, num_half_pages);
fflush(stdout);
}
@ -614,7 +614,7 @@ int32_t stlink_flashloader_start(stlink_t *sl, flash_loader_t *fl) {
int32_t voltage;
if (sl->version.stlink_v == 1) {
WLOG("STLINK V1 cannot read voltage, use default voltage 3.2V\n");
WLOG("STLINK V1 cannot read voltage, use default voltage 3.2 V\n");
voltage = 3200;
} else {
voltage = stlink_target_voltage(sl);
@ -758,7 +758,7 @@ int32_t stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
uint32_t data;
if ((off % sl->flash_pgsz) > (sl->flash_pgsz - 5)) {
fprintf(stdout, "\r%3u/%-3u pages written", (off / sl->flash_pgsz + 1), (len / sl->flash_pgsz));
fprintf(stdout, "%3u/%-3u pages written\n", (off / sl->flash_pgsz + 1), (len / sl->flash_pgsz));
fflush(stdout);
}
@ -780,7 +780,7 @@ int32_t stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
uint32_t flash_regs_base = get_stm32l0_flash_base(sl);
uint32_t pagesize = (flash_regs_base == FLASH_L0_REGS_ADDR)? L0_WRITE_BLOCK_SIZE : L1_WRITE_BLOCK_SIZE;
DLOG("Starting %3u page write\r\n", len / sl->flash_pgsz);
DLOG("Starting %3u page write\n", len / sl->flash_pgsz);
off = 0;
@ -797,7 +797,7 @@ int32_t stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
uint32_t data;
if ((off % sl->flash_pgsz) > (sl->flash_pgsz - 5)) {
fprintf(stdout, "\r%3u/%-3u pages written", (off / sl->flash_pgsz + 1), (len / sl->flash_pgsz));
fprintf(stdout, "%3u/%-3u pages written\n", (off / sl->flash_pgsz + 1), (len / sl->flash_pgsz));
fflush(stdout);
}
@ -834,7 +834,7 @@ int32_t stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
if (sl->verbose >= 1) {
// show progress; writing procedure is slow and previous errors are
// misleading
fprintf(stdout, "\r%3u/%-3u pages written", ++write_block_count,
fprintf(stdout, "%3u/%-3u pages written\n", ++write_block_count,
(len + sl->flash_pgsz - 1) / sl->flash_pgsz);
fflush(stdout);
}
@ -854,7 +854,7 @@ int32_t stlink_flashloader_write(stlink_t *sl, flash_loader_t *fl, stm32_addr_t
if (sl->verbose >= 1) {
// show progress
fprintf(stdout, "\r%u/%u bytes written", off, len);
fprintf(stdout, "%u/%u bytes written\n", off, len);
fflush(stdout);
}
}
@ -902,7 +902,7 @@ int32_t stlink_flashloader_stop(stlink_t *sl, flash_loader_t *fl) {
// enable interrupt
if (!stlink_read_debug32(sl, STLINK_REG_DHCSR, &dhcsr)) {
stlink_write_debug32(sl, STLINK_REG_DHCSR, STLINK_REG_DHCSR_DBGKEY | STLINK_REG_DHCSR_C_DEBUGEN |
(dhcsr & (~STLINK_REG_DHCSR_C_MASKINTS)));
(dhcsr & (~STLINK_REG_DHCSR_C_MASKINTS)));
}
// restore DMA state