summaryrefslogtreecommitdiffstats
path: root/tests/top2049/001-attiny13dip8.test
blob: 75f12f9891f86f70b9ee293bd8390a290ca626a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash

function test_init
{
	request_DUT "attiny13dip8" || return 1
	return 0
}

function test_run
{
	local args="-c attiny13dip8 -I bin -O bin"

	# Check signature
	toprammer $args --read-sig "$tmpfile"
	compare_file_to_hex "$tmpfile" "1E9007" || die "signature mismatch"

	toprammer $args --erase

	# Check progmem
	toprammer $args --write-prog "$testfile_1k"
	toprammer $args --read-prog "$tmpfile"
	compare_files "$testfile_1k" "$tmpfile" || die "progmem mismatch"

	# Check EEPROM
	toprammer $args --write-eeprom "$testfile_64"
	toprammer $args --read-eeprom "$tmpfile"
	compare_files "$testfile_64" "$tmpfile" || die "EEPROM mismatch"

	# Check fuses
	testfuses="6AFF"
	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"
}
bues.ch cgit interface