Commit Graph

73 Commits

Author SHA1 Message Date
Stefan Rueger
bc0b77910e Fix typo 2026-03-25 21:18:32 +00:00
MX682X
8dfc1442a7 linting 2025-09-27 23:01:38 +02:00
stefanrueger
fce210c341 Use bash printf with C locale 2025-06-18 16:13:39 +02:00
stefanrueger
7eaa5cb785 Improve test8 help message 2025-06-09 19:05:52 +02:00
stefanrueger
5c7d1674b5 Zap outfile before starting test runs 2025-06-09 19:02:28 +02:00
stefanrueger
231bb28db5 Update test8 usage message 2025-06-02 10:51:13 +02:00
MX682X
e1a6551b1e adding possibility to keep supplying power with PK4/5 after exit 2025-05-02 21:40:58 +02:00
MX682X
93856138a3 try to improve error handling on a failed data transmission plus some minor adjustments and fixes 2025-01-18 20:22:28 +01:00
MX682X
29438a2bd5 fixed old jtag flash writes, updated scripts, included EC family 2025-01-13 20:52:52 +01:00
MX682X
8aa795be04 added experemental -xf= option to override flash size on isp 2024-12-16 23:41:44 +01:00
MX682X
ae867081d5 rework prodsig retrival logic 2024-11-26 20:46:45 +01:00
MX682X
fbffbf7a1a fixing build for ARM64 (no bswap) 2024-11-23 23:18:56 +01:00
MX682X
7b077029bc add support for dW, JTAG, ISP, and PDI (untested)
dW has some hiccups on flash writes
JTAG must erase chip before overwriting EEPROM
2024-11-23 22:10:17 +01:00
Hans Ulrich Niedermann
5176d7b818 Add checks for zombie sourcecode problems
This adds checks for zombie sourcecode problems, i.e. problems
we have tried to eliminate but which might be or have been
resurrected.

The example check is for the problematic

    #include "ac_cfg.h"

with double quotes instead of <> which were identified as a
problem in https://github.com/avrdudes/avrdude/issues/1706
and then fixed.
2024-08-24 15:03:42 +02:00
Stefan Rueger
b389e8b89f Add -e exe option to test8 2024-08-22 17:43:37 +01:00
Stefan Rueger
de2b5bba89 Pass -a additional parameters also when prepping part 2024-08-19 20:45:22 +01:00
Hans Ulrich Niedermann
8f64d849a5 test-avrdude: Determine mem sizes without the full command
Determine the flash and ee memory sizes without invoking the full
${avrdude[@]} command with logging etc.

Slight adaptation of code by Stefan Rueger from
https://github.com/avrdudes/avrdude/pull/1891#issuecomment-2293314322
2024-08-16 16:27:05 +02:00
Hans Ulrich Niedermann
cef23e252e test-avrdude: Condense two info lines into one
Condense the information about the avrdude binary executable
and its version from two output lines into a single output line.

Slight adaptation of code by Stefan Rueger from
https://github.com/avrdudes/avrdude/pull/1891#issuecomment-2293314322
2024-08-16 16:17:19 +02:00
Hans Ulrich Niedermann
b8718e6b5d test-avrdude: Replace associative array with function call
Macos ships a quite old version of bash (3.x) which does not have
associative arrays (declare -A) yet.

As the test-avrdude script only uses one associative array
for a static mapping of one character strings to one word
strings, this can be easily replaced by a shell function
containing a "case" statement.

Before this fix:

