Commit Graph

1940 Commits

Author SHA1 Message Date
Stefan Rueger 602e9bb80c Change size for memory type variable in terminal read 2022-07-12 11:44:20 +01:00
Stefan Rueger 7205bbae80 Enhance terminal read with new mode: read <memory> <addr> 2022-07-12 11:43:45 +01:00
Stefan Rueger aa09bcf900 Ensure terminal writes little endian numbers 2022-07-12 11:42:59 +01:00
Stefan Rueger ddffabe86a Improve terminal write usage message 2022-07-12 11:40:40 +01:00
Stefan Rueger 0b2f38c67d Allow optional comma separators for data items in terminal write 2022-07-12 11:39:52 +01:00
Stefan Rueger 5c4cfa642a Parse terminal writes of string and character constants in C-style 2022-07-12 11:39:02 +01:00
Stefan Rueger 9fe6820236 Add double type for terminal write in anticipation of future avr-libc extension 2022-07-12 11:36:57 +01:00
Stefan Rueger feda75b60a Remove unnecessary bool is_float in terminal write 2022-07-12 11:35:27 +01:00
Stefan Rueger 51355d04fb Remodel logic of the size that integer items occupy in terminal write
Integers can be hexadecimal, decimal or octal. An optional case-insensitive
suffix specifies their size: HH: 8 bit, H/S: 16 bit, L: 32 bit, LL: 64 bit

An optional U suffix makes a number unsigned. Ordinary 0x hex numbers are
always treated as unsigned. +0x or -0x hex numbers are treated as signed
unless they have a U suffix. Unsigned integers cannot be larger than 2^64-1.

If n is an unsigned integer then -n is also a valid unsigned integer as in C.

Signed integers must fall into the [-2^63, 2^63-1] range or a correspondingly
smaller range when a suffix specifies a smaller type. Out of range signed
numbers trigger a warning.

Ordinary 0x hex numbers with n hex digits (counting leading zeros) use
the smallest size of 1, 2, 4 and 8 bytes that can accommodate any n-digit hex
number. If a suffix specifies a size explicitly the corresponding number of
least significant bytes are written. Otherwise, signed and unsigned integers
alike occupy the smallest of 1, 2, 4, or 8 bytes needed to accommodate them
in their respective representation.
2022-07-12 11:32:38 +01:00
Stefan Rueger 62d3eebd56 Fix 64-bit integer terminal write where high bit set
Using strtoll() can only return numbers in the range [-2^63, 2^63-1]. This
means that 0xffffFFFFffffFFFF (2^64-1) will be out of range and is written as
max LL. Actually, every 64-bit number with high-bit set will wrongly be
written as max LL.

This commit uses strtoull() instead to fix this, and checks for unsiged out-
of-range error. strtoull() also has the neat benefit that input with a minus
sign is treated like C unsigned numbers, ie, -u is also a valid unsigned
number if only u is one. In case the input is meant to be treated as signed,
it is therefore still OK to use strtoull() in the first instance only that in
this case a second check against the range of the signed domain is necessary.
2022-07-12 11:19:47 +01:00
Stefan Rueger 9afa56381e Remove unused component is_signed in terminal write 2022-07-12 11:19:05 +01:00
Stefan Rueger ff43e0544d Correct a parse message in terminal write 2022-07-12 11:18:15 +01:00
Stefan Rueger 177834ae7c Ensure enough memory is allocated for buf in terminal write 2022-07-12 11:16:16 +01:00
Stefan Rueger d3ad078577 Ensure terminal write fill mode ... always fills with last data item 2022-07-12 11:15:30 +01:00
Stefan Rueger 39a00bc71e Ensure +0x...f does not strip suffix f in terminal write 2022-07-12 11:14:41 +01:00
Stefan Rueger 360d7c502b Make suffix fully case insensitive (allow Hh, Ll, ...) in terminal write 2022-07-12 11:13:46 +01:00
Stefan Rueger d9450058c8 Cache strlen(argv[i]) in term.c cmd_write() and prevent negative array index 2022-07-12 11:12:20 +01:00
Stefan Rueger 64ee4858fd Update 2nd debug message in avr.c with correct function name 2022-07-05 01:00:45 +01:00
Stefan Rueger d3b22fa3c6 Update debug message in avr.c with correct function name 2022-07-05 00:57:40 +01:00
Stefan Rueger 9742c7b97a Add #474 and #976 to NEWS 2022-07-05 00:55:58 +01:00
Stefan Rueger 00ea21597e
Merge pull request #1001 from MCUdude/add-missing-bits-and-pieces
Add missing delays in avrdude.conf
2022-07-05 00:05:32 +01:00
Stefan Rueger 9ea02c4431
Merge pull request #998 from stefanrueger/issue474
Fix Issue #474 FT232H support for ATmega2560 et al (load extended address)
2022-07-05 00:00:54 +01:00
Stefan Rueger 2b6ee8f4d1 Adapt whitespace to existing style in avrftdi.c 2022-07-04 23:54:02 +01:00
Stefan Rueger bb049a085e Merge branch 'issue474' of github.com:stefanrueger/avrdude into issue474 2022-07-04 12:31:11 +01:00
Stefan Rueger 237cb63211 Steamline avrftdi support for ATmega2560 et al 2022-07-04 12:30:37 +01:00
Stefan Rueger 2827c2695e Update NEWS 2022-07-04 12:30:37 +01:00
Joerg Wunsch bdab12d8fb PR 996 and 1013 done 2022-07-04 12:30:37 +01:00
MCUdude d2bb964fc7 Attempt to fix EEPROM write issue #1009 2022-07-04 12:30:37 +01:00
Joerg Wunsch f22b81c00e Fix a number of logic errors in the previous commits
RSP3_FAIL_CRC_FAILURE is 0x43 rather than 0x47.

