2013-12-15 04:23 AM
Hello.
I use STM3210C-eval board. I program it with Keil V4.70.0.0 . I want to fill the unused memory area so if program counter corrupt and jumps to unused area , I create an reset.How do ı fill unused area with reset vector ?2013-12-16 02:44 AM
It does not work like that.
If the program resides in internal Flash - unprogramed Flash defaults to 0xff. If your program ever jumps to an area of un-programmed Flash, all the 0xff will result in invalid op-codes (invalid machine code). This in turn will generate an IRQ (which one I forget). So all you have to do is to make the ISRs (the ones you are not coding yourself to so something) do a reset. FYI - most debuggers and programmers (like ST Link Util) will allow you to fill memory (RAM or Flash) BUT do not do it unless you know what you are doing!2013-12-16 03:01 AM
If your program ever jumps to an area of un-programmed Flash, all the 0xff
will result in invalid op-codes (invalid machine code). This in turn will generate an IRQ (which one I forget). BTW, the Microchip PIC12/16/18 have this ''feature'' the OP is asking for. This MCUs interpret 0xFF as instruction code ''NOP'', so busy-ignoring unprogrammed Flash and unimplemented memory in his small 64k adress range. I don't view this as an advantage, rather a method to hide bad programming style and subtle bugs ...2013-12-16 03:56 AM
I haven't done it recently, but Keil used to be able to use the scatter file to fill memory regions.
http://www.keil.com/support/docs/3407.htm