161.7. stlink-1.8.0
The ST-Link tools — flash and debug an STM32 directly
1.8.0-1 · BSD-3-Clause · 0.7 SBU · 599.9 KiB, 103 files · 41_system, 465 of 1047 · ports/core/embedded/stlink
Homepage: https://github.com/stlink-org/stlink
Why it is in KDOS. The comment above it in script/phases/41_system/packages.d/embedded.txt:
The probe is soldered to every Nucleo and Discovery board, and
st-flash write firmware.bin 0x8000000is one command where openocd is three config files.
Depends on: cmake, ninja, pkgconf, libusb.
Required by (1): stlink-gui.
Sources: stlink-1.8.0.tar.gz (251.2 KiB). Every step kpkg takes applies to this port.
Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install stlink'
build.sh:
mkdir -p build && cd build
cmake .. -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS_RELEASE="-O2 -DNDEBUG -Wno-error" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSTLINK_MODPROBED_DIR=/etc/modprobe.d \
-DSTLINK_UDEV_RULES_DIR=/etc/udev/rules.d
ninja
DESTDIR=$PKG ninja install
rm -f "$PKG"/etc/udev/rules.d/49-stlink*.rules
rmdir --ignore-fail-on-non-empty "$PKG/etc/udev/rules.d" "$PKG/etc/udev" 2>/dev/null || true
rm -f "$PKG/usr/bin/stlink-gui" "$PKG/usr/share/stlink/stlink-gui.ui" \
"$PKG/usr/share/applications/stlink-gui.desktop" \
"$PKG/usr/share/icons/hicolor/scalable/apps/stlink-gui.svg"
rmdir --ignore-fail-on-non-empty "$PKG/usr/share/applications" \
"$PKG/usr/share/icons/hicolor/scalable/apps" "$PKG/usr/share/icons/hicolor/scalable" \
"$PKG/usr/share/icons/hicolor" "$PKG/usr/share/icons" 2>/dev/null || true
test ! -e "$PKG/usr/bin/stlink-gui"
Programs: st-flash, st-info, st-trace, st-util.
Libraries: libstlink.a, libstlink.so.
Directories: /usr/include/stlink, /usr/share/licenses/stlink, /usr/share/stlink/chips.