Commit Graph

2760 Commits

Author SHA1 Message Date
Stefan Rueger
62023e2a3b Review and update terminal help messages 2023-05-16 21:43:45 +01:00
Stefan Rueger
5cf5924f6c Update and shorten terminal help messages 2023-05-15 18:24:50 +01:00
Stefan Rueger
464d18729e Allow successive terminal commands in one line separated by ;
This makes it easier to pass multi-line commands from a single bash line:

$ echo "d ee 0 16; d ee -16 -1" | avrdude -qqt
avrdude> d ee 0 16; d ee -16 -1
0000  48 65 6c 6c 6f 2c 20 77  6f 72 6c 64 21 00 ff ff  |Hello, world!...|
03f0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
2023-05-15 17:52:18 +01:00
Stefan Rueger
e7fb2e2b34 Allow inline # comments for terminal commands 2023-05-15 17:09:10 +01:00
Stefan Rueger
a1bbbe904c Simplify tokenize() 2023-05-15 17:05:08 +01:00
Stefan Rueger
a40b9db5a4 Rewrite nexttok() to allow escaped spaces in non-string arguments
Useful for file names

```
$ echo "Hello, world!" >'Q:\Projects\Eurovision Song Contest\light show.eep'
$ avrdude -qqt
avrdude> erase eeprom 0 16
avrdude> # Escape spaces in filenames with a backslash:
avrdude> write eeprom Q:\Projects\Eurovision\ Song\ Contest\light\ show.eep:r
avrdude> dump eeprom 0 16
0000  48 65 6c 6c 6f 2c 20 77  6f 72 6c 64 21 0a ff ff  |Hello, world! ..|
```
2023-05-15 16:49:08 +01:00
Stefan Rueger
88d4d712df Extend <data> notion in terminal write to files
$ echo "The quick brown fox jumps over the lazy dog" >fox

$ avrdude -qqt
avrdude> w
Usage: write <memory> <addr> <data>[,] {<data>[,]}
       write <memory> <addr> <len> <data>[,] {<data>[,]} ...
       write <memory> <datum> # only for 1-byte memories
       write <memory> <file>  # only for memories with more than 1 byte

Ellipsis ... writes <len> bytes padded by repeating the last <data> item.

Both the <addr> and <len> can be negative numbers; a negative <addr> starts
an interval from that many bytes below the memory size; a negative <len> ends
the interval at that many bytes below the memory size.

<data> can be binary, octal, decimal or hexadecimal integers, floating point
numbers or C-style strings and characters. If nothing matches, <data> will be
interpreted as a file name containing data. In absence of a :<f> format
suffix, the terminal will try to auto-detect the file format.
[...]

avrdude> write eeprom 0 80 0xff ...

avrdude> write eeprom fox
avrdude error: (write) data fox: cannot determine format for file fox, specify explicitly

avrdude> write eeprom fox:r

avrdude> read eeprom 0 80
0000  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
0010  66 6f 78 20 6a 75 6d 70  73 20 6f 76 65 72 20 74  |fox jumps over t|
0020  68 65 20 6c 61 7a 79 20  64 6f 67 0a ff ff ff ff  |he lazy dog ....|
0030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

avrdude> write eeprom 0b10000 fox:r

avrdude> read eeprom 0 80
0000  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
0010  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
0020  66 6f 78 20 6a 75 6d 70  73 20 6f 76 65 72 20 74  |fox jumps over t|
0030  68 65 20 6c 61 7a 79 20  64 6f 67 0a ff ff ff ff  |he lazy dog ....|
0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

avrdude> write eeprom 0 80 0xff ...

avrdude> write eeprom 0 "Hello, world" 1 2 3 fox:r

avrdude> read eeprom 0 80
0000  48 65 6c 6c 6f 2c 20 77  6f 72 6c 64 00 01 02 03  |Hello, world....|
0010  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
0020  66 6f 78 20 6a 75 6d 70  73 20 6f 76 65 72 20 74  |fox jumps over t|
0030  68 65 20 6c 61 7a 79 20  64 6f 67 0a ff ff ff ff  |he lazy dog ....|
0040  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

avrdude> write eeprom 0 77 "Hello, world" 1 2 3 fox:r ...

