Skip to main content
Visitor II
March 21, 2006
Question

Clear SRAM at startup

  • March 21, 2006
  • 2 replies
  • 723 views
Posted on March 21, 2006 at 06:01

Clear SRAM at startup

    This topic has been closed for replies.

    2 replies

    ezanen9Author
    Visitor II
    March 14, 2006
    Posted on March 14, 2006 at 07:31

    Hi all,

    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 corrupted PC jumps to it.

    I think that the only way to do this is to clear SRAM in the init.s.

    But in the init.s I can only write assembly code. 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 with 0xFFFFFF that I can put in the init.s?

    Thanks,

    Jimmey

    ezanen9Author
    Visitor II
    March 20, 2006
    Posted on March 20, 2006 at 05:42

    Hi and thanks RISC,

    But is this code for the STR710 MCU?

    My compiler doesn't think so!

    I checked the assembly code and I can not find it in the instruction set for my MCU. (ARM7TDMI downloaded from www.ARM.com)

    To clear my question:

    I like to fill the hole SRAM starting at 0x20000000 with 0xFFFFFFF in my startup.s/init.s file.

    Regards,

    Jimmey