Skip to content

Instantly share code, notes, and snippets.

@pveierland
Created July 11, 2021 14:56
Show Gist options
  • Save pveierland/558cb94cd0b42e33dde307ee694d19e6 to your computer and use it in GitHub Desktop.
Save pveierland/558cb94cd0b42e33dde307ee694d19e6 to your computer and use it in GitHub Desktop.
WSL jflash + jreset
#/usr/bin/env bash
set -x
cat << EOF > /mnt/c/tmp/flash.jlink
r
loadbin ${1##*/}, 0x8000000
r
go
q
EOF
cp -f "${1}" /mnt/c/tmp/ && cd /mnt/c/tmp/ && /mnt/c/Program\ Files\ \(x86\)/SEGGER/JLink/JLink.exe -device STM32F413CG -if SWD -speed 4000 -autoconnect 1 -CommanderScript flash.jlink
#/usr/bin/env sh
set -x
cat << EOF > /mnt/c/tmp/reset.jlink
r
go
q
EOF
cd /mnt/c/tmp/ && /mnt/c/Program\ Files\ \(x86\)/SEGGER/JLink/JLink.exe -device STM32F413VH -if SWD -speed 4000 -autoconnect 1 -CommanderScript reset.jlink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment