mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
kinetis: Add check-fcfield-elf.sh
Checks an ELF file for a correctly set flash configuration field.
This commit is contained in:
parent
5afd93f29e
commit
c56afd9575
24
cpu/kinetis_common/dist/check-fcfield-elf.sh
vendored
Executable file
24
cpu/kinetis_common/dist/check-fcfield-elf.sh
vendored
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Anti brick check script for Freescale Kinetis MCUs.
|
||||||
|
#
|
||||||
|
# This script is supposed to be called from RIOTs
|
||||||
|
# unified OpenOCD script (dist/tools/openocd/openocd.sh).
|
||||||
|
#
|
||||||
|
# @author Jonas Remmert <j.remmert@phytec.de>
|
||||||
|
# @author Johann Fischer <j.fischer@phytec.de>
|
||||||
|
|
||||||
|
ELFFILE=$1
|
||||||
|
|
||||||
|
RETVAL=$(arm-none-eabi-readelf -x .fcfield $ELFFILE | awk '/0x00000400/ {print $2 $3 $4 $5}')
|
||||||
|
UNLOCKED_FCFIELD="fffffffffffffffffffffffffeffffff"
|
||||||
|
|
||||||
|
if [ "$RETVAL" != "$UNLOCKED_FCFIELD" ]; then
|
||||||
|
echo "Danger of bricking the device during flash!"
|
||||||
|
echo "Flash configuration field of $ELFFILE:"
|
||||||
|
arm-none-eabi-readelf -x .fcfield $ELFFILE
|
||||||
|
echo "Abort flash procedure!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "$ELFFILE is fine."
|
||||||
|
exit 0
|
Loading…
Reference in New Issue
Block a user