avrdude> read eeprom 0 80
0000  48 65 6c 6c 6f 2c 20 77  6f 72 6c 64 00 01 02 03  |Hello, world....|
0010  54 68 65 20 71 75 69 63  6b 20 62 72 6f 77 6e 20  |The quick brown |
0020  66 6f 78 20 6a 75 6d 70  73 20 6f 76 65 72 20 74  |fox jumps over t|
0030  68 65 20 6c 61 7a 79 20  64 6f 67 0a 54 68 65 20  |he lazy dog The |
0040  71 75 69 63 6b 20 62 72  6f 77 6e 20 66 ff ff ff  |quick brown f...|
2023-05-14 20:12:32 +01:00
Stefan Rueger
4b62480e85 Use str_int() for main option parsing 2023-05-14 13:46:01 +01:00
Stefan Rueger
21521c23c6 Use str_int() for reset pin in linuxspi port string 2023-05-14 13:33:18 +01:00
Stefan Rueger
1edc42cf3e Use str_int() for general urclock option parsing 2023-05-14 13:24:45 +01:00
Stefan Rueger
1520422639 Use str_int() for urclockID parsing 2023-05-14 13:19:28 +01:00
Stefan Rueger
cf963702d4 Fix big endian treatment 2023-05-14 12:58:11 +01:00
Stefan Rueger
4eee8ab7be Add default_bitclock to avrdude -c*/s -p*/s output 2023-05-14 02:55:09 +01:00
Stefan Rueger
a7ae555f71 Use str_int() for avrdude.conf integers 2023-05-14 02:54:50 +01:00
Stefan Rueger
9628a820c8 Use str_int() for <data> in -U <mem>:w:<data>:m immediate updates 2023-05-14 01:11:41 +01:00
Stefan Rueger
5603bef0d7 Use str_int() for avrdude.conf address bit number aN 2023-05-14 00:54:21 +01:00
Stefan Rueger
9dc08857a8 Change error message for missing data on terminal write 2023-05-14 00:37:12 +01:00
Stefan Rueger
96fea11257 Use str_int() in terminal read 2023-05-13 23:29:33 +01:00
Stefan Rueger
7589246a40 Use str_int() in terminal write 2023-05-13 23:28:34 +01:00
Stefan Rueger
1091f1d421 Use str_int() in terminal send 2023-05-13 23:27:28 +01:00
Stefan Rueger
efbc69aaf8 Use str_int() in terminal pgerase 2023-05-13 23:25:55 +01:00
Stefan Rueger
fb42518f6b Use str_int() in terminal varef 2023-05-13 23:24:25 +01:00
Stefan Rueger
6accc3baae Use str_int in terminal verbose 2023-05-13 23:22:24 +01:00
Stefan Rueger
5acf5c6aaf Use str_int() in terminal quell 2023-05-13 23:21:11 +01:00
Stefan Rueger
63f818f53f Hide Easter egg 2023-05-13 23:16:21 +01:00
Stefan Rueger
e3bc41a5cd Add str_int() conversion that conforms to avrdude terminal syntax
This has a similar but slightly different calling interface to strtoull()
and conforms to the way that terminal write interprets data items, ie,
recognises binary numbers as well as optional size suffixes LL/L/S/H/HH,
optional unsigned U suffix. It also takes C character constants, eg, '\n',
as numbers and ignores an optional trailing comma. Usage example:

 #include "libavrdude.h"

const char *errptr;
int addr = str_int(string, STR_INT32, &errptr);
if(errptr) {
  pmsg_error("address %s: %s\n", string, errptr);
  return -1;
}
2023-05-13 23:10:15 +01:00
Stefan Rueger
bb95a83277 Add str_todata() and use it for terminal write data items
This makes available as a function the way that terminal write interprets
write data and converts them into bits and bytes. Also adds binary numbers
using the 0b prefix.
2023-05-13 13:09:26 +01:00
Stefan Rueger
e6a2f3c058 Update NEWS 2023-05-04 19:26:07 +01:00
Stefan Rueger
9c41c23923 Merge pull request #1357 from stefanrueger/metadata
Progressively shrink metadata for -c urclock
2023-05-04 19:21:00 +01:00
Stefan Rueger
b812d9e087 Merge pull request #1351 from stefanrueger/option-n
Document -n behaviour wrt -U and terminal
2023-05-04 19:20:08 +01:00
drmpjz
b8344734d1 Add option -f to build.sh (#1342) 2023-05-04 19:18:17 +01:00
Stefan Rueger
e4cef21030 Ensure pmsg_xyz() messages always start on a new line 2023-05-03 10:54:39 +01:00
Stefan Rueger
a894dbb908 Progressively shrink metadata for -c urclock 2023-05-03 00:19:52 +01:00
Stefan Rueger
532387c5a2 Update documentation for -n, -V and -x help 2023-05-01 18:48:30 +01:00
Stefan Rueger
2fbe057b57 Document -n behaviour wrt -U and terminal 2023-04-24 11:20:16 +01:00
Stefan Rueger
bda26d3984 Remove unnecessary variable 2023-04-24 10:42:10 +01:00
Stefan Rueger
c279ab8639 Update NEWS 2023-04-23 23:02:49 +01:00
Stefan Rueger
9c4f295ffd Merge pull request #1348 from stefanrueger/variants
Add variants of obsolete parts
2023-04-23 22:49:35 +01:00
Stefan Rueger
88c4a6fd5f Merge pull request #1347 from stefanrueger/dryrun
Provide a programmer dryrun that emulates programming
2023-04-23 22:49:21 +01:00
Stefan Rueger
509c5c2932 Merge pull request #1346 from stefanrueger/strutil
Add case-insensitive string comparison and wildcard match to str_*() ...
2023-04-23 22:48:51 +01:00
Stefan Rueger
b4fa1bf8c2 Merge pull request #1345 from MCUdude/more-extra-parameters
Add `-xvtarg`, `-xvaref` and `-xfosc` extended parameters
2023-04-23 22:48:21 +01:00
MCUdude
46b44a9fe1 Fix grammar 2023-04-23 21:47:57 +02:00
Stefan Rueger
a00f000fc0 Add variants for ATxmega192A1/256A1
... from datasheet https://docs.rs-online.com/908d/0900766b81596516.pdf
2023-04-23 13:45:19 +01:00
MCUdude
cb96dc39b6 Update avrdude.texi 2023-04-23 11:56:22 +02:00
MCUdude
7c4d5fa9d1 Add missing -xhelp 2023-04-23 11:53:59 +02:00
Stefan Rueger
00c30532af Add variants of obsolete parts 2023-04-22 18:39:33 +01:00
Stefan Rueger
2ebed6e84e Link up fuses and fuse0 ... fuse9 memories for dryrun programmer
When fuseX is written to that fuses is also changed and vice versa.
2023-04-22 18:23:40 +01:00
MCUdude
765d63ddec Update avrdude.1 2023-04-21 23:44:24 +02:00
MCUdude
ba64553620 Add missing .El 2023-04-21 21:07:35 +02:00
MCUdude
0e7702b03a Initialize sscanf_success to zero 2023-04-21 19:54:16 +02:00