Commit Graph

3530 Commits

Author SHA1 Message Date
stefanrueger
f2b1c7e6cd Update NEWS 2024-04-05 17:13:23 +13:00
Stefan Rueger
89768468be Merge pull request #1731 from mcuee/avrdude_packing_fix
To use Static Libs for macOS arduino_packing build
2024-04-05 17:11:48 +13:00
Stefan Rueger
a8097eaee3 Merge pull request #1729 from stefanrueger/timestamp
Change return type for avr_(ms|us)timestamp() to uint64_t
2024-04-05 17:10:00 +13:00
stefanrueger
08f70fe666 Update NEWS 2024-04-05 16:54:16 +13:00
Stefan Rueger
cb61171598 Merge pull request #1724 from stefanrueger/progress-reporting
Document progress reporting in source code
2024-03-30 09:26:27 +13:00
Stefan Rueger
82e45130b8 Merge branch 'main' into progress-reporting 2024-03-30 09:19:22 +13:00
stefanrueger
840a098e29 Update NEWS 2024-03-30 09:16:44 +13:00
Stefan Rueger
22a7bf9be9 Merge pull request #1728 from stefanrueger/msg2_left_margin
Provide lmsg_xyz() functions to start message at left margin
2024-03-30 09:14:14 +13:00
mcuee
9b7d4d832b To use Static Libs for macOS arduino_packing build
This is pointed out by @umbynos during the review of PR #1690
2024-03-29 18:47:17 +08:00
Stefan Rueger
0f216357a6 Merge branch 'main' into msg2_left_margin 2024-03-29 23:24:53 +13:00
Joerg Wunsch
67867a6776 Update NEWS 2024-03-29 11:05:29 +01:00
Jörg Wunsch
8516243630 Merge pull request #1730 from stefanrueger/remove_avrdude_message
Remove unused avrdude_message()

Fixes #1719
2024-03-29 11:04:34 +01:00
Joerg Wunsch
39eea9649d Add note about why avrdude_message2() is named that way. 2024-03-29 10:23:08 +01:00
Joerg Wunsch
674128cebc Update NEWS for recent PR/issue 2024-03-29 10:18:43 +01:00
Jörg Wunsch
0ff5e84f10 Merge pull request #1727 from dl8dtl/fix-1726
Replace msg_info() by msg_debug() in jtag3_prmsg() and jtag3_prevent()

Closes #1726
2024-03-29 10:17:32 +01:00
stefanrueger
d91a48242e Remove unused avrdude_message() 2024-03-29 19:55:34 +13:00
stefanrueger
f027493e3f Change return type for avr_(ms|us)timestamp() to uint64_t 2024-03-29 19:42:07 +13:00
stefanrueger
a26c4343dc Keep vertical tab at start of format string as conditional new line 2024-03-29 13:56:17 +13:00
stefanrueger
7f9f82de2e Add MSG2_LEFT_MARGIN flag in lieu of \v messaging convention
Some messaging needs a functionality to end an open line, so that the next
message starts at the left margin, ie, the ability to print a \n if and
only if the last printed character was not already a \n.

This used to be effected by \v as first char in the message format.

This commit introduces a dedicated lmsg_xyz() set of messaging functions
that utilises a MSG2_LEFT_MARGIN flag to enforce a left margin start for
the message.
2024-03-29 13:43:22 +13:00
Joerg Wunsch
b00c284289 Replace msg_info() by msg_debug() in jtag3_prmsg() and jtag3_prevent()
Both these functions are called at verbosity level DEBUG and above,
so they must not produce INFO level messages.

Supposed to fix issue #1726
2024-03-28 10:18:31 +01:00
stefanrueger
07669a9d40 Document progress reporting in source code 2024-03-27 14:07:07 +13:00
stefanrueger
34366a6b9d Update test-avrdude help message 2024-02-29 20:26:57 +13:00
stefanrueger
27eb695c21 Update NEWS 2024-02-29 11:46:58 +13:00
Stefan Rueger
076e2e90cd Merge pull request #1709 from stefanrueger/benchmark
Add benchmark option `-b` for `test-avrdude`
2024-02-29 11:41:38 +13:00
Stefan Rueger
e5304a4d59 Merge pull request #1707 from ndim/fix-cmake-builds-related-to-ac_cfg.h
Fix cmake build errors related to ac_cfg.h
2024-02-29 11:41:17 +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
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
Hans Ulrich Niedermann
92e2dd44ff Fix cmake not finding generated ac_cfg.h
When there is no `src/ac_cfg.h` (e.g. a fresh `git clone` or after
a working dir cleanup like `git -f -d -x`), running `cmake` will
complain about not being able to find `ac_cfg.h`.

This is probably because cmake looks for source files in the
`CMAKE_CURRENT_SOURCE_DIR`, but when cmake creates `ac_cfg.h`
it does so ´CMAKE_CURRENT_BINARY_DIR`, which is often different.

Anyway, this makes the location of files generated by `configure_file`
explicit as `CMAKE_CURRENT_BINARY_DIR`, and uses that same location
in the source file list for the `libavrdude` target (instead of just
`ac_cfg.h` with the implicit `CMAKE_CURRENT_SOURCE_DIR`) and adds the
same source file to the `avrdude` target to allow cmake to determine
the dependencies properly.
2024-02-26 00:31:15 +01:00
Hans Ulrich Niedermann
dfcd5cc6d8 Directly use AVRDUDE_FULL_VERSION string macro
Directly use the AVRDUDE_FULL_VERSION macro instead of first
defining an initialized variable which is never changed and
then using that variable.

This means one less layer of indirection both for the computer
and for the programmer to go through when trying to understand
the code.
2024-02-26 00:14:20 +01:00
Hans Ulrich Niedermann
5c891b347e gitignore: Files generated by "cmake ." 2024-02-26 00:13:54 +01:00
stefanrueger
2078871273 Update NEWS 2024-02-25 13:58:09 +13:00
Stefan Rueger
a8112b9ae8 Merge pull request #1703 from stefanrueger/avr-ids
Abbreviate ids of modern AVR parts
2024-02-25 13:54:33 +13:00
Stefan Rueger
d23e30736b Allow slash in part variant name for -p (#1702)
Developer options are added to part names or wildcards by a / suffix
followed by a the option characters. However, some part variant names also
contain a slash, eg, AVR64DB64-E/MR. This commit gives priority to such a
variant name and does not interpret the slash as developer option.
2024-02-25 13:53:34 +13:00
Stefan Rueger
3c346acfdf Merge pull request #1700 from stefanrueger/report-progress
Fix reporting of too short r/w times for files with holes
2024-02-25 13:52:51 +13:00
Stefan Rueger
a6b5acecf6 Merge pull request #1699 from stefanrueger/remove-port-array
Change port array in PROGRAMMER to be const char *
2024-02-25 13:52:26 +13:00
stefanrueger
8552760727 Add comment re use of libavrdude 2024-02-24 12:41:51 +13:00
stefanrueger
5c61b9e770 Update NEWS 2024-02-24 00:49:12 +13:00
Stefan Rueger
08d14154b7 Merge branch 'main' into remove-port-array 2024-02-24 00:28:30 +13:00
Stefan Rueger
2425ee98a6 Merge pull request #1689 from dbuchwald/serialupdi_doc_update
Updated section about NVM models support
2024-02-24 00:26:24 +13:00