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

Guard urclock_getsync() against initial spurious input #1251

Merged
merged 3 commits into from
Dec 31, 2022

Conversation

stefanrueger
Copy link
Collaborator

Fixes Issue #1245

@stefanrueger stefanrueger added the bug Something isn't working label Dec 30, 2022
@stefanrueger stefanrueger linked an issue Dec 30, 2022 that may be closed by this pull request
@stefanrueger
Copy link
Collaborator Author

stefanrueger commented Dec 31, 2022

Under Linux with urclock boards and legacy bootloaders no -xdelay=... is needed. The following bash script tests 20 delays from -15 ms to 80 ms.

for d in {-15..80..5}; do
  avrdude -curclock -pm328p -xdelay=$d -xshowall >& /dev/null
  echo -n $? | tr 01 .X
done; echo

A . means the -xdelay= value works; an X means it fails. Delay 0 (absence of -xdelay=...) is the fourth result letter:

Bootloader Result Result with -xstrict Comments
u7.5 we--h-r-. .................... .................... All good
u7.6 w-u-jpr-. .................... .................... All good
u7.7 weu-jPr-c .................... .................... All good
u7.7 weu-jPrac X................... .................... -xdelay=n OK for n >= -10
o8.3 --s-h-r-- .................... X............X...... Some -xdelay do not work
o4.4 --s-h-r-- .................... XXXXXXXXXXXXXXXXXXXX optiboot v4.4 must not use -xstrict
x0.0 ......... XXXXXXXXXXXXXXXXXXXX .................... picoboot must use -xstrict

@stefanrueger
Copy link
Collaborator Author

Decided to lengthen delay after issuing reset for benefit of autobaud bootloaders: it really is the first byte from avrdude that makes autobaud bootloaders set their USART divisor, so we better make sure the board has had enough time to come out of reset. @mcuee had a Nano clone board that needed a bit longer (under Windows) so better to increase the margin.

Also changed from warning to notice2 the info on libreadline.

So, am going to merge so we are ready for a New Year release :)

@stefanrueger stefanrueger merged commit f0649d7 into avrdudes:main Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

urclock communication issues
1 participant