2024-08-15T15:39:59.9596380Z Prepare "-cdryrun -pm2560" and press 'enter' or 'space' to continue. Press any other key to skip
2024-08-15T15:40:00.5796130Z    0.155 s: flash raw format -T/-U write/verify cola-vending-machine.raw
2024-08-15T15:40:00.7006170Z    0.111 s: flash extended address and hole test
2024-08-15T15:40:00.7057180Z ./tools/test-avrdude: line 322: declare: -A: invalid option
2024-08-15T15:40:00.7057750Z declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
2024-08-15T15:40:00.9218810Z    0.212 s: flash writing R numbers
2024-08-15T15:40:01.1793950Z    0.240 s: flash reading and verifying R numbers
2024-08-15T15:40:01.3661060Z    0.173 s: flash writing R numbers
2024-08-15T15:40:01.6317540Z    0.254 s: flash reading and verifying R numbers
2024-08-15T15:40:01.8235780Z    0.182 s: flash writing R numbers
2024-08-15T15:40:02.0724260Z    0.239 s: flash reading and verifying R numbers
2024-08-15T15:40:02.2713120Z    0.188 s: flash writing R numbers
2024-08-15T15:40:02.4497490Z    0.162 s: flash reading and verifying R numbers
2024-08-15T15:40:02.5897960Z    0.128 s: flash writing R numbers
2024-08-15T15:40:02.8667350Z    0.263 s: flash reading and verifying R numbers
2024-08-15T15:40:03.0635260Z    0.181 s: flash writing srec format
2024-08-15T15:40:03.2152560Z    0.142 s: flash reading and verifying srec format file

After this fix:

2024-08-15T17:23:24.5161820Z Prepare "-cdryrun -pm2560" and press 'enter' or 'space' to continue. Press any other key to skip
2024-08-15T17:23:25.1088990Z    0.162 s: flash raw format -T/-U write/verify cola-vending-machine.raw
2024-08-15T17:23:25.2742090Z    0.157 s: flash extended address and hole test
2024-08-15T17:23:25.4795650Z    0.196 s: flash writing binary numbers
2024-08-15T17:23:25.6721130Z    0.180 s: flash reading and verifying binary numbers
2024-08-15T17:23:25.8423490Z    0.161 s: flash writing octal numbers
2024-08-15T17:23:26.0901770Z    0.235 s: flash reading and verifying octal numbers
2024-08-15T17:23:26.2308860Z    0.127 s: flash writing decimal numbers
2024-08-15T17:23:26.4667010Z    0.228 s: flash reading and verifying decimal numbers
2024-08-15T17:23:26.6574670Z    0.180 s: flash writing hexadecimal numbers
2024-08-15T17:23:26.8651240Z    0.200 s: flash reading and verifying hexadecimal numbers
2024-08-15T17:23:27.0446640Z    0.168 s: flash writing R numbers
2024-08-15T17:23:27.3074230Z    0.250 s: flash reading and verifying R numbers
2024-08-15T17:23:27.4962750Z    0.179 s: flash writing srec format
2024-08-15T17:23:27.6594570Z    0.150 s: flash reading and verifying srec format file
2024-08-16 16:13:28 +02:00
Hans Ulrich Niedermann
4323a43519 test-avrdude: Print the type of the avrdude_bin executable 2024-08-16 16:13:28 +02:00
Hans Ulrich Niedermann
a8a8711b34 test-avrdude: Abort if running "avrdude -v" fails 2024-08-16 16:13:28 +02:00
Hans Ulrich Niedermann
a2906da411 test-avrdude: Adapt version check to new version format
The output of the version information in "avrdude -v" has changed between
avrdude 7.3 and now (commit cf0822bb71):

avrdude: Version 7.3

Avrdude version 7.3-20240814 (250a663a)

This means that the old grep call looking for "Version" cannot
find anything any more, and therefore needs to be changed.

