#!/bin/bash function test_init { request_DUT "atmega8dip28" || return 1 return 0 } function test_run { local args="-c atmega8dip28 -I bin -O bin" # Check signature toprammer $args --read-sig "$tmpfile" compare_file_to_hex "$tmpfile" "1E9307" || die "signature mismatch" toprammer $args --erase # Check progmem toprammer $args --write-prog "$testfile_8k" toprammer $args --read-prog "$tmpfile" compare_files "$testfile_8k" "$tmpfile" || die "progmem mismatch" # Check EEPROM toprammer $args --write-eeprom "$testfile_512" toprammer $args --read-eeprom "$tmpfile" compare_files "$testfile_512" "$tmpfile" || die "EEPROM mismatch" # Check fuses testfuses="E1D9" echo "0x0000: $testfuses" | toprammer $args -I hex --write-fuse - toprammer $args --read-fuse "$tmpfile" compare_file_to_hex "$tmpfile" "$testfuses" || die "fuses mismatch" # Check lockbits toprammer $args --read-lock "$tmpfile" compare_file_to_hex "$tmpfile" "FF" || die "lockbits mismatch" toprammer $args --write-lock "$tmpfile" }