A protected boot loader, checksumming the file, and verifying after write would prevent the majority of "bricked" CPUs due to a bad flash.
Even better is if the CPU contained two banks/blocks of program memory, and each firmware update is written to the alternate bank, verified, then the vectors re-assigned. A failed update would simply revert back to the previous version still intact in the other bank. I don't know how easy this is to do on PIC24 devices, but if the code is written to be relocatable, or jump addresses are adjusted during the flashing process, it should be doable as long as the CPU has at least 2x the program memory needed to store the firmware.
Asset protection can be provided through encryption of the file (and decrypted by the boot loader during the flash), and using the PIC's built in program memory protection features.
I wonder, if one has a bricked CPU if it could be resurrected using a valid firmware file and a PIC programming tool.





Reply With Quote
Connect With Us