LUFA bootloaders ought to disable interrupts during program page operations

37 views
Skip to first unread message

inizen

unread,
Nov 9, 2012, 4:35:43 AM11/9/12
to lufa-s...@googlegroups.com
Hi Dean:

I found some old 2008 posts on this, but I have been playing with your bootloaders and noticed that my test runs had very occasional word errors (words left at 0xFFFF) in the bootloaded code. I'm fairly sure this is caused by not disabling interrupts during the programming phase (while the bootloader is firing out time-sensitive SPM instructions). Your code might work because there is no USB activity (hence no USB interrupts) during a program page operation but I think my LED flash timer was causing a problem. The sample code on http://www.nongnu.org/avr-libc/user-manual/group__avr__boot.html temporarily disables interrupts and it would seem an obviously bad idea to unpredictably interrupt a program page operation. When I disabled interrupts my 0xFFFF glitches went away.

Regards,

Martin

Dean Camera

unread,
Dec 11, 2012, 7:32:55 PM12/11/12
to LUFA Library Support List
Hi Martin,

Sorry I missed this one (need to put better GMail filters in place to
highlight support threads I haven't answered). You've got a good point
- I couldn't find any explicit information in the memory section of
the datasheet that spells out what would happen with the interrupts,
but it can't be a good idea either way. Can you please add a bug
report to the tracker (http://www.lufa-lib.org/tracker) so that I
don't forget about this? I'll fix it up when I'm back at my primary
development machine in early January.

Cheers!
- Dean

Martin Lambert

unread,
Dec 13, 2012, 2:21:06 PM12/13/12
to lufa-s...@googlegroups.com
Hi Dean:

I filed this as a bug as requested.

Regards,

Martin

Dean Camera

unread,
Dec 13, 2012, 7:00:08 PM12/13/12
to LUFA Library Support List
Thanks Martin! I'll patch it when I'm back at my main machine.

- Dean
Reply all
Reply to author
Forward
0 new messages