I have a decision on how to fill unused memory in a flash device. I've heard of populating with reset instructions as a safe way to handle rogue pointers, etc. Is there a concept of an assembly reset instruction for armv7a processors? Is there an industry standard on how I should fill the contents of this flash? Default erased 0xFF values?
Asked
Active
Viewed 94 times
1 Answers
5
I do not think there is an industry standard. However:
Code
Conveniently, all 0xff is an undefined instruction for both arm and thumb encoding (according to objdump). That means if your program counter happens to wind up in empty flash space, your system will take an exception. Your exception handler can then reset the system to recover.
Data
Also 0xffffffff conveniently is an odd number. This means that when dereferenced as word-sized pointer, it will trigger a bus fault. This exception you can also handle to reset your system.
corecode
- 1,162
- 8
- 13