This was not discovered as the test-avrdude script neglected to
abort if no version information is found.
2024-08-16 16:13:28 +02:00
MX682X
beaebd989c PICkit 5 support (#1863) 2024-08-14 18:01:04 +01:00
Stefan Rueger
526ffe1814 Add options -a and -m to test8 2024-08-09 20:24:53 +01:00
Stefan Rueger
f1df228902 Add bash script tools/test8 for release v8.0 testing 2024-08-09 14:33:30 +01:00
Hans Ulrich Niedermann
bc2e3609a1 Remove obsolete SVN $Id$ tags from source files
Remove SVN $Id$ tags from source files which have been made
obsolete by moving to git and serve no purpose any more.

This mostly removes the matches printed by the command

    git grep -E '\$[A-Za-z]+\$'

The remaining exceptions are some binary files (PDF and font files),
and jquery js files with both $Id$ and $Date$ tags.
2024-07-31 17:12:55 +02:00
stefanrueger
34366a6b9d Update test-avrdude help message 2024-02-29 20:26:57 +13:00
stefanrueger
71a9cb47b3 Keep case of part in test-avrdude -b -p "-p part ..." 2024-02-28 23:27:38 +13:00
stefanrueger
e35714b1ce Change 1-byte file upload for emulated chip erase 2024-02-28 22:14:28 +13:00
stefanrueger
64c5d1da0b Remove avrbench and generate 4-number benchmark table with legend 2024-02-28 22:07:18 +13:00
stefanrueger
61ed3dd18f Mention avrbench legend in test-avrdude -b summary 2024-02-27 23:14:31 +13:00
stefanrueger
82c001bab4 Drop chip erase and checking test for test-avrdude -b 2024-02-27 23:10:01 +13:00
stefanrueger
efd6bab19c Widen chip erase tests to also capture -c urclock emulation 2024-02-27 22:51:36 +13:00
stefanrueger
cd41d2b4e2 Change /dev/null to temp file to be Windows compatible 2024-02-27 15:00:22 +13:00
stefanrueger
f088a9bc3f Clarify -b option 2024-02-27 14:46:37 +13:00
stefanrueger
df3c67f2d0 Add normalised avrbench number suitable for markdown tables
The cumulative time for typical user tasks depends on the flash and EEPROM
size of the part. This commit computes a size-normalised time. Lower is
better. This avrbench number still depends on the part, but less so than
the cumulative time of the tasks.

The summary line is put in vertical bars to make creation of markdown
tables easier.
2024-02-27 14:09:52 +13:00
stefanrueger
3b567687a7 Lowercase variable names in test-avrdude
Uppercase names are typically used for environment variables in bash
2024-02-27 13:44:52 +13:00
stefanrueger
6e6404cbb4 Use alternative for /dev/null when not available 2024-02-27 11:54:40 +13:00
stefanrueger
274ac34b6c Add benchmark option -b to test-avrdude
This executes five tests for typical programming tasks:
  - Write/verify a "difficult" sketch to flash: two code sections and one
    data section separated by "holes" of different sizes
  - Dump all flash, eg, to make a backup
  - Write/verify a "difficult" eeprom data file with holes
  - Dump all eeprom, eg, to make a backup
  - Chip erase (bootloaders are expected to page erase flash apart from
    the bootloader itself) and spot check whether flash was erased

The reported times are realistic times with overhead of starting avrdude,
resetting the board via DTR/RTS, establishing comms, including erasing the
flash before writing/verifying the sketch and disengaging the chip.

$ test-avrdude -b -d 0 \
  -p "u7.7/weu-jPrac -c urclock -P ch340 -p m328p -b 1000000" \
  -p "u7.7/-eu-jPrac -c urclock -P ch340 -p m328p -b 1000000"

Testing avrdude version 7.3-20240225 (20788712)
Prepare "u7.7/weu-jPrac -c urclock -P ch340 -p m328p -b 1000000" and press 'enter' or 'space' to continue. Press any other key to skip
   2.174 s: flash -U write/verify holes_rjmp_loops_32768B.hex
   1.339 s: flash -U read all flash
   1.415 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
   1.034 s: eeprom -U read all
   1.604 s: chip erase and spot check flash is actually erased
   7.566 s: benchmark for u7.7/weu-jPrac -c urclock -P ch340 -p m328p -b 1000000
Prepare "u7.7/-eu-jPrac -c urclock -P ch340 -p m328p -b 1000000" and press 'enter' or 'space' to continue. Press any other key to skip
   2.001 s: flash -U write/verify holes_rjmp_loops_32768B.hex
   1.333 s: flash -U read all flash
   1.405 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
   1.029 s: eeprom -U read all
   1.618 s: chip erase and spot check flash is actually erased
   7.386 s: benchmark for u7.7/-eu-jPrac -c urclock -P ch340 -p m328p -b 1000000

Note the benchmark line with the cumulative time for all five tasks
2024-02-26 23:19:43 +13:00
stefanrueger
83571e3310 Remove -l $logfile when echoing a failed avrdude command 2024-02-06 12:32:22 +13:00
stefanrueger
cf2b362532 Remove -l $logfile when listing avrdude commands 2024-02-05 15:13:43 +13:00
stefanrueger
7bf69aad43 Check $avrdude_bin is executable 2024-02-05 14:51:18 +13:00
stefanrueger
f9246b81c4 Remove wildcard string matches in test script 2024-02-05 14:33:02 +13:00
stefanrueger
8f8316f08b Change integer test to string test to allow non-integer $elapsed 2024-02-05 14:11:41 +13:00
stefanrueger
e6c1229b71 Remove config eesave output from test-avrdude -v runs
-v is meant to only show AVRDUDE errors and warnings

Before this commit:

$ tools/test-avrdude -v -p "-c dryrun -p m328p"
Testing avrdude version 7.2-20240201 (571a8063)
Prepare "-c dryrun -p m328p" and press 'enter' or 'space' to continue. Press any other key to skip
   0.064 s: fuse access: clear, set and read eesave fuse bit
config eesave=ee_erased # 1
   0.068 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
   0.068 s: chip erase
   0.068 s: flash -U write/verify holes_rjmp_loops_32768B.hex
   0.068 s: flash -T write/verify holes_rjmp_loops_32768B.hex
   0.068 s: eeprom check whether programmer can flip 0s to 1s
   0.069 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
   0.067 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_1024B.hex
   0.068 s: chip erase and spot check flash is actually erased
   0.068 s: spot check eeprom is erased, too

After:

$ tools/test-avrdude -v -p "-c dryrun -p m328p"
Testing avrdude version 7.2-20240201 (571a8063)
Prepare "-c dryrun -p m328p" and press 'enter' or 'space' to continue. Press any other key to skip
   0.065 s: fuse access: clear, set and read eesave fuse bit
   0.068 s: fuse access: set eesave fusebit to delete EEPROM on chip erase
   0.067 s: chip erase
   0.068 s: flash -U write/verify holes_rjmp_loops_32768B.hex
   0.068 s: flash -T write/verify holes_rjmp_loops_32768B.hex
   0.066 s: eeprom check whether programmer can flip 0s to 1s
   0.069 s: eeprom -U write/verify holes_pack_my_box_1024B.hex
   0.068 s: eeprom -T write/verify holes_{the_five_boxing_wizards,pack_my_box}_1024B.hex
   0.067 s: chip erase and spot check flash is actually erased
2024-02-05 14:04:38 +13:00
stefanrueger
571a8063b9 Update test-avrdude usage 2024-02-01 18:29:00 +13:00
stefanrueger
acd5584c62 Provide -T option for test-avrdude to add dryrun/dryboot tests 2024-02-01 15:21:34 +13:00
stefanrueger
2c677693f8 Exit test-avrdude with 1 if any failure occurred 2024-02-01 15:09:00 +13:00
stefanrueger
213fe7561f Create test-avrdude's temporary files in the script itself 2024-02-01 15:02:48 +13:00
stefanrueger
370a15d032 Reduce default delay between avrdude test runs
- From 4 s to 0.75 s
 - Do not delay at all for -c dryrun/dryboot
 - Do not delay before first avrdude call in a series
2024-01-31 14:49:46 +13:00