Does anyone have any good way to protect an AVR from accidential flash / erase commands?
Imagine, a bug in the application software causes a jump into the bootloader - that just happens to be around the code that calls page erase or page write - so that routine does what's it's supposed to, writes random data to a random page or erases a random page. There is no protection, SPM works b/c we are in bootloader code.
How can you protect from this - seems the lock bits are no good b/c once you set them you have to do a chip erase to clear them.
Ideally you would be able to stop the chip from being able to jump to any code in the bootloader, only being able to get there from a reset. But this isn't a reality.
Thanks for any thoughts Ralph