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

AVR109 auto reset functionality #1697

Open
MCUdude opened this issue Feb 21, 2024 · 2 comments
Open

AVR109 auto reset functionality #1697

MCUdude opened this issue Feb 21, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@MCUdude
Copy link
Collaborator

MCUdude commented Feb 21, 2024

First pointed out here:

My bootloader doesn't need an IO pin to enter bootloader mode. It automatically enters bootloader mode after the MCU resets itself and return to application after 500ms to 4s (the compiled hex has a 1 second delay), so the first upload is free, since there is no code in the application section. The second upload, you need to press the reset button. AVR109 doesn't issue an DTR or RTS signal on serial, so auto upload is not possible with avr109.

We should consider adding DTR/RTS toggling to the avr109 programming option as we do with urclock, arduino, and wiring, as this would make it easier to enter bootloader mode using a simple auto-reset circuit.

@MCUdude MCUdude added the enhancement New feature or request label Feb 21, 2024
@MCUdude
Copy link
Collaborator Author

MCUdude commented Feb 22, 2024

I've pushed a development branch here:
https://github.com/MCUdude/avrdude/tree/avr109-autoreset

However, I've not been able to find a bootloader that with auto reset, and doesn't work without it.
I've tried Xboot, and if I set USE_ENTER_UART = yes in the arduino328p.conf.mk file, it jumps straight into the bootloader even though no auto reset. And if I use no, I'm not able to enter bootloader mode, not even with auto reset present.

@stefanrueger
Copy link
Collaborator

Your development branch looks neat and tidy

  • Does the usleep(250 * 1000) really need to be that long? 50 ms is plenty to discharge the reset cap (should work even for C = 10 µF and R = 5k). -c arduino needs that long sleep b/c the optiboot bootloader needs a 200 ms pause between two successive calls. -c xbee might need a long pause perhaps b/c it involves sending packets over the air, but the standard AVR109 board?
  • Would it not be better to keep default behaviour at not plucking the reset line? I just imagine someone's board might blow up if DTR is suddenly toggled
  • Documentation would be cool

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

No branches or pull requests

2 participants