-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathnRF51822.ld
More file actions
84 lines (74 loc) · 2.63 KB
/
nRF51822.ld
File metadata and controls
84 lines (74 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* common/nRF51822.ld */
/* Copyright (c) 2018-20 J. M. Spivey */
MEMORY {
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 16K
}
OUTPUT_FORMAT ("elf32-littlearm")
/* Setting the entry address helps GDB to find the stack bottom */
ENTRY(__reset)
SECTIONS {
.text : {
KEEP(*(.vectors))
*(.text*)
*(.rodata*)
. = ALIGN(4);
__etext = .;
PROVIDE(nmi_handler = default_handler);
PROVIDE(hardfault_handler = default_handler);
PROVIDE(svc_handler = default_handler);
PROVIDE(pendsv_handler = default_handler);
PROVIDE(systick_handler = default_handler);
PROVIDE(uart_handler = default_handler);
PROVIDE(timer0_handler = default_handler);
PROVIDE(timer1_handler = default_handler);
PROVIDE(timer2_handler = default_handler);
PROVIDE(power_clock_handler = default_handler);
PROVIDE(radio_handler = default_handler);
PROVIDE(i2c_spi0_handler = default_handler);
PROVIDE(i2c_spi1_handler = default_handler);
PROVIDE(gpiote_handler = default_handler);
PROVIDE(adc_handler = default_handler);
PROVIDE(rtc0_handler = default_handler);
PROVIDE(temp_handler = default_handler);
PROVIDE(rng_handler = default_handler);
PROVIDE(ecb_handler = default_handler);
PROVIDE(ccm_aar_handler = default_handler);
PROVIDE(wdt_handler = default_handler);
PROVIDE(rtc1_handler = default_handler);
PROVIDE(qdec_handler = default_handler);
PROVIDE(lpcomp_handler = default_handler);
PROVIDE(swi0_handler = default_handler);
PROVIDE(swi1_handler = default_handler);
PROVIDE(swi2_handler = default_handler);
PROVIDE(swi3_handler = default_handler);
PROVIDE(swi4_handler = default_handler);
PROVIDE(swi5_handler = default_handler);
} > FLASH
/DISCARD/ : {
/* Some parts of the GCC library have C++ exception data,
which is of no use to us. */
*(.ARM.extab)
*(.ARM.exidx)
}
.data : AT (__etext) {
__data_start = .;
*(.data*)
. = ALIGN(4);
__data_end = .;
} > RAM
.bss : {
__bss_start = .;
*(.bss*)
*(COMMON)
. = ALIGN(4);
__bss_end = .;
__end = .;
} > RAM
/* Set stack top to end of RAM, and move stack limit down by
size of stack */
__stack = ORIGIN(RAM) + LENGTH(RAM);
__stack_limit = __stack - 2048;
/* Check if data + stack exceeds RAM limit */
ASSERT(__stack_limit >= __end, "region RAM overlaps with stack")
}