From efd6bab19ce6c6aace07fa2760e887c0564460fd Mon Sep 17 00:00:00 2001 From: stefanrueger Date: Tue, 27 Feb 2024 22:51:36 +1300 Subject: [PATCH] Widen chip erase tests to also capture -c urclock emulation --- tools/test-avrdude | 7 +++++-- tools/test_files/flash_one_byte_0xff_10240B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_1024B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_131072B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_139264B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_16384B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_204800B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_20480B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_2048B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_262144B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_270336B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_32768B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_36864B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_401408B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_40960B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_4096B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_49152B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_512B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_524288B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_65536B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_69632B.hex | 3 +++ tools/test_files/flash_one_byte_0xff_8192B.hex | 3 +++ tools/test_files/generate_test_hex.sh | 4 ++-- 23 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 tools/test_files/flash_one_byte_0xff_10240B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_1024B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_131072B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_139264B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_16384B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_204800B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_20480B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_2048B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_262144B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_270336B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_32768B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_36864B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_401408B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_40960B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_4096B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_49152B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_512B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_524288B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_65536B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_69632B.hex create mode 100644 tools/test_files/flash_one_byte_0xff_8192B.hex diff --git a/tools/test-avrdude b/tools/test-avrdude index 10ede616..44c735bd 100755 --- a/tools/test-avrdude +++ b/tools/test-avrdude @@ -355,7 +355,8 @@ for (( p=0; p<$arraylength; p++ )); do # if [ $benchmark -eq 0 ]; then specify="chip erase" - command=(${avrdude[@]} -e) + # Emulated chip erase needs a tiny file be uploaded + command=(${avrdude[@]} -e -A -U $tfiles/flash_one_byte_0xff_${flash_size}B.hex) execute "${command[@]}" result [ $? == 0 ] fi @@ -454,7 +455,9 @@ for (( p=0; p<$arraylength; p++ )); do # Chip erase and verify # specify="chip erase and spot check flash is actually erased" - command=(${avrdude[@]} -e -Uflash:v:$tfiles/holes_flash_0xff_${flash_size}B.hex) + command=(${avrdude[@]} -e -A + -U $tfiles/flash_one_byte_0xff_${flash_size}B.hex + -U flash:v:$tfiles/holes_flash_0xff_${flash_size}B.hex) execute "${command[@]}" result [ $? == 0 ] if [[ $? == 0 && $check_eeprom -eq 1 && $is_bootloader -eq 0 && $benchmark -eq 0 ]]; then diff --git a/tools/test_files/flash_one_byte_0xff_10240B.hex b/tools/test_files/flash_one_byte_0xff_10240B.hex new file mode 100644 index 00000000..8eeb3356 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_10240B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:010A0000FFF6 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_1024B.hex b/tools/test_files/flash_one_byte_0xff_1024B.hex new file mode 100644 index 00000000..d9ed2768 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_1024B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01010000FFFF +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_131072B.hex b/tools/test_files/flash_one_byte_0xff_131072B.hex new file mode 100644 index 00000000..434fb443 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_131072B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01800000FF80 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_139264B.hex b/tools/test_files/flash_one_byte_0xff_139264B.hex new file mode 100644 index 00000000..1c5aab65 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_139264B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01880000FF78 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_16384B.hex b/tools/test_files/flash_one_byte_0xff_16384B.hex new file mode 100644 index 00000000..36f20f79 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_16384B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01100000FFF0 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_204800B.hex b/tools/test_files/flash_one_byte_0xff_204800B.hex new file mode 100644 index 00000000..a20f0dfc --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_204800B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01C80000FF38 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_20480B.hex b/tools/test_files/flash_one_byte_0xff_20480B.hex new file mode 100644 index 00000000..fc010281 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_20480B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01140000FFEC +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_2048B.hex b/tools/test_files/flash_one_byte_0xff_2048B.hex new file mode 100644 index 00000000..2372e248 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_2048B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01020000FFFE +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_262144B.hex b/tools/test_files/flash_one_byte_0xff_262144B.hex new file mode 100644 index 00000000..b7866f30 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_262144B.hex @@ -0,0 +1,3 @@ +:020000040001F9 +:01000000FF00 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_270336B.hex b/tools/test_files/flash_one_byte_0xff_270336B.hex new file mode 100644 index 00000000..2f7e6451 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_270336B.hex @@ -0,0 +1,3 @@ +:020000040001F9 +:01080000FFF8 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_32768B.hex b/tools/test_files/flash_one_byte_0xff_32768B.hex new file mode 100644 index 00000000..bbf220f0 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_32768B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01200000FFE0 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_36864B.hex b/tools/test_files/flash_one_byte_0xff_36864B.hex new file mode 100644 index 00000000..75d0281b --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_36864B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01240000FFDC +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_401408B.hex b/tools/test_files/flash_one_byte_0xff_401408B.hex new file mode 100644 index 00000000..6ff2cf4d --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_401408B.hex @@ -0,0 +1,3 @@ +:020000040001F9 +:01880000FF78 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_40960B.hex b/tools/test_files/flash_one_byte_0xff_40960B.hex new file mode 100644 index 00000000..e6cb14c2 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_40960B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01280000FFD8 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_4096B.hex b/tools/test_files/flash_one_byte_0xff_4096B.hex new file mode 100644 index 00000000..32ce277d --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_4096B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01040000FFFC +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_49152B.hex b/tools/test_files/flash_one_byte_0xff_49152B.hex new file mode 100644 index 00000000..24009753 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_49152B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01300000FFD0 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_512B.hex b/tools/test_files/flash_one_byte_0xff_512B.hex new file mode 100644 index 00000000..f6a9a764 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_512B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01008000FF80 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_524288B.hex b/tools/test_files/flash_one_byte_0xff_524288B.hex new file mode 100644 index 00000000..9ed27666 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_524288B.hex @@ -0,0 +1,3 @@ +:020000040002F8 +:01000000FF00 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_65536B.hex b/tools/test_files/flash_one_byte_0xff_65536B.hex new file mode 100644 index 00000000..a42e27eb --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_65536B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01400000FFC0 +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_69632B.hex b/tools/test_files/flash_one_byte_0xff_69632B.hex new file mode 100644 index 00000000..66749c42 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_69632B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01440000FFBC +:00000001FF diff --git a/tools/test_files/flash_one_byte_0xff_8192B.hex b/tools/test_files/flash_one_byte_0xff_8192B.hex new file mode 100644 index 00000000..b1721926 --- /dev/null +++ b/tools/test_files/flash_one_byte_0xff_8192B.hex @@ -0,0 +1,3 @@ +:020000040000FA +:01080000FFF8 +:00000001FF diff --git a/tools/test_files/generate_test_hex.sh b/tools/test_files/generate_test_hex.sh index adc74829..0e6bc6a1 100755 --- a/tools/test_files/generate_test_hex.sh +++ b/tools/test_files/generate_test_hex.sh @@ -39,6 +39,8 @@ for i in ${flashsizes[@]}; do -generate $((i-i/3)) $((i-i/4-2)) -repeat-data 0xff \ -generate $((i-i/4-1)) $((i-i/4)) -repeat-data 0xff \ -o holes_flash_0xff_${i}B.hex -Intel + # A file with a single 0xff byte + srec_cat -generate $((i/4)) $((i/4+1)) -repeat-data 0xff -o flash_one_byte_0xff_${i}B.hex -Intel done ### @@ -50,5 +52,3 @@ for i in ${usersigsizes[@]}; do # Empty memory srec_cat -generate 0x00 $i -repeat-data 0xff -o 0xff_${i}B.hex -Intel done - -