Files
ODrive/Firmware/find_programmer.sh
T
Samuel Sadok cc1eddc65e store the programmer serial number with escape characters.
An STLink/v2 programmer is now identified by a string of the format "\x12\x34..." instead of "1234..." This navigates around differences of how makefiles are parsed in windows and linux
2018-04-23 19:52:39 -07:00

6 lines
232 B
Bash
Executable File

#!/bin/bash
openocd -d3 -f board/stm32f4discovery.cfg -c "hla_serial wrong_serial" 2>&1 | \
xxd -p | \
tr -d '\n' | \
sed -n 's/^.*6e756d6265722027\([0-9a-f]*\)2720646f65736e27.*$/\1/p' | sed -e 's/.\{2\}/\\x&/g'; echo