1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

kinetis/check-fcfield: skip on IMAGE_OFFSET > 0x410

- fcfield is located in memory at 0x400-0x40f. Its content is only read
  upon reset, therefore if in presence of a bootloader and multiple
  applications, the fcfield will only be read when the bootloader
  is loaded. As long as we flash at IMAGE_OFFSET > 0x410 we do not
  care about the fcfield content since it won't get overwritten.
This commit is contained in:
francisco 2019-05-27 17:44:46 +02:00
parent 7156977fed
commit c219fdc001

View File

@ -12,7 +12,7 @@
# @author Joakim Nohlgård <joakim.nohlgard@eistec.se>
# @author Francisco Molina <francisco.molina@inria.fr>
# Elf or Hex file to flash
# elf, hex or bin file to flash
FLASHFILE="$1"
# FCFIELD goes from 0x400-0x40f
@ -49,12 +49,19 @@ if [ $# -ne 1 ]; then
exit 2
fi
if ! filter_fc_field ${FLASHFILE} ${FCFIELD_AWK_REGEX} | grep -q "${EXPECTED_FCFIELD}"; then
if [ $(printf '%d' "${IMAGE_OFFSET}") -ge $(printf '%d' "${FCFIELD_END}") ]; then
echo "Value in fcfield is not checked when flashing at \$IMAGE_OFFSET >= 0x410"
exit 0
elif [ 0 -lt $(printf '%d' "${IMAGE_OFFSET}") ] && [ $(printf '%d' "${IMAGE_OFFSET}") -lt $(printf '%d' "${FCFIELD_END}") ]; then
echo "Error: flashing with 0 < \$IMAGE_OFFSET < 0x410 is currently not handled"
exit 1
elif ! filter_fc_field ${FLASHFILE} ${FCFIELD_AWK_REGEX} | grep -q "${EXPECTED_FCFIELD}"; then
echo "Danger of bricking the device during flash!"
echo "Flash configuration field of ${FLASHFILE}:"
get_fc_field ${FLASHFILE}
echo "Abort flash procedure!"
exit 1
fi
echo "${FLASHFILE} is not locked."
exit 0