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

Cortex-M1 Set Initial SP Value and the Reset Value

Hello, I hope someone can help me

I am using a Cortex-M1, and I need to used a external memory from where the program code will be executed. the program code should starts from the address 0xF000 (size 0x8000), and the data will start at 0x20100000 (size 0x8000).

Is it possible to set the Initial SP Value and the Reset Value in ARM assembler at an arbitrary address in memory? When i run the simulation the program is stuck, what i should modified in the startup file ?

Using the dialog for target in Keil 

i got the Scatter file 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x000F0000 0x00008000 { ; load region size_region
ER_IROM1 0x000F0000 0x00008000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20100000 0x00008000 { ; RW data
.ANY (+RW +ZI)
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Here is the startup file

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;<h> Stack Configuration
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
;</h>
Stack_Size EQU 0x00000400
AREA STACK, NOINIT, READWRITE, ALIGN=3
__stack_limit
Stack_Mem SPACE Stack_Size
__initial_sp
;<h> Heap Configuration
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
;</h>
Heap_Size EQU 0x00000400
IF Heap_Size != 0 ; Heap is provided
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

 

0