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

Moving stack from TCM to external DDR2 SDRAM

  • Note: This was originally posted on 17th November 2011 at http://forums.arm.com

    Ok, figured it out.

    That setup seems to be A-Ok, as far as I know (let me know otherwise).  However, when filling the stack with a pattern (which I was doing by accessing the SP) instead of starting at the SP - 4 (going lower in addresses) I was starting at SP.

    There may be other things wrong, but at least my stack analysis seems to be ok and not crashing into Abort_Handler now.
  • Note: This was originally posted on 22nd November 2011 at http://forums.arm.com

    One more question:  In a given function, does SP point to the highest used address on the stack?  Or does it point to, say, the first used address of the local function, and, if the local function used, say, 12 bytes, SP, SP - 4, and SP - 8 are all used, so if I was looking for the address of the first *unused* byte (4-byte) location, I'd have to look at SP - 12?
  • Note: This was originally posted on 23rd November 2011 at http://forums.arm.com

    SP points to the last thing that was allocated on the stack, unless the stack is empty, in which case it points right past the stack. So if you allocate 3 words in a function they'll be accessible at [ sp ], [ sp + 4 ], and [ sp + 8 ]. The allocation itself will be performed by subtracting 12 from the stack pointer. Unallocated memory starts immediately at addresses below the stack pointer.