Hi! On Thu, 2021-02-11 at 14:53 +0100, Ralf Herrmann wrote: > > > <https://savannah.nongnu.org/bugs/?60008> > > > > > > Summary: linuxspi programmer does not seem to release > > > AVR > > > reset when finished > > > > ... > > > > > linuxspi.c and did not see any code that releases the reset > > > GPIO line of the AVR. > > > > is it rather about supporting "-E noreset" for linuxspi programmer, which > > is currently unsupported? > > No, i did not mean to refer to this option. > > When you select linuxspi as your programmer in r1450, > avrdude will put the AVR into reset via GPIO, do all the operations > you ask from it (e.g. upload new flash image), and then exit. > > During avrdude exit, AVR reset is never deactivated, i.e. it remains > in reset state. You have to manually release the reset via GPIO to be > able to work with the AVR when you used avrdude to do something. > > As i wrote in my bug report, i'm not sure if it was intended like this, > however, an old version of avrdude with support for linuxspi and > reset GPIO which i found does indeed release the AVR reset before it > finishes.
After trying to implement "-E noreset" or "-E reset" I understood, that it's actually not possible with the current ioctl linux API. SYSFS API which was used in the forked avrdude preserved the GPIO state as long as the pin was exported to SYSFS. The new API releases the pin automatically and it's up to the particular driver what it does, some do reset it to the "input" mode. And the new ioctl API is incompatible with the old SYSFS API (one cannot ioctl as long as the pin is exported to SYSFS). Seems, we have to deal with it outside of avrdude. -- Alexander Sverdlin.
