Commit Graph

116 Commits

Author SHA1 Message Date
Stefan Rueger
73d8a49c7a Percolate LIBAVRDUDE_EXIT_* return value to caller 2026-06-18 14:07:49 +01:00
Stefan Rueger
65468c08de Improve function description 2026-06-14 13:24:58 +01:00
Stefan Rueger
ccf27a4736 Remove write protection from jmp-to-application vector
When serving a vector bootloader, both -c urclock and now -c dryboot used
to protect two vectors in the vector table, the reset vector and the
dedicated vector to jump to the application.

Only the reset vector needs protecting to avoid the vector bootloader to
be bricked. While overwriting the other vector might turn out not helpful,
it's the same as with many other interventions, so much so that the driver
should not prevent that. Hence, this commit withdraws the protection of
the jmp-to-application vector.
2026-04-05 09:49:19 +01:00
Stefan Rueger
d1544c18ef Provide urbootPutVersion() 2026-04-02 22:51:41 +01:00
Stefan Rueger
7752adf740 Provide set_resetvector() 2026-04-02 12:29:14 +01:00
Stefan Rueger
944e347dfd Provide reset2addr() 2026-04-02 00:20:06 +01:00
Stefan Rueger
e7532789af Utilise avr_opcodes.c functions 2026-04-01 19:00:21 +01:00
Stefan Rueger
29f319b38f Improve comments 2026-04-01 18:59:38 +01:00
stefanrueger
d4308096a9 Differentiate LIBAVRDUDE_EXIT_FAIL and ..._EXIT_OK
LIBAVRDUDE_EXIT was introduced to allow driver function to tell main.c
that all is done and avrdude should exit(0) indicating success. For
example, processing the -x help options in the driver should exit.

There have been increasingly more situations when the driver function
needed to return and suppress error messages from the caller; for these
LIBAVRDUDE_EXIT was used but now avrdude wrongly indicated success to the
shell when it should indicate an error.

