Skip to content

Commit 82ae53a

Browse files
committed
Simplify CRP placement.
1 parent fb27e71 commit 82ae53a

File tree

4 files changed

+24
-18
lines changed

4 files changed

+24
-18
lines changed

targets/TARGET_NXP/TARGET_LPC176X/device/CRP.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,4 @@ performed on the device.
5151
#define CRP CRP_NONE
5252
#endif
5353

54-
#if defined (__ICCARM__)
55-
__root const long CRP_Key@APPLICATION_ADDR + 0x000002FC = CRP;
56-
#elif defined (__ARMCC_VERSION)
57-
const long CRP_Key __attribute__((used)) __attribute__((at(APPLICATION_ADDR+0x000002FC))) = CRP;
58-
#elif defined (__GNUC__)
59-
const long CRP_Key __attribute__((used)) __attribute__((section(".CRPSection"))) = CRP;
60-
#endif
54+
MBED_SECTION(".CRPSection") MBED_USED const long CRP_Key = CRP;

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_MICRO/LPC1768.sct

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@
99
#endif
1010

1111
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
12-
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
13-
*.o (RESET, +First)
14-
*(InRoot$$Sections)
15-
.ANY (+RO)
12+
ER_IROM0 MBED_APP_START 0x2FC { ; load address = execution address
13+
*.o (RESET, +First)
14+
.ANY (+RO)
15+
}
16+
ER_CRP (MBED_APP_START + 0x2FC) FIXED 4 {
17+
*.o (.CRPSection)
18+
}
19+
ER_IROM1 (MBED_APP_START + (0x2FC + 4)) FIXED (MBED_APP_SIZE - (0x2FC + 4)) {
20+
*(InRoot$$Sections)
21+
.ANY (+RO)
1622
}
1723
; 8_byte_aligned(49 vect * 4 bytes) = 8_byte_aligned(0xC4) = 0xC8
1824
; 32KB (RAM size) - 0xC8 (NIVT) - 32 (topmost 32 bytes used by IAP functions) = 0x7F18

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/LPC1768.sct

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@
99
#endif
1010

1111
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
12-
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
13-
*.o (RESET, +First)
14-
*(InRoot$$Sections)
15-
.ANY (+RO)
12+
ER_IROM0 MBED_APP_START 0x2FC { ; load address = execution address
13+
*.o (RESET, +First)
14+
.ANY (+RO)
15+
}
16+
ER_CRP (MBED_APP_START + 0x2FC) FIXED 4 {
17+
*.o (.CRPSection)
18+
}
19+
ER_IROM1 (MBED_APP_START + (0x2FC + 4)) FIXED (MBED_APP_SIZE - (0x2FC + 4)) {
20+
*(InRoot$$Sections)
21+
.ANY (+RO)
1622
}
1723
; 8_byte_aligned(49 vect * 4 bytes) = 8_byte_aligned(0xC4) = 0xC8
1824
; 32KB (RAM size) - 0xC8 (NIVT) - 32 (topmost 32 bytes used by IAP functions) = 0x7F18

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_IAR/LPC17xx.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ define symbol __ICFEDIT_size_cstack__ = 0x1000;
1919
define symbol __ICFEDIT_size_heap__ = 0x2000;
2020
/**** End of ICF editor section. ###ICF###*/
2121

22-
define symbol __CRP_start__ = 0x000002FC;
23-
define symbol __CRP_end__ = 0x000002FF;
22+
define symbol __CRP_start__ = MBED_APP_START + 0x000002FC;
23+
define symbol __CRP_end__ = MBED_APP_START + 0x000002FF;
2424

2525
define symbol __RAM1_start__ = 0x2007C000;
2626
define symbol __RAM1_end__ = 0x20083FFF;
@@ -43,5 +43,5 @@ place in ROM_region { readonly };
4343
place in RAM_region { readwrite,
4444
block HEAP, block CSTACK };
4545

46-
place in CRP_region { section .crp };
46+
place in CRP_region { section .CRPSection };
4747
place in RAM1_region { section .ethusbram };

0 commit comments

Comments
 (0)