jtag3_errcode() must only be applied to a reason code, not
to any general status code.
2022-07-04 12:30:37 +01:00
Joerg Wunsch 8953967fc3 Replace internal knowledge in jtag3.c by a public API
In certain situations (CRC failure, device locked), that JTAG3
read functions need to return an indication to the caller that
it is OK to proceed, and allow erasing the device anyway.

Historically, the JTAG3 code passed the respective protocol
errors directly (and unexplained) up to the caller, leaving
the decision to the caller how to handle the situation.

Replace that by a more common return value API. New code should
prefer this API instead of any hardcoded return values.
2022-07-04 12:30:37 +01:00
Stefan Rueger ef785a617a Treat x bits in .conf SPI commands as 0 2022-07-04 12:30:37 +01:00
Joerg Wunsch ad2be990b7 PR 993 done 2022-07-04 12:30:37 +01:00
prchal 134509cc6f adding support for all Linux baud rates v.2
If optiboot can work at higher bauds, why not avrdude.
Versoin 2 of #985.
Linux uses the old-style bitmapped version of the Bxxxx macros.
2022-07-04 12:30:37 +01:00
Joerg Wunsch 8bd39157c1 Closing PR 979 2022-07-04 12:30:37 +01:00
MCUdude 963a1e54af Fix JTAG transaction close issue
Fixes issue #366
2022-07-04 12:30:37 +01:00
Joerg Wunsch 37026cad52 PR #1000 is done now 2022-07-04 12:30:37 +01:00
MCUdude b167e88422 Reduce programmer description string length
to less than 80 characters. #941 related
2022-07-04 12:30:37 +01:00
Stefan Rueger 3893a21164 Fix avrftdi support for ATmega2560 et al (load extended address) 2022-07-04 12:30:25 +01:00
Stefan Rueger d95c1a91f7 Steamline avrftdi support for ATmega2560 et al 2022-07-04 12:25:50 +01:00
Stefan Rueger c4add116d6
Merge branch 'avrdudes:main' into issue474 2022-07-04 10:07:05 +01:00
Stefan Rueger 66c69a7584
Merge pull request #943 from stefanrueger/issue942
Fix Issue #942: Treat x bits in .conf SPI commands as 0
2022-06-28 22:50:53 +01:00
Stefan Rueger 43c6b04226 Update NEWS 2022-06-28 22:46:06 +01:00
Stefan Rueger a21f3d20af
Merge branch 'avrdudes:main' into issue942 2022-06-28 22:38:47 +01:00
Joerg Wunsch a6ea797c1c PR 996 and 1013 done 2022-06-28 22:53:24 +02:00
Jörg Wunsch 8cd6f357b1
Merge pull request #1013 from MCUdude/jtag3-eeprom-fix
JTAG3 UPDI EEPROM fix
2022-06-28 22:36:19 +02:00
Jörg Wunsch 7ec51a5185
Merge pull request #996 from dl8dtl/jtag3_retcode
Replace internal knowledge in jtag3.c by a public API

Supersedes #982
2022-06-28 22:21:50 +02:00
Stefan Rueger 09c168a186
Merge branch 'avrdudes:main' into issue942 2022-06-28 20:56:49 +01:00
Stefan Rueger cef3abac14
Merge branch 'avrdudes:main' into issue474 2022-06-26 23:54:43 +01:00
Joerg Wunsch 362e6993ac PR 993 done 2022-06-26 23:00:32 +02:00
Jörg Wunsch 6d1c83e182
Merge pull request #993 from prchal/patch-1
adding support for all Linux baud rates
2022-06-26 22:59:49 +02:00