Skip to content

Commit daf4b1c

Browse files
authored
Merge pull request #2528 from jeremybrodt/max32620
[MAX32620HSP] Initial release.
2 parents c20d7d2 + 2604773 commit daf4b1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+13567
-9
lines changed

hal/targets.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,15 @@
17101710
"device_has": ["ANALOGIN", "ANALOGOUT", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES"],
17111711
"release_versions": ["2", "5"]
17121712
},
1713+
"MAX32620HSP": {
1714+
"inherits": ["Target"],
1715+
"core": "Cortex-M4F",
1716+
"extra_labels": ["Maxim", "MAX32620"],
1717+
"supported_toolchains": ["GCC_ARM", "IAR", "ARM"],
1718+
"progen": {"target": "max32620hsp"},
1719+
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "STDIO_MESSAGES"],
1720+
"release_versions": ["2", "5"]
1721+
},
17131722
"EFM32GG_STK3700": {
17141723
"inherits": ["Target"],
17151724
"core": "Cortex-M3",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; MAX32620
2+
; 2MB FLASH (0x200000) @ 0x000000000
3+
; 256KB RAM (0x40000) @ 0x20000000
4+
5+
6+
7+
; MAX32620: 2MB FLASH (0x200000) + 256KB RAM (0x40000)
8+
9+
LR_IROM1 0x00000000 0x200000 { ; load region size_region
10+
ER_IROM1 0x00000000 0x200000 { ; load address = execution address
11+
*.o (RESET, +First)
12+
*(InRoot$$Sections)
13+
.ANY (+RO)
14+
}
15+
16+
; [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) + 4
17+
; for 8 byte alignment
18+
RW_IRAM1 (0x20000000+0x108) (0x40000-0x108) { ; RW data
19+
.ANY (+RW +ZI)
20+
}
21+
22+
}
Lines changed: 262 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,262 @@
1+
;*******************************************************************************
2+
; Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
3+
;
4+
; Permission is hereby granted, free of charge, to any person obtaining a
5+
; copy of this software and associated documentation files (the "Software"),
6+
; to deal in the Software without restriction, including without limitation
7+
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
; and/or sell copies of the Software, and to permit persons to whom the
9+
; Software is furnished to do so, subject to the following conditions:
10+
;
11+
; The above copyright notice and this permission notice shall be included
12+
; in all copies or substantial portions of the Software.
13+
;
14+
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
; OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
; IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18+
; OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
; OTHER DEALINGS IN THE SOFTWARE.
21+
;
22+
; Except as contained in this notice, the name of Maxim Integrated
23+
; Products, Inc. shall not be used except as stated in the Maxim Integrated
24+
; Products, Inc. Branding Policy.
25+
;
26+
; The mere transfer of this software does not imply any licenses
27+
; of trade secrets, proprietary technology, copyrights, patents,
28+
; trademarks, maskwork rights, or any other form of intellectual
29+
; property whatsoever. Maxim Integrated Products, Inc. retains all
30+
; ownership rights.
31+
;*******************************************************************************
32+
33+
__initial_sp EQU 0x20040000 ; Top of RAM
34+
35+
PRESERVE8
36+
THUMB
37+
38+
39+
; Vector Table Mapped to Address 0 at Reset
40+
41+
AREA RESET, DATA, READONLY
42+
EXPORT __Vectors
43+
EXPORT __Vectors_End
44+
EXPORT __Vectors_Size
45+
46+
__Vectors DCD __initial_sp ; Top of Stack
47+
DCD Reset_Handler ; Reset Handler
48+
DCD NMI_Handler ; NMI Handler
49+
DCD HardFault_Handler ; Hard Fault Handler
50+
DCD DefaultIRQ_Handler ; MPU Fault Handler
51+
DCD DefaultIRQ_Handler ; Bus Fault Handler
52+
DCD DefaultIRQ_Handler ; Usage Fault Handler
53+
DCD 0 ; Reserved
54+
DCD 0 ; Reserved
55+
DCD 0 ; Reserved
56+
DCD 0 ; Reserved
57+
DCD DefaultIRQ_Handler ; SVCall Handler
58+
DCD DebugMon_Handler ; Debug Monitor Handler
59+
DCD 0 ; Reserved
60+
DCD DefaultIRQ_Handler ; PendSV Handler
61+
DCD SysTick_IRQHandler ; SysTick Handler
62+
63+
; Maxim 32620 Externals interrupts
64+
DCD CLKMAN_IRQHandler /* 16:01 CLKMAN */
65+
DCD PWRMAN_IRQHandler /* 17:02 PWRMAN */
66+
DCD FLC_IRQHandler /* 18:03 Flash Controller */
67+
DCD RTC0_IRQHandler /* 19:04 RTC INT0 */
68+
DCD RTC1_IRQHandler /* 20:05 RTC INT1 */
69+
DCD RTC2_IRQHandler /* 21:06 RTC INT2 */
70+
DCD RTC3_IRQHandler /* 22:07 RTC INT3 */
71+
DCD PMU_IRQHandler /* 23:08 PMU */
72+
DCD USB_IRQHandler /* 24:09 USB */
73+
DCD AES_IRQHandler /* 25:10 AES */
74+
DCD MAA_IRQHandler /* 26:11 MAA */
75+
DCD WDT0_IRQHandler /* 27:12 WATCHDOG0 */
76+
DCD WDT0_P_IRQHandler /* 28:13 WATCHDOG0 PRE-WINDOW */
77+
DCD WDT1_IRQHandler /* 29:14 WATCHDOG1 */
78+
DCD WDT1_P_IRQHandler /* 30:15 WATCHDOG1 PRE-WINDOW */
79+
DCD GPIO_P0_IRQHandler /* 31:16 GPIO Port 0 */
80+
DCD GPIO_P1_IRQHandler /* 32:17 GPIO Port 1 */
81+
DCD GPIO_P2_IRQHandler /* 33:18 GPIO Port 2 */
82+
DCD GPIO_P3_IRQHandler /* 34:19 GPIO Port 3 */
83+
DCD GPIO_P4_IRQHandler /* 35:20 GPIO Port 4 */
84+
DCD GPIO_P5_IRQHandler /* 36:21 GPIO Port 5 */
85+
DCD GPIO_P6_IRQHandler /* 37:22 GPIO Port 6 */
86+
DCD TMR0_IRQHandler /* 38:23 Timer32-0 */
87+
DCD TMR16_0_IRQHandler /* 39:24 Timer16-s0 */
88+
DCD TMR1_IRQHandler /* 40:25 Timer32-1 */
89+
DCD TMR16_1_IRQHandler /* 41:26 Timer16-s1 */
90+
DCD TMR2_IRQHandler /* 42:27 Timer32-2 */
91+
DCD TMR16_2_IRQHandler /* 43:28 Timer16-s2 */
92+
DCD TMR3_IRQHandler /* 44:29 Timer32-3 */
93+
DCD TMR16_3_IRQHandler /* 45:30 Timer16-s3 */
94+
DCD TMR4_IRQHandler /* 46:31 Timer32-4 */
95+
DCD TMR16_4_IRQHandler /* 47:32 Timer16-s4 */
96+
DCD TMR5_IRQHandler /* 48:33 Timer32-5 */
97+
DCD TMR16_5_IRQHandler /* 49:34 Timer16-s5 */
98+
DCD UART0_IRQHandler /* 50:35 UART0 */
99+
DCD UART1_IRQHandler /* 51:36 UART1 */
100+
DCD UART2_IRQHandler /* 52:37 UART0 */
101+
DCD UART3_IRQHandler /* 53:38 UART1 */
102+
DCD PT_IRQHandler /* 54:39 PT */
103+
DCD I2CM0_IRQHandler /* 55:40 I2C Master 0 */
104+
DCD I2CM1_IRQHandler /* 56:41 I2C Master 1 */
105+
DCD I2CM2_IRQHandler /* 57:42 I2C Master 2 */
106+
DCD I2CS_IRQHandler /* 58:43 I2C Slave */
107+
DCD SPI0_IRQHandler /* 59:44 SPI0 */
108+
DCD SPI1_IRQHandler /* 60:45 SPI1 */
109+
DCD SPI2_IRQHandler /* 61:46 SPI2 */
110+
DCD SPIB_IRQHandler /* 62:47 SPI Bridge */
111+
DCD OWM_IRQHandler /* 63:48 1-Wire Master */
112+
DCD AFE_IRQHandler /* 64:49 AFE */
113+
114+
__Vectors_End
115+
116+
__Vectors_Size EQU __Vectors_End - __Vectors
117+
118+
AREA |.text|, CODE, READONLY
119+
120+
Reset_Handler PROC
121+
EXPORT Reset_Handler [WEAK]
122+
IMPORT SystemInit
123+
IMPORT __main
124+
LDR R0, =SystemInit
125+
BLX R0
126+
LDR R0, =__main
127+
BX R0
128+
ENDP
129+
130+
; Dummy Exception Handlers (infinite loops which can be modified)
131+
132+
NMI_Handler PROC
133+
EXPORT NMI_Handler [WEAK]
134+
B NMI_Handler
135+
ENDP
136+
137+
HardFault_Handler PROC
138+
EXPORT HardFault_Handler [WEAK]
139+
B HardFault_Handler
140+
ENDP
141+
142+
DefaultIRQ_Handler PROC
143+
EXPORT DefaultIRQ_Handler [WEAK]
144+
B DefaultIRQ_Handler
145+
ENDP
146+
147+
DebugMon_Handler PROC
148+
EXPORT DebugMon_Handler [WEAK]
149+
B DebugMon_Handler
150+
ENDP
151+
152+
SysTick_IRQHandler PROC
153+
EXPORT SysTick_IRQHandler [WEAK]
154+
B SysTick_IRQHandler
155+
ENDP
156+
157+
Default_Handler PROC
158+
159+
EXPORT CLKMAN_IRQHandler [WEAK]
160+
EXPORT PWRMAN_IRQHandler [WEAK]
161+
EXPORT FLC_IRQHandler [WEAK]
162+
EXPORT RTC0_IRQHandler [WEAK]
163+
EXPORT RTC1_IRQHandler [WEAK]
164+
EXPORT RTC2_IRQHandler [WEAK]
165+
EXPORT RTC3_IRQHandler [WEAK]
166+
EXPORT PMU_IRQHandler [WEAK]
167+
EXPORT USB_IRQHandler [WEAK]
168+
EXPORT AES_IRQHandler [WEAK]
169+
EXPORT MAA_IRQHandler [WEAK]
170+
EXPORT WDT0_IRQHandler [WEAK]
171+
EXPORT WDT0_P_IRQHandler [WEAK]
172+
EXPORT WDT1_IRQHandler [WEAK]
173+
EXPORT WDT1_P_IRQHandler [WEAK]
174+
EXPORT GPIO_P0_IRQHandler [WEAK]
175+
EXPORT GPIO_P1_IRQHandler [WEAK]
176+
EXPORT GPIO_P2_IRQHandler [WEAK]
177+
EXPORT GPIO_P3_IRQHandler [WEAK]
178+
EXPORT GPIO_P4_IRQHandler [WEAK]
179+
EXPORT GPIO_P5_IRQHandler [WEAK]
180+
EXPORT GPIO_P6_IRQHandler [WEAK]
181+
EXPORT TMR0_IRQHandler [WEAK]
182+
EXPORT TMR16_0_IRQHandler [WEAK]
183+
EXPORT TMR1_IRQHandler [WEAK]
184+
EXPORT TMR16_1_IRQHandler [WEAK]
185+
EXPORT TMR2_IRQHandler [WEAK]
186+
EXPORT TMR16_2_IRQHandler [WEAK]
187+
EXPORT TMR3_IRQHandler [WEAK]
188+
EXPORT TMR16_3_IRQHandler [WEAK]
189+
EXPORT TMR4_IRQHandler [WEAK]
190+
EXPORT TMR16_4_IRQHandler [WEAK]
191+
EXPORT TMR5_IRQHandler [WEAK]
192+
EXPORT TMR16_5_IRQHandler [WEAK]
193+
EXPORT UART0_IRQHandler [WEAK]
194+
EXPORT UART1_IRQHandler [WEAK]
195+
EXPORT UART2_IRQHandler [WEAK]
196+
EXPORT UART3_IRQHandler [WEAK]
197+
EXPORT PT_IRQHandler [WEAK]
198+
EXPORT I2CM0_IRQHandler [WEAK]
199+
EXPORT I2CM1_IRQHandler [WEAK]
200+
EXPORT I2CM2_IRQHandler [WEAK]
201+
EXPORT I2CS_IRQHandler [WEAK]
202+
EXPORT SPI0_IRQHandler [WEAK]
203+
EXPORT SPI1_IRQHandler [WEAK]
204+
EXPORT SPI2_IRQHandler [WEAK]
205+
EXPORT SPIB_IRQHandler [WEAK]
206+
EXPORT OWM_IRQHandler [WEAK]
207+
EXPORT AFE_IRQHandler [WEAK]
208+
209+
CLKMAN_IRQHandler
210+
PWRMAN_IRQHandler
211+
FLC_IRQHandler
212+
RTC0_IRQHandler
213+
RTC1_IRQHandler
214+
RTC2_IRQHandler
215+
RTC3_IRQHandler
216+
PMU_IRQHandler
217+
USB_IRQHandler
218+
AES_IRQHandler
219+
MAA_IRQHandler
220+
WDT0_IRQHandler
221+
WDT0_P_IRQHandler
222+
WDT1_IRQHandler
223+
WDT1_P_IRQHandler
224+
GPIO_P0_IRQHandler
225+
GPIO_P1_IRQHandler
226+
GPIO_P2_IRQHandler
227+
GPIO_P3_IRQHandler
228+
GPIO_P4_IRQHandler
229+
GPIO_P5_IRQHandler
230+
GPIO_P6_IRQHandler
231+
TMR0_IRQHandler
232+
TMR16_0_IRQHandler
233+
TMR1_IRQHandler
234+
TMR16_1_IRQHandler
235+
TMR2_IRQHandler
236+
TMR16_2_IRQHandler
237+
TMR3_IRQHandler
238+
TMR16_3_IRQHandler
239+
TMR4_IRQHandler
240+
TMR16_4_IRQHandler
241+
TMR5_IRQHandler
242+
TMR16_5_IRQHandler
243+
UART0_IRQHandler
244+
UART1_IRQHandler
245+
UART2_IRQHandler
246+
UART3_IRQHandler
247+
PT_IRQHandler
248+
I2CM0_IRQHandler
249+
I2CM1_IRQHandler
250+
I2CM2_IRQHandler
251+
I2CS_IRQHandler
252+
SPI0_IRQHandler
253+
SPI1_IRQHandler
254+
SPI2_IRQHandler
255+
SPIB_IRQHandler
256+
OWM_IRQHandler
257+
AFE_IRQHandler
258+
259+
B .
260+
ENDP
261+
ALIGN
262+
END
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*******************************************************************************
2+
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a
5+
* copy of this software and associated documentation files (the "Software"),
6+
* to deal in the Software without restriction, including without limitation
7+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+
* and/or sell copies of the Software, and to permit persons to whom the
9+
* Software is furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included
12+
* in all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17+
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
18+
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+
* OTHER DEALINGS IN THE SOFTWARE.
21+
*
22+
* Except as contained in this notice, the name of Maxim Integrated
23+
* Products, Inc. shall not be used except as stated in the Maxim Integrated
24+
* Products, Inc. Branding Policy.
25+
*
26+
* The mere transfer of this software does not imply any licenses
27+
* of trade secrets, proprietary technology, copyrights, patents,
28+
* trademarks, maskwork rights, or any other form of intellectual
29+
* property whatsoever. Maxim Integrated Products, Inc. retains all
30+
* ownership rights.
31+
*******************************************************************************
32+
*/
33+
34+
#include <rt_misc.h>
35+
#include <stdint.h>
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
extern char Image$$RW_IRAM1$$ZI$$Limit[];
42+
43+
extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
44+
uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
45+
uint32_t sp_limit = __current_sp();
46+
47+
zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
48+
49+
struct __initial_stackheap r;
50+
r.heap_base = zi_limit;
51+
r.heap_limit = sp_limit;
52+
return r;
53+
}
54+
55+
#ifdef __cplusplus
56+
}
57+
#endif

0 commit comments

Comments
 (0)