Dear Nordic.
I am developing bootloader without SD (s120_nrf51822_1.0.1). And after execution of bootloader, jump to application working with SD.
Flash composed like below.
- SD is placed into 0x0000 (size: 0x18000)
- Bootloader is placed into 0x18000 (size: 0x5000)
- Application is placed into 0x20000 (size:0x10000)
RAM used like below.
- Bootloader working without SD. (0x1000 ~ 0x4000)
- Application working with SD. (0x2800 ~ 0x4000)
I modified code from sample: nrf51822_v4.4 - Bootloader_Without_SD.
Below means, code for jump to [CODE_REGION_1_START] after reset ?
LDR R2, =CODE_REGION_1_START;
MRS R0, PSR ;
/* Mask the interrupt number only */
MOVS R1, #0x3F ;
ANDS R0, R1 ; /*R0 keeps the interrupt number*/
extern bootloader_active;
LDR R1 , =bootloader_active;
LDR R2, [R1];
CMP R2,#1;
///////////////////////////////////
LDR R2, =CODE_REGION_1_START; // <- this code
///////////////////////////////////
/* Irq address position = IRQ No * 4 */
LSLS R0, R0, #2 ;
/* Fetch the user vector offset */
LDR R0, [R0, R2];
/* Jump to user interrupt vector */
BX R0 ;
And could I use RAM (0x1000 ~ 0x3000), before softdevice is enabled ?
Best and regards.