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

Modify stack dimension in main main application

I am using an LPC2478

i have a firmware like this:

1) the bootloader hardcoded in the micro does some stuff and jumps to 0x00000000
2) my bootloader at 0x00000000 executes startup.s (where it sets stack location and dimension for every mode), checks the main application code and if all is ok jumps to 0x00010000
3) at 0x00010000 there is another startup.s code that tries to set new stack dimensions, but it fails except for user mode (of course, i understand why), then it jumps to the main() function
4) in the main function i set MEMAP = 0x02 and map the vector table to internal ram (all is working) so i can implement SWI when i need them

problem:
stack dimension and location remain the same of the bootloader at 0x00000000 except for user mode and i don't think this is right, i would want to modify stack also for the other modes when i am in the main application

question:
there is a right way/place to change stack for special modes in the main application?
using SWI maybe?
where, in the beginning of main(), after MEMMAP instruction?

thank for your answers