At the end of the start-up I would like to change from the privileged mode to user mode. I use the following code:
mrs r0, CPSR ; take a copy of the CPSR
bic r0, r0, #0x1F ; clear the mode bits
orr r0, r0, #0x10 ; select new mode
msr CPSR_c, r0 ; write back the modified CPSR
As the last line is executed, I get a Data Abort Interrupt!
What happens with the stack pointer as I change the mode? In privileged mode the SP starts at 0x08001100, but in user mode at 0x08001000.