This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

filling SRAM before startup

Hi all,

I am using the STR710 MCU from ST-microelectronics.

To catch undefined program counter jumps to the SRAM I want to fill my hole SRAM with 0xFFFFFFFF(undefined instruction) before my C-program is entered. This way the unused (large) area of SRAM will not generate undefined behaviour when the possibly corrupted PC jumps to it.

I think that the only way to do this is to clear SRAM in the Startup.s.
But in the Startup.s I can only write assembly code and compiler bependent statements. Because I am not able to write this I have the following question:

Does someone have an example, tips or a ready to use piece of assembly code that clears the hole SRAM(0 till 64kbyte starting at 0x20000000)with 0xFFFFFF that I can put in the Startup.s?

Thanks,

Erik

0