This commit replaces LIBAVRDUDE_EXIT with LIBAVRDUDE_EXIT_FAIL or
LIBAVRDUDE_EXIT_OK as appropriate indicating error or success to the
shell, respectively.
2025-10-31 20:02:37 +01:00
stefanrueger
009aa3615f Unify xxx_open() debug message for urclock 2025-10-24 11:33:00 +02:00
stefanrueger
d480116642 Check rjmp at reset can reach bootloader 2025-05-26 15:50:55 +02:00
stefanrueger
3dcc775c49 Skip disable() only for low baud rates
Bootloader can WDT reset swiftly on disable, which is too little time for
low baud rates to send handshake OK byte.
2025-05-21 08:03:20 +02:00
stefanrueger
3ff62b42d5 Read in chunks that bootloader can send within WDT timeout 2025-05-20 02:17:09 +02:00
stefanrueger
1d978db9e6 Skip unnecessary disable() call 2025-05-20 02:16:28 +02:00
stefanrueger
ce093df4e6 Lengthen timeouts for lower baud rates 2025-05-19 20:47:44 +02:00
stefanrueger
46893bed3d Sharpen warning messages
pgm->type is an internal string that is unknown to users; in fact, even
developers don't necessarily know it well. This commit replaces references
to pgm->type to the more specific -c programmer (that the user provided).
2025-05-09 16:22:25 +02:00
MCUdude
6932030972 Update bitclock help text 2025-05-08 22:07:05 +02:00
MCUdude
0f7d4d24f3 Add warning messages for programmers that doesn't support -B 2025-05-08 09:53:09 +02:00
stefanrueger
45d093224b Provide functions for jmp/rjmp opcodes 2025-04-22 20:28:58 +02:00
Stefan Rueger
3e9672481c Reduce use of upload/download terms 2024-08-23 23:16:39 +01:00
Stefan Rueger
00422f3f29 Change xxx->prog_modes & PM_ABCD to is_abcd(xxx) 2024-08-18 16:25:34 +01:00
Stefan Rueger
8e4474058a Reformat spacing/comments in src/urclock.c 2024-08-18 01:54:34 +01:00
Stefan Rueger
a91c0dbce4 Review imgs_ continuation messages 2024-08-03 01:54:16 +01:00
Stefan Rueger
cf0822bb71 Update look and feel 2024-08-01 01:17:24 +01:00
Stefan Rueger
bf3ca02fe0 Merge pull request #1850 from ndim/remove-svn-tags
Remove obsolete SVN $Id$ tags from source files
2024-07-31 17:03:11 +01:00
Stefan Rueger
0fe0470cfe Merge pull request #1844 from MCUdude/avr109-autorst
Extended parameters (`-x` and `-E`) improvements
2024-07-31 17:02:18 +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
Stefan Rueger
df5d1feb89 Add remaining spaces after -x in messages 2024-07-29 16:24:40 +01:00
Stefan Rueger
f37e5930df Clarify invalid value messages for valid -x parameters ...
... and generally massage messaging around -x parameters
2024-07-29 16:15:11 +01:00
Stefan Rueger
c3d97e923e Add -xnoautoreset for the -c urclock programmer 2024-07-28 17:57:51 +01:00
Stefan Rueger
e594863f95 Provide op_width() and z_width() 2024-07-27 11:05:06 +01:00
Stefan Rueger
7162711ebc Refine opcode_mnemo() to consider reduced-core parts 2024-07-23 16:01:28 +01:00
Stefan Rueger
1ce7d82d34 s/\buPcore_t\b/Avrintel/g 2024-05-20 01:03:00 +01:00
Stefan Rueger
6d136a129c Rename struct programmer_t to PROGRAMMER 2024-05-20 00:44:02 +01:00
Stefan Rueger
4c05994f23 s/\bUrclock_t\b/Urclock_data/g 2024-05-18 01:44:25 +01:00
Stefan Rueger
79ac24b8a4 s/\bBlhash_t\b/Bl_hash/g 2024-05-18 01:33:58 +01:00
Stefan Rueger
42a1fe646f Merge pull request #1808 from stefanrueger/urboot_v8_preparation
Prepare for next urboot version
2024-05-17 23:25:20 +00:00
Stefan Rueger
6962d79dc9 Update u8.0+ capability printing 2024-05-17 15:55:48 +01:00
Stefan Rueger
8075b90172 Update capability bit definitions 2024-05-17 14:49:31 +01:00
Stefan Rueger
0f9032e6c3 Set vbl level from vector number for urboot v8.0+ 2024-05-17 14:40:26 +01:00
Stefan Rueger
3b2bbb393f Harden checks for urboot presence 2024-05-17 14:25:38 +01:00
Stefan Rueger
2dc946f263 Reserve high bit of vector number and number of pages 2024-05-17 13:01:57 +01:00
Stefan Rueger
cdf3dea749 Assert vecsz variable as const 2024-05-17 11:57:57 +01:00
Stefan Rueger
9f69a6e09a Put static variables of avr.c into context structure
... and convert static memory for strings returned by avr_prog_modes()
into closed-circuit memory area in the context structure
2024-05-06 22:37:09 +01:00
Stefan Rueger
8212836693 Silence MacOS compiler warning 2024-04-27 13:40:00 +01:00
Stefan Rueger
9d76a3619c return LIBAVRDUDE_EXIT instead of exit(0) 2024-04-22 15:17:47 +01:00
Stefan Rueger
af5f7ee565 Utilise magic memory tree interface for urclock.c 2024-04-19 12:35:39 +01:00
stefanrueger
f027493e3f Change return type for avr_(ms|us)timestamp() to uint64_t 2024-03-29 19:42:07 +13:00
Hans Ulrich Niedermann
9616b3709c Look for generated ac_cfg.h in builddir first
As it can happen that there is a leftover `src/ac_cfg.h` when
running an out of tree cmake build (you might have run `cmake .`
or `./src/bootstrap`), the out of tree cmake build must look
for `ac_cfg.h` in its builddir first (e.g. `build_linux/src/`).

Otherwise the cmake build picks up and uses whatever data happens
to be in `src/ac_cfg.h`.

Both the MSVC and GCC C processors are documented to look in the
location of the `#include` directive for the included file first
for double quoted includes, so the old `#include "ac_cfg.h"` was
exactly the wrong thing to do. clang probably does the same, and
ISO C specifies the sequence of places to look for include files
as implementation defined.

So this changes all occurrences of `#include "ac_cfg.h"` to
`#include <ac_cfg.h>` which follows the sequence of `-I` or `/I`
directives as cmake builds add via `include_directories` or
`target_include_directories`.

Fixes: https://github.com/avrdudes/avrdude/issues/1706
2024-02-26 00:31:22 +01:00
stefanrueger
75eccf7d8e Change port array in PROGRAMMER to be const char * 2024-02-22 15:33:49 +13:00