Open diggit opened 1 year ago
Just for clarification, do you refer to -DENABLE_WRITEPROT feature? Have you checked out upgrade/README and the upgrade firmware? The idea is: you flash an upgrader app, then use it to disable the protection mecanism. Since you need a power cycle to unlock it for real (as you correctly mention), you can use the upgrade/client.exe to reset into "update mode", which essentially tells the bootloader not to lock the bootloader. During that time window, you can upgrade the bootloader.
Does that make sense? Of course if your bootloader is older than 1c4802 then the bootloader doesnt do the right thing and indeed, it re-locks the flash on reset. Hope this helps!
It's almost impossible to erase device with enabled write protection in bootloader, because you need to change option bytes, then do power cycle and then mass erase. Issues it, after power cycle, bootloader again re-locks write access and erasing is not possible. The only solution was manual write of magic value into upper 8 bytes of RAM to prevent auto flash write lock and then doing mass erase.