Skip to content

Commit 9ffb355

Browse files
committed
Merge pull request #949 from GustavWi/iar_mbed
IAR support LPC824
2 parents d6156f4 + 451dc53 commit 9ffb355

File tree

7 files changed

+2583
-2
lines changed

7 files changed

+2583
-2
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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__ = 0x00000000;
6+
/*-Memory Regions-*/
7+
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
8+
define symbol __ICFEDIT_region_ROM_end__ = 0x00007FFF;
9+
define symbol __ICFEDIT_region_NVIC_start__ = 0x10000000;
10+
define symbol __ICFEDIT_region_NVIC_end__ = 0x100000BF;
11+
define symbol __ICFEDIT_region_RAM_start__ = 0x100000C0;
12+
define symbol __ICFEDIT_region_RAM_end__ = 0x10001FFF;
13+
/*-Sizes-*/
14+
define symbol __ICFEDIT_size_cstack__ = 0x400;
15+
define symbol __ICFEDIT_size_heap__ = 0xA00;
16+
/**** End of ICF editor section. ###ICF###*/
17+
18+
define symbol __CRP_start__ = 0x000002FC;
19+
define symbol __CRP_end__ = 0x000002FF;
20+
21+
define memory mem with size = 4G;
22+
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__] - mem:[from __CRP_start__ to __CRP_end__];
23+
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
24+
define region CRP_region = mem:[from __CRP_start__ to __CRP_end__];
25+
26+
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
27+
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
28+
29+
initialize by copy { readwrite };
30+
do not initialize { section .noinit };
31+
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 HEAP, block CSTACK };
36+
place in CRP_region { section .crp };
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
/**************************************************
2+
*
3+
* Part one of the system initialization code, contains low-level
4+
* initialization, plain thumb variant.
5+
*
6+
* Copyright 2011 IAR Systems. All rights reserved.
7+
*
8+
* $Revision: 47876 $
9+
*
10+
**************************************************/
11+
12+
;
13+
; The modules in this file are included in the libraries, and may be replaced
14+
; by any user-defined modules that define the PUBLIC symbol _program_start or
15+
; a user defined start symbol.
16+
; To override the cstartup defined in the library, simply add your modified
17+
; version to the workbench project.
18+
;
19+
; The vector table is normally located at address 0.
20+
; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
21+
; The name "__vector_table" has special meaning for C-SPY:
22+
; it is where the SP start value is found, and the NVIC vector
23+
; table register (VTOR) is initialized to this address if != 0.
24+
;
25+
; Cortex-M version
26+
;
27+
28+
29+
MODULE ?cstartup
30+
31+
;; Forward declaration of sections.
32+
SECTION CSTACK:DATA:NOROOT(3)
33+
34+
SECTION .intvec:CODE:NOROOT(2)
35+
36+
EXTERN __iar_program_start
37+
EXTERN SystemInit
38+
PUBLIC __vector_table
39+
PUBLIC __vector_table_0x1c
40+
PUBLIC __Vectors
41+
PUBLIC __Vectors_End
42+
PUBLIC __Vectors_Size
43+
44+
DATA
45+
46+
__vector_table
47+
DCD sfe(CSTACK)
48+
DCD Reset_Handler
49+
DCD NMI_Handler
50+
DCD HardFault_Handler
51+
DCD 0
52+
DCD 0
53+
DCD 0
54+
__vector_table_0x1c
55+
DCD 0
56+
DCD 0
57+
DCD 0
58+
DCD 0
59+
DCD SVC_Handler
60+
DCD 0
61+
DCD 0
62+
DCD PendSV_Handler
63+
DCD SysTick_Handler
64+
65+
; External Interrupts
66+
DCD SPI0_IRQHandler ; SPI0 controller
67+
DCD SPI1_IRQHandler ; SPI1 controller
68+
DCD 0 ; Reserved
69+
DCD UART0_IRQHandler ; UART0
70+
DCD UART1_IRQHandler ; UART1
71+
DCD UART2_IRQHandler ; UART2
72+
DCD 0 ; Reserved
73+
DCD I2C1_IRQHandler ; I2C1 controller
74+
DCD I2C0_IRQHandler ; I2C0 controller
75+
DCD SCT_IRQHandler ; Smart Counter Timer
76+
DCD MRT_IRQHandler ; Multi-Rate Timer
77+
DCD CMP_IRQHandler ; Comparator
78+
DCD WDT_IRQHandler ; PIO1 (0:11)
79+
DCD BOD_IRQHandler ; Brown Out Detect
80+
DCD Flash_IRQHandler ; Flash interrupt
81+
DCD WKT_IRQHandler ; Wakeup timer
82+
DCD ADC_SEQA_IRQHandler ; ADC sequence A completion
83+
DCD ADC_SEQB_IRQHandler ; ADC sequence B completion
84+
DCD ADC_THCMP_IRQHandler ; ADC threshold compare
85+
DCD ADC_OVR_IRQHandler ; ADC overrun
86+
DCD DMA__RQHandler ; DMA interrupt
87+
DCD I2C2_IRQHandler ; I2C2 controller
88+
DCD I2C3_IRQHandler ; I2C3 controller
89+
DCD 0 ; Reserved
90+
DCD PININT0_IRQHandler ; PIO INT0
91+
DCD PININT1_IRQHandler ; PIO INT1
92+
DCD PININT2_IRQHandler ; PIO INT2
93+
DCD PININT3_IRQHandler ; PIO INT3
94+
DCD PININT4_IRQHandler ; PIO INT4
95+
DCD PININT5_IRQHandler ; PIO INT5
96+
DCD PININT6_IRQHandler ; PIO INT6
97+
DCD PININT7_IRQHandler ; PIO INT7
98+
__Vectors_End
99+
100+
__Vectors EQU __vector_table
101+
__Vectors_Size EQU __Vectors_End - __Vectors
102+
103+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
104+
;;
105+
;; Default interrupt handlers.
106+
;;
107+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
108+
109+
THUMB
110+
PUBWEAK Reset_Handler
111+
SECTION .text:CODE:NOROOT:REORDER(2)
112+
Reset_Handler
113+
LDR R0, =SystemInit
114+
BLX R0
115+
LDR R0, =__iar_program_start
116+
BX R0
117+
118+
PUBWEAK NMI_Handler
119+
PUBWEAK HardFault_Handler
120+
PUBWEAK SVC_Handler
121+
PUBWEAK PendSV_Handler
122+
PUBWEAK SysTick_Handler
123+
PUBWEAK SPI0_IRQHandler
124+
PUBWEAK SPI1_IRQHandler
125+
PUBWEAK UART0_IRQHandler
126+
PUBWEAK UART1_IRQHandler
127+
PUBWEAK UART2_IRQHandler
128+
PUBWEAK I2C1_IRQHandler
129+
PUBWEAK I2C0_IRQHandler
130+
PUBWEAK SCT_IRQHandler
131+
PUBWEAK MRT_IRQHandler
132+
PUBWEAK CMP_IRQHandler
133+
PUBWEAK WDT_IRQHandler
134+
PUBWEAK BOD_IRQHandler
135+
PUBWEAK Flash_IRQHandler
136+
PUBWEAK WKT_IRQHandler
137+
PUBWEAK ADC_SEQA_IRQHandler
138+
PUBWEAK ADC_SEQB_IRQHandler
139+
PUBWEAK ADC_THCMP_IRQHandler
140+
PUBWEAK ADC_OVR_IRQHandler
141+
PUBWEAK DMA__RQHandler
142+
PUBWEAK I2C2_IRQHandler
143+
PUBWEAK I2C3_IRQHandler
144+
PUBWEAK PININT0_IRQHandler
145+
PUBWEAK PININT1_IRQHandler
146+
PUBWEAK PININT2_IRQHandler
147+
PUBWEAK PININT3_IRQHandler
148+
PUBWEAK PININT4_IRQHandler
149+
PUBWEAK PININT5_IRQHandler
150+
PUBWEAK PININT6_IRQHandler
151+
PUBWEAK PININT7_IRQHandler
152+
153+
SECTION .text:CODE:REORDER:NOROOT(1)
154+
THUMB
155+
156+
NMI_Handler
157+
HardFault_Handler
158+
SVC_Handler
159+
PendSV_Handler
160+
SysTick_Handler
161+
SPI0_IRQHandler
162+
SPI1_IRQHandler
163+
UART0_IRQHandler
164+
UART1_IRQHandler
165+
UART2_IRQHandler
166+
I2C1_IRQHandler
167+
I2C0_IRQHandler
168+
SCT_IRQHandler
169+
MRT_IRQHandler
170+
CMP_IRQHandler
171+
WDT_IRQHandler
172+
BOD_IRQHandler
173+
Flash_IRQHandler
174+
WKT_IRQHandler
175+
ADC_SEQA_IRQHandler
176+
ADC_SEQB_IRQHandler
177+
ADC_THCMP_IRQHandler
178+
ADC_OVR_IRQHandler
179+
DMA__RQHandler
180+
I2C2_IRQHandler
181+
I2C3_IRQHandler
182+
PININT0_IRQHandler
183+
PININT1_IRQHandler
184+
PININT2_IRQHandler
185+
PININT3_IRQHandler
186+
PININT4_IRQHandler
187+
PININT5_IRQHandler
188+
PININT6_IRQHandler
189+
PININT7_IRQHandler
190+
Default_IRQHandler
191+
B Default_IRQHandler
192+
193+
SECTION .crp:CODE:ROOT(2)
194+
DATA
195+
/* Code Read Protection
196+
NO_ISP 0x4E697370 - Prevents sampling of pin PIO0_1 for entering ISP mode
197+
CRP1 0x12345678 - Write to RAM command cannot access RAM below 0x10000300.
198+
- Copy RAM to flash command can not write to Sector 0.
199+
- Erase command can erase Sector 0 only when all sectors
200+
are selected for erase.
201+
- Compare command is disabled.
202+
- Read Memory command is disabled.
203+
CRP2 0x87654321 - Read Memory is disabled.
204+
- Write to RAM is disabled.
205+
- "Go" command is disabled.
206+
- Copy RAM to flash is disabled.
207+
- Compare is disabled.
208+
CRP3 0x43218765 - Access to chip via the SWD pins is disabled. ISP entry
209+
by pulling PIO0_1 LOW is disabled if a valid user code is
210+
present in flash sector 0.
211+
Caution: If CRP3 is selected, no future factory testing can be
212+
performed on the device.
213+
*/
214+
DCD 0xFFFFFFFF
215+
216+
END

workspace_tools/build_release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
('ARCH_PRO', ('ARM', 'GCC_ARM', 'GCC_CR', 'GCC_CS', 'IAR')),
3434
('LPC2368', ('ARM', 'GCC_ARM')),
3535
('LPC812', ('uARM','IAR')),
36-
('LPC824', ('uARM',)),
36+
('LPC824', ('uARM', 'IAR')),
3737
('SSCI824', ('uARM',)),
3838
('LPC1347', ('ARM','IAR')),
3939
('LPC4088', ('ARM', 'GCC_ARM', 'GCC_CR', 'IAR')),

workspace_tools/export/iar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class IAREmbeddedWorkbench(Exporter):
3434
'LPC812',
3535
'LPC4088',
3636
'LPC4088_DM',
37+
'LPC824',
3738
'UBLOX_C027',
3839
'ARCH_PRO',
3940
'K20D50M',

0 commit comments

Comments
 (0)