first commit
This commit is contained in:
15
elf-to-hex.sh
Executable file
15
elf-to-hex.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
objcopy -O ihex target/thumbv6m-none-eabi/release/main target/main.hex -S
|
||||
|
||||
# read version number
|
||||
version=$(awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2) }' Cargo.toml)
|
||||
# check if version was found
|
||||
if [[ -z "$version" ]]; then
|
||||
echo "Error: Version not found in Cargo.toml"
|
||||
exit 1
|
||||
fi
|
||||
echo "Firmware Version $version"
|
||||
|
||||
# write version into filename
|
||||
mv target/main.hex target/FW-$version-main.hex
|
||||
echo "target/FW-$version-main.hex"
|
||||
Reference in New Issue
Block a user