Skip to content

Instantly share code, notes, and snippets.

@JarrettR
Created January 18, 2021 22:43
Show Gist options
  • Save JarrettR/4b0474ba351d72371ee1e682041167d2 to your computer and use it in GitHub Desktop.
Save JarrettR/4b0474ba351d72371ee1e682041167d2 to your computer and use it in GitHub Desktop.
import subprocess
# .\stm8flash.exe -c stlinkv2 -p stm8s105?4 -r out.bin -b 1
out = b'\x00'
while out == b'\x00':
subprocess.run(['stm8flash.exe', '-c', 'stlinkv2', '-p', 'stm8s105?4', '-r', 'out.bin', '-b', '1'])
f=open("out.bin","rb")
out = f.read(1)
print(out)
subprocess.run(['stm8flash.exe', '-c', 'stlinkv2', '-p', 'stm8s105?4', '-r', 'out.bin'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment