Skip to content

Commit 3368fa8

Browse files
authored
Merge pull request #22 from nvlsianpu/anpu_arm_cc_sandbox
fix nRF5x IAR build, files for keil build
2 parents 9745eff + 62543f1 commit 3368fa8

File tree

14 files changed

+1179
-16
lines changed

14 files changed

+1179
-16
lines changed

hal/targets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@
11031103
"detect_code": ["1070"],
11041104
"post_binary_hook": {
11051105
"function": "MCU_NRF51Code.binary_hook",
1106-
"toolchains": ["ARM_STD", "GCC_ARM"]
1106+
"toolchains": ["ARM_STD", "GCC_ARM", "IAR"]
11071107
},
11081108
"program_cycle_s": 6,
11091109
"default_build": "small",
@@ -1718,7 +1718,7 @@
17181718
],
17191719
"post_binary_hook": {
17201720
"function": "MCU_NRF51Code.binary_hook",
1721-
"toolchains": ["ARM_STD", "GCC_ARM"]
1721+
"toolchains": ["ARM_STD", "GCC_ARM", "IAR"]
17221722
},
17231723
"MERGE_BOOTLOADER": false,
17241724
"features": ["BLE"]

hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822/TOOLCHAIN_IAR/TARGET_MCU_NORDIC_16K/nRF51822_QFAA.icf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
44
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x00016000;
5+
define symbol __ICFEDIT_intvec_start__ = 0x0001b000;
66
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x000160c0;
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x0001b0c0;
88
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
9-
define symbol __ICFEDIT_region_RAM_start__ = 0x20002000;
9+
define symbol __ICFEDIT_region_RAM_start__ = 0x20002ef8;
1010
define symbol __ICFEDIT_region_RAM_end__ = 0x20003FFF;
1111
/*-Sizes-*/
1212
define symbol __ICFEDIT_size_cstack__ = 0x400;

hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822/TOOLCHAIN_IAR/TARGET_MCU_NORDIC_32K/nRF51822_QFAA.icf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
44
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x00016000;
5+
define symbol __ICFEDIT_intvec_start__ = 0x0001b000;
66
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x000160c0;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
9-
define symbol __ICFEDIT_region_RAM_start__ = 0x20002000;
10-
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x0001b0c0;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0x0003FFFF;
9+
define symbol __ICFEDIT_region_RAM_start__ = 0x20002ef8;
10+
define symbol __ICFEDIT_region_RAM_end__ = 0x20007FFF;
1111
/*-Sizes-*/
1212
/*Heap 1/4 of ram and stack 1/8*/
1313
define symbol __ICFEDIT_size_cstack__ = 0xc00;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;WITHOUT SOFTDEVICE:
2+
;LR_IROM1 0x00000000 0x00040000 {
3+
; ER_IROM1 0x00000000 0x00040000 {
4+
; *.o (RESET, +First)
5+
; *(InRoot$$Sections)
6+
; .ANY (+RO)
7+
; }
8+
; RW_IRAM1 0x20000000 0x00004000 {
9+
; .ANY (+RW +ZI)
10+
; }
11+
;}
12+
;
13+
;WITH SOFTDEVICE:
14+
15+
LR_IROM1 0x1C000 0x0064000 {
16+
ER_IROM1 0x1C000 0x0064000 {
17+
*.o (RESET, +First)
18+
*(InRoot$$Sections)
19+
.ANY (+RO)
20+
}
21+
RW_IRAM1 0x20002EF8 0x0000D108 {
22+
.ANY (+RW +ZI)
23+
}
24+
}

hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52832/TOOLCHAIN_ARM_STD/startup_nrf52832.s

Lines changed: 443 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* mbed Microcontroller Library - stackheap
2+
* Copyright (C) 2009-2011 ARM Limited. All rights reserved.
3+
*
4+
* Setup a fixed single stack/heap memory model,
5+
* between the top of the RW/ZI region and the stackpointer
6+
*/
7+
8+
#ifdef __cplusplus
9+
extern "C" {
10+
#endif
11+
12+
#include <rt_misc.h>
13+
#include <stdint.h>
14+
15+
extern char Image$$RW_IRAM1$$ZI$$Limit[];
16+
17+
extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
18+
uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
19+
uint32_t sp_limit = __current_sp();
20+
21+
zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
22+
23+
struct __initial_stackheap r;
24+
r.heap_base = zi_limit;
25+
r.heap_limit = sp_limit;
26+
return r;
27+
}
28+
29+
#ifdef __cplusplus
30+
}
31+
#endif
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*###ICF### Section handled by ICF editor, don't touch! ****/
2+
/*-Editor annotation file-*/
3+
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
/*-Specials-*/
5+
define symbol __ICFEDIT_intvec_start__ = 0x1c000;
6+
/*-Memory Regions-*/
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x1c000;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0x7ffff;
9+
define symbol __ICFEDIT_region_RAM_start__ = 0x20002ef8;
10+
define symbol __ICFEDIT_region_RAM_end__ = 0x2000ffff;
11+
export symbol __ICFEDIT_region_RAM_start__;
12+
export symbol __ICFEDIT_region_RAM_end__;
13+
/*-Sizes-*/
14+
/*Heap 1/4 of ram and stack 1/8*/
15+
define symbol __ICFEDIT_size_cstack__ = 0x800;
16+
define symbol __ICFEDIT_size_heap__ = 0x1800;
17+
/**** End of ICF editor section. ###ICF###*/
18+
19+
define symbol __code_start_soft_device__ = 0x0;
20+
21+
define memory mem with size = 4G;
22+
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
23+
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
24+
25+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
26+
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
27+
28+
initialize by copy { readwrite };
29+
do not initialize { section .noinit };
30+
31+
keep { section .intvec };
32+
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
33+
place in ROM_region { readonly };
34+
place in RAM_region { readwrite,
35+
block CSTACK,
36+
block HEAP };
37+
38+
/*This is used for mbed applications build inside the Embedded workbench
39+
Applications build with the python scritps use a hex merge so need to merge it
40+
inside the linker. The linker can only use binary files so the hex merge is not possible
41+
through the linker. That is why a binary is used instead of a hex image for the embedded project.
42+
*/
43+
if(isdefinedsymbol(SOFT_DEVICE_BIN))
44+
{
45+
place at address mem:__code_start_soft_device__ { section .noinit_softdevice };
46+
}

0 commit comments

Comments
 (0)