Custom Bootloader query

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Scribe on Mon Sep 10 05:19:27 MST 2012
Hi guys,

I'm currently writing the code for a custom bootloader and am tripping over myself a little with memory allocation.
From what I gather with the ARM compiler, globals and statics head into RW CODE space, not on the stack.

In my situation, I have a two stage bootloader and application code.

I'm guessing I'll have to reserve space for any globals so that the second stage doesn't overwrite anything in the first stage, my question then is, when branching from my first stage to the second stage, what's the best way to deal with the stack pointer? I'll still be using the main stack at this point.

Does anyone have any recommendations or suggestions of approaches that they've tried before and gotten along with?

Many thanks