Optiboot / optiboot

Small and Fast Bootloader for Arduino and other Atmel AVR chips
Other
1.08k stars 396 forks source link

ATmega328P timeout setting #369

Closed swiftgeek closed 1 year ago

swiftgeek commented 1 year ago

If I understand correctly TIMEOUT option defines how long to wait for serial input, when eg. external reset was detected. This is not clear to me from documentation

https://github.com/Optiboot/optiboot/blob/55d1e6b36922e4b8e3a32e6cea8ec03127ed65bf/optiboot/bootloaders/optiboot/optiboot.c#L922

I could not observe 8 second long timeout using following command to build and flash: make atmega328_isp AVR_FREQ=16000000L BIGBOOT=1 LED=B5 LED_DATA_FLASH=1 BAUD_RATE=115200 ISPTOOL=usbasp LOCKFUSE=CF TIMEOUT=8 Observed delay to starting app is closer to 1-2 seconds (from releasing reset button).

Being worried about knockoffs I prepared a sketch to test whether 8S watchdog is indeed available and working, and confirmed all values working as expected on my ATmega328P devices. https://gist.github.com/swiftgeek/66891fe9dc569aede9fdaeecc16aacaa

ATmega328P datecodes:

avr-libc version: 2.1.0 avr-gcc version: 12.2.0 used optiboot commit: 55d1e6b

swiftgeek commented 1 year ago

Only after posting stumbled upon this forum thread and noticed that changing parameters indeed does not trigger a rebuild.

So simply issuing make clean before each build makes it work as expected