Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add avrdude_conf_version to grammar #1547

Merged
merged 2 commits into from
Oct 30, 2023

Conversation

stefanrueger
Copy link
Collaborator

@mcuee mcuee added bug Something isn't working enhancement New feature or request labels Oct 30, 2023
@mcuee
Copy link
Collaborator

mcuee commented Oct 30, 2023

Great. This fixed the issue for git main.

$ ./avrdude_pr1547
Usage: avrdude_pr1547 [options]
Options:
  -p <partno>            Specify AVR device; -p ? lists all known parts
  -p <wildcard>/<flags>  Run developer options for matched AVR devices,
                         e.g., -p ATmega328P/s or /S for part definition
  -b <baudrate>          Override RS-232 baud rate
  -B <bitclock>          Specify bit clock period (us)
  -C <config-file>       Specify location of configuration file
  -c <programmer>        Specify programmer; -c ? and -c ?type list all
  -c <wildcard>/<flags>  Run developer options for matched programmers,
                         e.g., -c 'ur*'/s for programmer info/definition
  -A                     Disable trailing-0xff removal for file/AVR read
  -D                     Disable auto erase for flash memory; implies -A
  -i <delay>             ISP Clock Delay [in microseconds]
  -P <port>              Connection; -P ?s or -P ?sa lists serial ones
  -r                     Reconnect to -P port after "touching" it; wait
                         400 ms for each -r; needed for some USB boards
  -F                     Override invalid signature or initial checks
  -e                     Perform a chip erase
  -O                     Perform RC oscillator calibration (see AVR053)
  -t                     Run an interactive terminal when it is its turn
  -T <terminal cmd line> Run terminal line when it is its turn
  -U <memtype>:r|w|v:<filename>[:format]
                         Carry out memory operation when it is its turn
                         Multiple -t, -T and -U options can be specified
  -n                     Do not write to the device whilst processing -U
  -V                     Do not automatically verify during -U
  -E <exitsp>[,<exitsp>] List programmer exit specifications
  -x <extended_param>    Pass <extended_param> to programmer, see -xhelp
  -v                     Verbose output; -v -v for more
  -q                     Quell progress output; -q -q for less
  -l logfile             Use logfile rather than stderr for diagnostics
  -?                     Display this usage

avrdude version 7.2-20231030 (2736663b), https://github.com/avrdudes/avrdude

$ cat avrdude_pr1547.conf | head -n 10
# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#

avrdude_conf_version = "7.2-20231030 (2736663b)";

# This file contains AVRDUDE's default configuration data describing
# programming hardware pinouts and part definitions. Normally, it
# requires AVRDUDE be of the same or higher version than above string.

$ ./avrdude_pr1547 -C ./avrdude_pr1547.conf -c urclock -P ch340 -p m328p
avrdude_pr1547: AVR device initialized and ready to accept instructions
avrdude_pr1547: device signature = 0x1e950f (probably m328p)

avrdude_pr1547 done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Oct 30, 2023

As mentioned in the following comment, we still need to fix configure.ac.

@mcuee
Copy link
Collaborator

mcuee commented Oct 30, 2023

The following patch mentioned by @Youw seems to work. The only thing is that it does not contains the git commit ID (but consistent with the existing avrdude). It is better to have the commit ID since we may have several commits on the same date.

However, I think we can live with this for now with the auto-tools build.

/c/work/avr/avrdude_test/avrdude_pr1547
$ git diff
diff --git a/src/configure.ac b/src/configure.ac
index a67dac28..9f4f0cb1 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -543,8 +543,9 @@ AC_CONFIG_FILES([
        Makefile
 ])

-# Pass into avrdude.conf.in
-AVRDUDE_FULL_VERSION='$(VERSION)'
+# Pass version number into avrdude.conf
+AVRDUDE_FULL_VERSION=$PACKAGE_VERSION
+AC_SUBST(AVRDUDE_FULL_VERSION, $AVRDUDE_FULL_VERSION)

 # The procedure to create avrdude.conf involves two steps.  First,
 # normal autoconf substitution will be applied, resulting in

$ cd src/

$ head -n 10 avrdude.conf
# $Id$ -*- text -*-
#
# AVRDUDE Configuration File
#

avrdude_conf_version = "7.2-20230720";

# This file contains AVRDUDE's default configuration data describing
# programming hardware pinouts and part definitions. Normally, it
# requires AVRDUDE be of the same or higher version than above string.

@MCUdude
Copy link
Collaborator

MCUdude commented Oct 30, 2023

@stefanrueger Please add this to configure.ac, as previously done in #1545

# Pass version number into avrdude.conf
AVRDUDE_FULL_VERSION=$PACKAGE_VERSION
AC_SUBST(AVRDUDE_FULL_VERSION, $AVRDUDE_FULL_VERSION)

@stefanrueger
Copy link
Collaborator Author

@MCUdude Like so?

diff --git a/src/configure.ac b/src/configure.ac
index a67dac28..9f4f0cb1 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -543,8 +543,9 @@ AC_CONFIG_FILES([
        Makefile
 ])
 
-# Pass into avrdude.conf.in
-AVRDUDE_FULL_VERSION='$(VERSION)'
+# Pass version number into avrdude.conf
+AVRDUDE_FULL_VERSION=$PACKAGE_VERSION
+AC_SUBST(AVRDUDE_FULL_VERSION, $AVRDUDE_FULL_VERSION)
 
 # The procedure to create avrdude.conf involves two steps.  First,
 # normal autoconf substitution will be applied, resulting in

I don't understand this change, as I don't know where PACKAGE_VERSION is coming from... Your PR #1545 did another change that I now cannot remember that conflicted with git main.

@MCUdude
Copy link
Collaborator

MCUdude commented Oct 30, 2023

Yes, just like so.

$PACKAGE_VERSION is the version number passed to AC_INIT, and is a built-in feature of autoconf (I think).

AC_INIT(avrdude, 7.2-20230720, [email protected])

autoconf AC_INIT:
https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Initializing-configure.html

#1545 also did some changes to CMakeLists.txt, but this wasn't intentional, and git refused to remove this commit from the PR. So the only thing you need to deal with is to add AVRDUDE_FULL_VERSION to configure.ac

@stefanrueger
Copy link
Collaborator Author

Brilliant. Thanks for the explanation. Seeing that this PR will reverse the breakage of git main I suggest merging out of order soon. I can see the benefit of checking the independent version strings for AVRDUDE and avrdude.conf to issue a warning, but as this check is a bit more involved I will leave this for later, ideally for someone else (@MCUdude?)

@mcuee We have all pushed commits that break git main; letting a PR hang around for a couple of days is a great way for identifying teething problems 😉

@mcuee
Copy link
Collaborator

mcuee commented Oct 30, 2023

@mcuee We have all pushed commits that break git main; letting a PR hang around for a couple of days is a great way for identifying teething problems 😉

Noted and thanks.

@MCUdude
Copy link
Collaborator

MCUdude commented Oct 30, 2023

I can see the benefit of checking the independent version strings for AVRDUDE and avrdude.conf to issue a warning, but as this check is a bit more involved I will leave this for later, ideally for someone else (@MCUdude?)

Good! I'll see what I can do. Feel free to merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants