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 support for Flip 2 reset on exit #1102

Merged
merged 8 commits into from
Oct 5, 2022
Merged

Conversation

MCUdude
Copy link
Collaborator

@MCUdude MCUdude commented Sep 24, 2022

This allows the application to start immediately after the program has been loaded. Simply use -E reset or -E noreset. Default is no reset. Tested on my Xplained ATxmega256A3BU board.

I've currently not added anything to the docs. The Flip 2 protocol is hardly even mentioned, and I'm not sure where to put the additional information that Flip2 supports -E reset.

Closes #733

This makes it possible for the application to start immedeatly after the program has been loaded.
Simply use '-E reset' or '-E noreset'. Default is no reset.
Closes avrdudes#733
@MCUdude
Copy link
Collaborator Author

MCUdude commented Sep 24, 2022

I have no idea why this doesn't build on the MacOS CI. It builds perfectly fine with no warnings on my mac using make.

@mcuee mcuee added the enhancement New feature or request label Sep 25, 2022
@MCUdude
Copy link
Collaborator Author

MCUdude commented Sep 25, 2022

I've been using make up until now since it works well and the commands are easy to remember. However, I decided to use Cmake to figure out why it fails on macOS. However, I'm getting an FTDI-related error even though I have libftdi1 installed.
Not sure what the deal is.

$ cmake -D CMAKE_C_FLAGS=-I/opt/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/local/lib -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_macos
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DO HAVE    libftdi (but prefer to use libftdi1)
-- DO HAVE    libftdi1
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/hans/Downloads/avrdude/build_macos

$ cmake --build build_macos
[  1%] Generating avrdude.conf
[  1%] Built target conf
Consolidate compiler generated dependencies of target libavrdude
[  3%] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.o
[  4%] Building C object src/CMakeFiles/libavrdude.dir/avr.c.o
[  6%] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.o
[  7%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.o
In file included from /Users/hans/Downloads/avrdude/src/avrftdi.c:41:
/Users/hans/Downloads/avrdude/src/avrftdi_private.h:16:10: fatal error: 'ftdi.h' file not found
#include <ftdi.h>
         ^~~~~~~~
1 error generated.
make[2]: *** [src/CMakeFiles/libavrdude.dir/avrftdi.c.o] Error 1
make[1]: *** [src/CMakeFiles/libavrdude.dir/all] Error 2
make: *** [all] Error 2

@mcuee
Copy link
Collaborator

mcuee commented Sep 25, 2022

No idea why the macOS github action build failed. I have no issues building this pull request.

mcuee@mcuees-Mac-mini avrdude_hans % git checkout flip2-reset
branch 'flip2-reset' set up to track 'origin/flip2-reset'.
Switched to a new branch 'flip2-reset'

mcuee@mcuees-Mac-mini avrdude_hans % ./build.sh 
-- The C compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /opt/homebrew/bin/git (found version "2.37.3") 
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DO HAVE    libftdi (but prefer to use libftdi1)
-- DO HAVE    libftdi1
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mcuee/build/avr/avrdude_test/avrdude_hans/build_darwin
[  1%] Generating avrdude.conf
[  1%] Built target conf
[  3%] [FLEX][Parser] Building scanner with flex 2.6.4
[  4%] [BISON][Parser] Building parser with bison 2.3
Consolidate compiler generated dependencies of target libavrdude
[  6%] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.o
[  7%] Building C object src/CMakeFiles/libavrdude.dir/avr.c.o
[  9%] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.o
[ 10%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.o
[ 12%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi_tpi.c.o
[ 14%] Building C object src/CMakeFiles/libavrdude.dir/avrpart.c.o
[ 15%] Building C object src/CMakeFiles/libavrdude.dir/bitbang.c.o
[ 17%] Building C object src/CMakeFiles/libavrdude.dir/buspirate.c.o
[ 18%] Building C object src/CMakeFiles/libavrdude.dir/butterfly.c.o
[ 20%] Building C object src/CMakeFiles/libavrdude.dir/config.c.o
[ 21%] Building C object src/CMakeFiles/libavrdude.dir/confwin.c.o
[ 23%] Building C object src/CMakeFiles/libavrdude.dir/crc16.c.o
[ 25%] Building C object src/CMakeFiles/libavrdude.dir/dfu.c.o
[ 26%] Building C object src/CMakeFiles/libavrdude.dir/fileio.c.o
[ 28%] Building C object src/CMakeFiles/libavrdude.dir/flip1.c.o
[ 29%] Building C object src/CMakeFiles/libavrdude.dir/flip2.c.o
[ 31%] Building C object src/CMakeFiles/libavrdude.dir/ft245r.c.o
[ 32%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkI.c.o
[ 34%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkII.c.o
[ 35%] Building C object src/CMakeFiles/libavrdude.dir/jtag3.c.o
[ 37%] Building C object src/CMakeFiles/libavrdude.dir/linuxgpio.c.o
[ 39%] Building C object src/CMakeFiles/libavrdude.dir/linuxspi.c.o
[ 40%] Building C object src/CMakeFiles/libavrdude.dir/lists.c.o
[ 42%] Building C object src/CMakeFiles/libavrdude.dir/micronucleus.c.o
[ 43%] Building C object src/CMakeFiles/libavrdude.dir/par.c.o
[ 45%] Building C object src/CMakeFiles/libavrdude.dir/pgm.c.o
[ 46%] Building C object src/CMakeFiles/libavrdude.dir/pgm_type.c.o
[ 48%] Building C object src/CMakeFiles/libavrdude.dir/pickit2.c.o
[ 50%] Building C object src/CMakeFiles/libavrdude.dir/pindefs.c.o
[ 51%] Building C object src/CMakeFiles/libavrdude.dir/ppi.c.o
[ 53%] Building C object src/CMakeFiles/libavrdude.dir/ppiwin.c.o
[ 54%] Building C object src/CMakeFiles/libavrdude.dir/serbb_posix.c.o
[ 56%] Building C object src/CMakeFiles/libavrdude.dir/serbb_win32.c.o
[ 57%] Building C object src/CMakeFiles/libavrdude.dir/ser_avrdoper.c.o
[ 59%] Building C object src/CMakeFiles/libavrdude.dir/ser_posix.c.o
[ 60%] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.o
[ 62%] Building C object src/CMakeFiles/libavrdude.dir/serialupdi.c.o
[ 64%] Building C object src/CMakeFiles/libavrdude.dir/stk500.c.o
[ 65%] Building C object src/CMakeFiles/libavrdude.dir/stk500v2.c.o
[ 67%] Building C object src/CMakeFiles/libavrdude.dir/stk500generic.c.o
[ 68%] Building C object src/CMakeFiles/libavrdude.dir/teensy.c.o
[ 70%] Building C object src/CMakeFiles/libavrdude.dir/updi_link.c.o
[ 71%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm.c.o
[ 73%] Building C object src/CMakeFiles/libavrdude.dir/updi_readwrite.c.o
[ 75%] Building C object src/CMakeFiles/libavrdude.dir/updi_state.c.o
[ 76%] Building C object src/CMakeFiles/libavrdude.dir/usbasp.c.o
[ 78%] Building C object src/CMakeFiles/libavrdude.dir/usb_hidapi.c.o
[ 79%] Building C object src/CMakeFiles/libavrdude.dir/usb_libusb.c.o
[ 81%] Building C object src/CMakeFiles/libavrdude.dir/usbtiny.c.o
[ 82%] Building C object src/CMakeFiles/libavrdude.dir/update.c.o
[ 84%] Building C object src/CMakeFiles/libavrdude.dir/wiring.c.o
[ 85%] Building C object src/CMakeFiles/libavrdude.dir/xbee.c.o
[ 87%] Building C object src/CMakeFiles/libavrdude.dir/__/lexer.c.o
[ 89%] Building C object src/CMakeFiles/libavrdude.dir/__/config_gram.c.o
[ 90%] Linking C static library libavrdude.a
[ 90%] Built target libavrdude
Consolidate compiler generated dependencies of target avrdude
[ 92%] Building C object src/CMakeFiles/avrdude.dir/main.c.o
[ 93%] Building C object src/CMakeFiles/avrdude.dir/term.c.o
[ 95%] Building C object src/CMakeFiles/avrdude.dir/avrintel.c.o
[ 96%] Building C object src/CMakeFiles/avrdude.dir/developer_opts.c.o
[ 98%] Building C object src/CMakeFiles/avrdude.dir/whereami.c.o
[100%] Linking C executable avrdude
[100%] Built target avrdude

Build succeeded.

Run

sudo cmake --build build_darwin --target install

to install.


@mcuee
Copy link
Collaborator

mcuee commented Sep 25, 2022

I've been using make up until now since it works well and the commands are easy to remember. However, I decided to use Cmake to figure out why it fails on macOS. However, I'm getting an FTDI-related error even though I have libftdi1 installed. Not sure what the deal is.

$ cmake -D CMAKE_C_FLAGS=-I/opt/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/local/lib -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_macos

That is strange. Are you using macports or homebrew? Can you just try using build.sh?

@MCUdude
Copy link
Collaborator Author

MCUdude commented Sep 25, 2022

@mcuee I'm using brew.

Here's the output when executing build.sh:

$ ./build.sh
-- The C compiler identification is AppleClang 10.0.1.10010046
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/local/bin/git (found version "2.30.0") 
-- Found FLEX: /usr/bin/flex (found version "2.5.35") 
-- Found BISON: /usr/bin/bison (found version "2.3")
-- Looking for libelf.h
-- Looking for libelf.h - not found
-- Looking for libelf/libelf.h
-- Looking for libelf/libelf.h - found
-- Looking for usb.h
-- Looking for usb.h - found
-- Looking for lusb0_usb.h
-- Looking for lusb0_usb.h - not found
-- Looking for libusb.h
-- Looking for libusb.h - not found
-- Looking for libusb-1.0/libusb.h
-- Looking for libusb-1.0/libusb.h - found
-- Looking for hidapi/hidapi.h
-- Looking for hidapi/hidapi.h - found
-- Looking for ftdi_tcioflush
-- Looking for ftdi_tcioflush - found
-- Configuration summary:
-- ----------------------
-- DO HAVE    libelf
-- DO HAVE    libusb
-- DO HAVE    libusb_1_0
-- DO HAVE    libhidapi
-- DO HAVE    libftdi (but prefer to use libftdi1)
-- DO HAVE    libftdi1
-- DISABLED   doc
-- DISABLED   parport
-- DISABLED   linuxgpio
-- DISABLED   linuxspi
-- ----------------------
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/hans/Downloads/avrdude/build_darwin
[  1%] Generating avrdude.conf
[  1%] Built target conf
[  3%] [FLEX][Parser] Building scanner with flex 2.5.35
[  4%] [BISON][Parser] Building parser with bison 2.3
[  6%] Building C object src/CMakeFiles/libavrdude.dir/arduino.c.o
[  7%] Building C object src/CMakeFiles/libavrdude.dir/avr.c.o
[  9%] Building C object src/CMakeFiles/libavrdude.dir/avr910.c.o
[ 10%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi.c.o
[ 12%] Building C object src/CMakeFiles/libavrdude.dir/avrftdi_tpi.c.o
[ 14%] Building C object src/CMakeFiles/libavrdude.dir/avrpart.c.o
[ 15%] Building C object src/CMakeFiles/libavrdude.dir/bitbang.c.o
[ 17%] Building C object src/CMakeFiles/libavrdude.dir/buspirate.c.o
[ 18%] Building C object src/CMakeFiles/libavrdude.dir/butterfly.c.o
[ 20%] Building C object src/CMakeFiles/libavrdude.dir/config.c.o
[ 21%] Building C object src/CMakeFiles/libavrdude.dir/confwin.c.o
[ 23%] Building C object src/CMakeFiles/libavrdude.dir/crc16.c.o
[ 25%] Building C object src/CMakeFiles/libavrdude.dir/dfu.c.o
[ 26%] Building C object src/CMakeFiles/libavrdude.dir/fileio.c.o
[ 28%] Building C object src/CMakeFiles/libavrdude.dir/flip1.c.o
[ 29%] Building C object src/CMakeFiles/libavrdude.dir/flip2.c.o
[ 31%] Building C object src/CMakeFiles/libavrdude.dir/ft245r.c.o
[ 32%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkI.c.o
[ 34%] Building C object src/CMakeFiles/libavrdude.dir/jtagmkII.c.o
[ 35%] Building C object src/CMakeFiles/libavrdude.dir/jtag3.c.o
[ 37%] Building C object src/CMakeFiles/libavrdude.dir/linuxgpio.c.o
[ 39%] Building C object src/CMakeFiles/libavrdude.dir/linuxspi.c.o
[ 40%] Building C object src/CMakeFiles/libavrdude.dir/lists.c.o
[ 42%] Building C object src/CMakeFiles/libavrdude.dir/micronucleus.c.o
[ 43%] Building C object src/CMakeFiles/libavrdude.dir/par.c.o
[ 45%] Building C object src/CMakeFiles/libavrdude.dir/pgm.c.o
[ 46%] Building C object src/CMakeFiles/libavrdude.dir/pgm_type.c.o
[ 48%] Building C object src/CMakeFiles/libavrdude.dir/pickit2.c.o
[ 50%] Building C object src/CMakeFiles/libavrdude.dir/pindefs.c.o
[ 51%] Building C object src/CMakeFiles/libavrdude.dir/ppi.c.o
[ 53%] Building C object src/CMakeFiles/libavrdude.dir/ppiwin.c.o
[ 54%] Building C object src/CMakeFiles/libavrdude.dir/serbb_posix.c.o
[ 56%] Building C object src/CMakeFiles/libavrdude.dir/serbb_win32.c.o
[ 57%] Building C object src/CMakeFiles/libavrdude.dir/ser_avrdoper.c.o
[ 59%] Building C object src/CMakeFiles/libavrdude.dir/ser_posix.c.o
[ 60%] Building C object src/CMakeFiles/libavrdude.dir/ser_win32.c.o
[ 62%] Building C object src/CMakeFiles/libavrdude.dir/serialupdi.c.o
[ 64%] Building C object src/CMakeFiles/libavrdude.dir/stk500.c.o
[ 65%] Building C object src/CMakeFiles/libavrdude.dir/stk500v2.c.o
[ 67%] Building C object src/CMakeFiles/libavrdude.dir/stk500generic.c.o
[ 68%] Building C object src/CMakeFiles/libavrdude.dir/teensy.c.o
[ 70%] Building C object src/CMakeFiles/libavrdude.dir/updi_link.c.o
[ 71%] Building C object src/CMakeFiles/libavrdude.dir/updi_nvm.c.o
[ 73%] Building C object src/CMakeFiles/libavrdude.dir/updi_readwrite.c.o
[ 75%] Building C object src/CMakeFiles/libavrdude.dir/updi_state.c.o
[ 76%] Building C object src/CMakeFiles/libavrdude.dir/usbasp.c.o
[ 78%] Building C object src/CMakeFiles/libavrdude.dir/usb_hidapi.c.o
[ 79%] Building C object src/CMakeFiles/libavrdude.dir/usb_libusb.c.o
[ 81%] Building C object src/CMakeFiles/libavrdude.dir/usbtiny.c.o
[ 82%] Building C object src/CMakeFiles/libavrdude.dir/update.c.o
[ 84%] Building C object src/CMakeFiles/libavrdude.dir/wiring.c.o
[ 85%] Building C object src/CMakeFiles/libavrdude.dir/xbee.c.o
[ 87%] Building C object src/CMakeFiles/libavrdude.dir/__/lexer.c.o
[ 89%] Building C object src/CMakeFiles/libavrdude.dir/__/config_gram.c.o
[ 90%] Linking C static library libavrdude.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(confwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppi.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppiwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(serbb_win32.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ser_win32.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(confwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppi.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ppiwin.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(serbb_win32.c.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libavrdude.a(ser_win32.c.o) has no symbols
[ 90%] Built target libavrdude
[ 92%] Building C object src/CMakeFiles/avrdude.dir/main.c.o
[ 93%] Building C object src/CMakeFiles/avrdude.dir/term.c.o
[ 95%] Building C object src/CMakeFiles/avrdude.dir/avrintel.c.o
[ 96%] Building C object src/CMakeFiles/avrdude.dir/developer_opts.c.o
[ 98%] Building C object src/CMakeFiles/avrdude.dir/whereami.c.o
[100%] Linking C executable avrdude
[100%] Built target avrdude

Build succeeded.

Run

sudo cmake --build build_darwin --target install

to install.

@mcuee
Copy link
Collaborator

mcuee commented Sep 26, 2022

@mcuee I'm using brew.

Here's the output when executing build.sh:

Glad that build.sh works. Since you are using brew, you need to change /opt/local to /usr/local when you use CMake command directly without using build.sh.

cmake -D CMAKE_C_FLAGS=-I/opt/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/local/lib 
-D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_macos

@mcuee
Copy link
Collaborator

mcuee commented Sep 26, 2022

@MCUdude
But for the github action, it seems to complain about the following. Not so sure why. Probbaly you can try to kick the github action again.

/Users/runner/work/avrdude/avrdude/src/flip2.c:144:12: warning: function 'flip2_parseexitspecs' has internal linkage but is not defined [-Wundefined-internal]
static int flip2_parseexitspecs(PROGRAMMER* pgm, const char *s);
           ^
/Users/runner/work/avrdude/avrdude/src/flip2.c:192:[27](https://github.com/avrdudes/avrdude/actions/runs/3119742568/jobs/5059891637#step:5:28): note: used here
  pgm->parseexitspecs   = flip2_parseexitspecs;
                          ^
/Users/runner/work/avrdude/avrdude/src/flip2.c:1[34](https://github.com/avrdudes/avrdude/actions/runs/3119742568/jobs/5059891637#step:5:35):12: warning: unused function 'flip2_start_app' [-Wunused-function]
static int flip2_start_app(const PROGRAMMER *pgm);
           ^
2 warnings generated.

@mariusgreuel
Copy link
Contributor

@MCUdude Seems like you missed to implement flip2_parseexitspecs for !defined(HAVE_LIBUSB). For some reason, the macos-x86_64 build has only libusb-1.0. That was probably not intentional, but it seems it now serves as a testcase for libusb-1.0 only builds :-).

That said, other programmers just populate open when not available. I think I like this pattern better, rather than having to implement a bunch of stubs. Perhaps you want to change flip2 to use this pattern as well.

For instance, see https://github.com/avrdudes/avrdude/blob/main/src/micronucleus.c#L971-L984

Used when compiling without libusb. Print reasonable error instead
@MCUdude
Copy link
Collaborator Author

MCUdude commented Sep 27, 2022

Thanks for the hint @mariusgreuel! the CI compiles just fine now. Any thoughts regarding the documentation?

I've currently not added anything to the docs. The Flip 2 protocol is hardly even mentioned [in the docs], and I'm not sure where to put the additional information that Flip2 supports -E reset / -E noreset.

@stefanrueger
Copy link
Collaborator

Very good PR.

where to put the additional information that Flip2 supports -E reset

I'd suggest to add a sentence at the end of the -E exitspecs[,exitspecs] explantion to the effect of All parallel programmers support the full set of exit specifications whilst linuxspi and flip2 only support the reset and noreset exit specifications.

Fun fact: This PR differs in its -E parsing from all the other programmers that support it; here, in flip2, -E reset,noreset or -E reset,reset fails whilst I predict from reading the code that these would parse in all other programmers that support exit specs.

My little punctuation tic prefers

   avrdude_message(MSG_INFO, "%s: error, no USB support; please compile with libusb installed\n", progname);

over https://github.com/MCUdude/avrdude/blob/e1a317c6704f21433329673bf1f6b12397d03ea7/src/flip2.c#L943 I know that avrdude: error: this. And that went wrong. messages appear in some programmers, but that doesn't mean we should perpetuate that style. 😉

Overall an excellent contribution, which we should merge (even if above isn't addressed).

@MCUdude
Copy link
Collaborator Author

MCUdude commented Sep 30, 2022

I'd suggest to add a sentence at the end of the -E exitspecs[,exitspecs] explantion to the effect of All parallel programmers support the full set of exit specifications whilst linuxspi and flip2 only support the reset and noreset exit specifications.

Do you want to do this yourself, or do you want me to give it a try? I'm not very familiar with texi, so it usually takes a while to figure out the formatting.

Fun fact: This PR differs in its -E parsing from all the other programmers that support it; here, in flip2, -E reset,noreset or -E reset,reset fails whilst I predict from reading the code that these would parse in all other programmers that support exit specs.

If you want, I can implement the linuxspi implementation (and test it before pushing).

My little punctuation tic prefers

No worries, I've just pushed a fix.

Use the same implementation as linuxspi does, instead of the one suggested in avrdudes#733
@MCUdude
Copy link
Collaborator Author

MCUdude commented Sep 30, 2022

Fun fact: This PR differs in its -E parsing from all the other programmers that support it; here, in flip2, -E reset,noreset or -E reset,reset fails whilst I predict from reading the code that these would parse in all other programmers that support exit specs.

If you want, I can implement the linuxspi implementation (and test it before pushing).

I realized that the way linuxspi implemented exitspecs was more robust, so I borrowed that implementation instead. I've tested it, and it works, even with -E reset,reset.

I'd suggest to add a sentence at the end of the -E exitspecs[,exitspecs] explantion to the effect of All parallel programmers
support the full set of exit specifications whilst linuxspi and flip2 only support the reset and noreset exit specifications.

Perhaps it would make sense to create a dedicated page for programmers that supports one or more exitspecs?
IMO it would fit quite nicely between 2.1 and 2.2, or 2.2 and 2.3:
https://avrdudes.github.io/avrdude/current/avrdude_2.html#Command-Line-Options

@stefanrueger
Copy link
Collaborator

https://avrdudes.github.io/avrdude/current/avrdude_2.html#Command-Line-Options

I never knew this existed. Until now I only have known of avrdude.1 and doc/avrdude.texi. Looks like above link is a bit outdated... Is that html-tree created from avrdude.texi or from yet another independent docu source?

Perhaps it would make sense to create a dedicated page for programmers that supports one or more exitspecs?

There aren't that many: I suspect -E used to be exclusively for par type programmers (and one can tell that the current explanation of -E still has this perspective); then linuxspi came along allowing -E [no]reset, and now just flip2. So, wondering whether this warrants a subchapter of the docs. Until now quite a few installations of avrdude would not compile code for parallel interfaces or linuxspi, so -E wouldn't apply at all to them.

Do you want to do this yourself, or do you want me to give it a try?

Neater if you do it as you will have a better grasp of the motivation and significance of this PR. My simple sentence might be on the terse side.

@MCUdude
Copy link
Collaborator Author

MCUdude commented Oct 1, 2022

Docs updated, please review 👍

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

Successfully merging this pull request may close these issues.

[patch #9563] New feature: ability to reset FLIPv2 targets
4 participants