I am working on AT32UC3A3128s and new to microcontroller programming. These is no bootloader currently. And we are burning HEX file in AVR Micro's memory. It is having 128 KB flash memory.
I wanted to make sure every time it boots, it will do a self integrity check.
1. How can i do that ?
2. I came with approach that in last partition of flash we can keep MD5 or SHA HASH of firmware. Let me know if this is good approach.
3. Before that First of all I have to calculate MD5or SHA HASH of firmware and burn it at this last partition of flash. But How can I write simple program to write 256bit SHA Value at last partition. Can someone help ?
4. After Step3 above, once AVR Micro boots, in existing firmware, it should check it''s own MD5 or SHA HASH and compare it with one stored in last partition. How can I write this program.>?
I am newbie absolute begineer in microcontroller programming, I worked on OS based Embedded Systems.