Skip to content

Commit 402f95b

Browse files
committed
fw: add linker templates for Pebble boards
Signed-off-by: Liam McLoughlin <[email protected]>
1 parent 82b01f3 commit 402f95b

4 files changed

+105
-0
lines changed

Diff for: src/fw/stm32f2xx_flash_fw.ld.template

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MEMORY
2+
{
3+
KERNEL_RAM (xrw) : ORIGIN = @KERNEL_RAM_ADDR@, LENGTH = @KERNEL_RAM_SIZE@
4+
WORKER_RAM (xrw) : ORIGIN = @WORKER_RAM_ADDR@, LENGTH = @WORKER_RAM_SIZE@
5+
APP_RAM (xrw) : ORIGIN = @APP_RAM_ADDR@, LENGTH = @APP_RAM_SIZE@
6+
7+
/* Bootloader now ends at 0x8008000, once we're sure we won't break */
8+
/* current watches, we should take advantage of this free space. */
9+
FLASH (rx) : ORIGIN = @FW_FLASH_ORIGIN@, LENGTH = @FW_FLASH_LENGTH@
10+
}
11+
12+
__FLASH_start__ = @FLASH_ORIGIN@;
13+
__FLASH_size__ = @FLASH_SIZE@;
14+
15+
REGION_ALIAS("REGION_ISR_STACK", KERNEL_RAM);
16+
REGION_ALIAS("REGION_KERNEL_STACKS", KERNEL_RAM);
17+
REGION_ALIAS("REGION_KERNEL_HEAP", KERNEL_RAM);
18+
19+
@BOOTLOADER_SYMBOLS@
20+

Diff for: src/fw/stm32f412_flash_fw.ld.template

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
MEMORY
2+
{
3+
KERNEL_RAM (xrw) : ORIGIN = @KERNEL_RAM_ADDR@, LENGTH = @KERNEL_RAM_SIZE@
4+
WORKER_RAM (xrw) : ORIGIN = @WORKER_RAM_ADDR@, LENGTH = @WORKER_RAM_SIZE@
5+
APP_RAM (xrw) : ORIGIN = @APP_RAM_ADDR@, LENGTH = @APP_RAM_SIZE@
6+
7+
/* Bootloader now ends at 0x8008000, once we're sure we won't break */
8+
/* current watches, we should take advantage of this free space. */
9+
FLASH (rx) : ORIGIN = @FW_FLASH_ORIGIN@, LENGTH = @FW_FLASH_LENGTH@
10+
}
11+
12+
__FLASH_start__ = @FLASH_ORIGIN@;
13+
__FLASH_size__ = @FLASH_SIZE@;
14+
15+
REGION_ALIAS("REGION_ISR_STACK", KERNEL_RAM);
16+
REGION_ALIAS("REGION_KERNEL_STACKS", KERNEL_RAM);
17+
REGION_ALIAS("REGION_KERNEL_HEAP", KERNEL_RAM);
18+

Diff for: src/fw/stm32f439_flash_fw.ld.template

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
MEMORY
2+
{
3+
KERNEL_RAM (xrw) : ORIGIN = @KERNEL_RAM_ADDR@, LENGTH = @KERNEL_RAM_SIZE@
4+
WORKER_RAM (xrw) : ORIGIN = @WORKER_RAM_ADDR@, LENGTH = @WORKER_RAM_SIZE@
5+
APP_RAM (xrw) : ORIGIN = @APP_RAM_ADDR@, LENGTH = @APP_RAM_SIZE@
6+
7+
CCM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
8+
9+
/* Bootloader now ends at 0x8008000, once we're sure we won't break */
10+
/* current watches, we should take advantage of this free space. */
11+
FLASH (rx) : ORIGIN = @FW_FLASH_ORIGIN@, LENGTH = @FW_FLASH_LENGTH@
12+
}
13+
14+
__FLASH_start__ = @FLASH_ORIGIN@;
15+
__FLASH_size__ = @FLASH_SIZE@;
16+
17+
__CCM_RAM_start__ = ORIGIN(CCM);
18+
__CCM_RAM_size__ = LENGTH(CCM);
19+
20+
REGION_ALIAS("REGION_ISR_STACK", KERNEL_RAM);
21+
REGION_ALIAS("REGION_KERNEL_STACKS", CCM);
22+
REGION_ALIAS("REGION_KERNEL_HEAP", CCM);

Diff for: src/fw/stm32f7xx_flash_fw.ld.template

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
MEMORY
2+
{
3+
/*
4+
* STM32F769 has 512kb total of system RAM
5+
* DTCM-RAM - 128kb - TCM "for critical real-time data"
6+
* 0x20000000 - 0x2001ffff
7+
* SRAM1 - 368kb - AHB
8+
* 0x20020000 - 0x2007bfff
9+
* SRAM2 - 16kb - AHB
10+
* 0x2007c000 - 0x2007ffff
11+
*
12+
* We put a bunch of static variables (tagged with DTCM_BSS) into DTCM and then use both SRAM
13+
* regions as one continuous blob which gives us 384k of RAM to play with.
14+
*/
15+
DTCM (rw) : ORIGIN = 0x20000000, LENGTH = 128K
16+
17+
KERNEL_RAM (xrw) : ORIGIN = @KERNEL_RAM_ADDR@, LENGTH = @KERNEL_RAM_SIZE@
18+
WORKER_RAM (xrw) : ORIGIN = @WORKER_RAM_ADDR@, LENGTH = @WORKER_RAM_SIZE@
19+
APP_RAM (xrw) : ORIGIN = @APP_RAM_ADDR@, LENGTH = @APP_RAM_SIZE@
20+
21+
FLASH (rx) : ORIGIN = @FW_FLASH_ORIGIN@, LENGTH = @FW_FLASH_LENGTH@
22+
}
23+
24+
__FLASH_start__ = @FLASH_ORIGIN@;
25+
__FLASH_size__ = @FLASH_SIZE@;
26+
27+
__DTCM_RAM_size__ = LENGTH(DTCM);
28+
29+
REGION_ALIAS("REGION_ISR_STACK", DTCM);
30+
REGION_ALIAS("REGION_KERNEL_STACKS", DTCM);
31+
REGION_ALIAS("REGION_KERNEL_HEAP", KERNEL_RAM);
32+
33+
SECTIONS
34+
{
35+
.dtcm_bss (NOLOAD) : {
36+
__dtcm_bss_start = .;
37+
38+
*(.dtcm_bss)
39+
*(.dtcm_bss.*)
40+
41+
. = ALIGN(8);
42+
__dtcm_bss_end = .;
43+
} >DTCM
44+
}
45+

0 commit comments

Comments
 (0)