Skip to content

[MAX32620HSP] Initial release. #2528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions hal/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -1699,6 +1699,15 @@
"device_has": ["ANALOGIN", "ANALOGOUT", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"MAX32620HSP": {
"inherits": ["Target"],
"core": "Cortex-M4F",
"extra_labels": ["Maxim", "MAX32620"],
"supported_toolchains": ["GCC_ARM", "IAR", "ARM"],
"progen": {"target": "max32620hsp"},
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "STDIO_MESSAGES"],
"release_versions": ["2", "5"]
},
"EFM32GG_STK3700": {
"inherits": ["Target"],
"core": "Cortex-M3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; MAX32620
; 2MB FLASH (0x200000) @ 0x000000000
; 256KB RAM (0x40000) @ 0x20000000



; MAX32620: 2MB FLASH (0x200000) + 256KB RAM (0x40000)

LR_IROM1 0x00000000 0x200000 { ; load region size_region
ER_IROM1 0x00000000 0x200000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}

; [RAM] Vector table dynamic copy: 65 vectors * 4 bytes = 260 (0x104) + 4
; for 8 byte alignment
RW_IRAM1 (0x20000000+0x108) (0x40000-0x108) { ; RW data
.ANY (+RW +ZI)
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
;*******************************************************************************
; Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
;
; Permission is hereby granted, free of charge, to any person obtaining a
; copy of this software and associated documentation files (the "Software"),
; to deal in the Software without restriction, including without limitation
; the rights to use, copy, modify, merge, publish, distribute, sublicense,
; and/or sell copies of the Software, and to permit persons to whom the
; Software is furnished to do so, subject to the following conditions:
;
; The above copyright notice and this permission notice shall be included
; in all copies or substantial portions of the Software.
;
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
; OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
; IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
; OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
; OTHER DEALINGS IN THE SOFTWARE.
;
; Except as contained in this notice, the name of Maxim Integrated
; Products, Inc. shall not be used except as stated in the Maxim Integrated
; Products, Inc. Branding Policy.
;
; The mere transfer of this software does not imply any licenses
; of trade secrets, proprietary technology, copyrights, patents,
; trademarks, maskwork rights, or any other form of intellectual
; property whatsoever. Maxim Integrated Products, Inc. retains all
; ownership rights.
;*******************************************************************************

__initial_sp EQU 0x20040000 ; Top of RAM

PRESERVE8
THUMB


; Vector Table Mapped to Address 0 at Reset

AREA RESET, DATA, READONLY
EXPORT __Vectors
EXPORT __Vectors_End
EXPORT __Vectors_Size

__Vectors DCD __initial_sp ; Top of Stack
DCD Reset_Handler ; Reset Handler
DCD NMI_Handler ; NMI Handler
DCD HardFault_Handler ; Hard Fault Handler
DCD DefaultIRQ_Handler ; MPU Fault Handler
DCD DefaultIRQ_Handler ; Bus Fault Handler
DCD DefaultIRQ_Handler ; Usage Fault Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD DefaultIRQ_Handler ; SVCall Handler
DCD DebugMon_Handler ; Debug Monitor Handler
DCD 0 ; Reserved
DCD DefaultIRQ_Handler ; PendSV Handler
DCD SysTick_IRQHandler ; SysTick Handler

; Maxim 32620 Externals interrupts
DCD CLKMAN_IRQHandler /* 16:01 CLKMAN */
DCD PWRMAN_IRQHandler /* 17:02 PWRMAN */
DCD FLC_IRQHandler /* 18:03 Flash Controller */
DCD RTC0_IRQHandler /* 19:04 RTC INT0 */
DCD RTC1_IRQHandler /* 20:05 RTC INT1 */
DCD RTC2_IRQHandler /* 21:06 RTC INT2 */
DCD RTC3_IRQHandler /* 22:07 RTC INT3 */
DCD PMU_IRQHandler /* 23:08 PMU */
DCD USB_IRQHandler /* 24:09 USB */
DCD AES_IRQHandler /* 25:10 AES */
DCD MAA_IRQHandler /* 26:11 MAA */
DCD WDT0_IRQHandler /* 27:12 WATCHDOG0 */
DCD WDT0_P_IRQHandler /* 28:13 WATCHDOG0 PRE-WINDOW */
DCD WDT1_IRQHandler /* 29:14 WATCHDOG1 */
DCD WDT1_P_IRQHandler /* 30:15 WATCHDOG1 PRE-WINDOW */
DCD GPIO_P0_IRQHandler /* 31:16 GPIO Port 0 */
DCD GPIO_P1_IRQHandler /* 32:17 GPIO Port 1 */
DCD GPIO_P2_IRQHandler /* 33:18 GPIO Port 2 */
DCD GPIO_P3_IRQHandler /* 34:19 GPIO Port 3 */
DCD GPIO_P4_IRQHandler /* 35:20 GPIO Port 4 */
DCD GPIO_P5_IRQHandler /* 36:21 GPIO Port 5 */
DCD GPIO_P6_IRQHandler /* 37:22 GPIO Port 6 */
DCD TMR0_IRQHandler /* 38:23 Timer32-0 */
DCD TMR16_0_IRQHandler /* 39:24 Timer16-s0 */
DCD TMR1_IRQHandler /* 40:25 Timer32-1 */
DCD TMR16_1_IRQHandler /* 41:26 Timer16-s1 */
DCD TMR2_IRQHandler /* 42:27 Timer32-2 */
DCD TMR16_2_IRQHandler /* 43:28 Timer16-s2 */
DCD TMR3_IRQHandler /* 44:29 Timer32-3 */
DCD TMR16_3_IRQHandler /* 45:30 Timer16-s3 */
DCD TMR4_IRQHandler /* 46:31 Timer32-4 */
DCD TMR16_4_IRQHandler /* 47:32 Timer16-s4 */
DCD TMR5_IRQHandler /* 48:33 Timer32-5 */
DCD TMR16_5_IRQHandler /* 49:34 Timer16-s5 */
DCD UART0_IRQHandler /* 50:35 UART0 */
DCD UART1_IRQHandler /* 51:36 UART1 */
DCD UART2_IRQHandler /* 52:37 UART0 */
DCD UART3_IRQHandler /* 53:38 UART1 */
DCD PT_IRQHandler /* 54:39 PT */
DCD I2CM0_IRQHandler /* 55:40 I2C Master 0 */
DCD I2CM1_IRQHandler /* 56:41 I2C Master 1 */
DCD I2CM2_IRQHandler /* 57:42 I2C Master 2 */
DCD I2CS_IRQHandler /* 58:43 I2C Slave */
DCD SPI0_IRQHandler /* 59:44 SPI0 */
DCD SPI1_IRQHandler /* 60:45 SPI1 */
DCD SPI2_IRQHandler /* 61:46 SPI2 */
DCD SPIB_IRQHandler /* 62:47 SPI Bridge */
DCD OWM_IRQHandler /* 63:48 1-Wire Master */
DCD AFE_IRQHandler /* 64:49 AFE */

__Vectors_End

__Vectors_Size EQU __Vectors_End - __Vectors

AREA |.text|, CODE, READONLY

Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP

; Dummy Exception Handlers (infinite loops which can be modified)

NMI_Handler PROC
EXPORT NMI_Handler [WEAK]
B NMI_Handler
ENDP

HardFault_Handler PROC
EXPORT HardFault_Handler [WEAK]
B HardFault_Handler
ENDP

DefaultIRQ_Handler PROC
EXPORT DefaultIRQ_Handler [WEAK]
B DefaultIRQ_Handler
ENDP

DebugMon_Handler PROC
EXPORT DebugMon_Handler [WEAK]
B DebugMon_Handler
ENDP

SysTick_IRQHandler PROC
EXPORT SysTick_IRQHandler [WEAK]
B SysTick_IRQHandler
ENDP

Default_Handler PROC

EXPORT CLKMAN_IRQHandler [WEAK]
EXPORT PWRMAN_IRQHandler [WEAK]
EXPORT FLC_IRQHandler [WEAK]
EXPORT RTC0_IRQHandler [WEAK]
EXPORT RTC1_IRQHandler [WEAK]
EXPORT RTC2_IRQHandler [WEAK]
EXPORT RTC3_IRQHandler [WEAK]
EXPORT PMU_IRQHandler [WEAK]
EXPORT USB_IRQHandler [WEAK]
EXPORT AES_IRQHandler [WEAK]
EXPORT MAA_IRQHandler [WEAK]
EXPORT WDT0_IRQHandler [WEAK]
EXPORT WDT0_P_IRQHandler [WEAK]
EXPORT WDT1_IRQHandler [WEAK]
EXPORT WDT1_P_IRQHandler [WEAK]
EXPORT GPIO_P0_IRQHandler [WEAK]
EXPORT GPIO_P1_IRQHandler [WEAK]
EXPORT GPIO_P2_IRQHandler [WEAK]
EXPORT GPIO_P3_IRQHandler [WEAK]
EXPORT GPIO_P4_IRQHandler [WEAK]
EXPORT GPIO_P5_IRQHandler [WEAK]
EXPORT GPIO_P6_IRQHandler [WEAK]
EXPORT TMR0_IRQHandler [WEAK]
EXPORT TMR16_0_IRQHandler [WEAK]
EXPORT TMR1_IRQHandler [WEAK]
EXPORT TMR16_1_IRQHandler [WEAK]
EXPORT TMR2_IRQHandler [WEAK]
EXPORT TMR16_2_IRQHandler [WEAK]
EXPORT TMR3_IRQHandler [WEAK]
EXPORT TMR16_3_IRQHandler [WEAK]
EXPORT TMR4_IRQHandler [WEAK]
EXPORT TMR16_4_IRQHandler [WEAK]
EXPORT TMR5_IRQHandler [WEAK]
EXPORT TMR16_5_IRQHandler [WEAK]
EXPORT UART0_IRQHandler [WEAK]
EXPORT UART1_IRQHandler [WEAK]
EXPORT UART2_IRQHandler [WEAK]
EXPORT UART3_IRQHandler [WEAK]
EXPORT PT_IRQHandler [WEAK]
EXPORT I2CM0_IRQHandler [WEAK]
EXPORT I2CM1_IRQHandler [WEAK]
EXPORT I2CM2_IRQHandler [WEAK]
EXPORT I2CS_IRQHandler [WEAK]
EXPORT SPI0_IRQHandler [WEAK]
EXPORT SPI1_IRQHandler [WEAK]
EXPORT SPI2_IRQHandler [WEAK]
EXPORT SPIB_IRQHandler [WEAK]
EXPORT OWM_IRQHandler [WEAK]
EXPORT AFE_IRQHandler [WEAK]

CLKMAN_IRQHandler
PWRMAN_IRQHandler
FLC_IRQHandler
RTC0_IRQHandler
RTC1_IRQHandler
RTC2_IRQHandler
RTC3_IRQHandler
PMU_IRQHandler
USB_IRQHandler
AES_IRQHandler
MAA_IRQHandler
WDT0_IRQHandler
WDT0_P_IRQHandler
WDT1_IRQHandler
WDT1_P_IRQHandler
GPIO_P0_IRQHandler
GPIO_P1_IRQHandler
GPIO_P2_IRQHandler
GPIO_P3_IRQHandler
GPIO_P4_IRQHandler
GPIO_P5_IRQHandler
GPIO_P6_IRQHandler
TMR0_IRQHandler
TMR16_0_IRQHandler
TMR1_IRQHandler
TMR16_1_IRQHandler
TMR2_IRQHandler
TMR16_2_IRQHandler
TMR3_IRQHandler
TMR16_3_IRQHandler
TMR4_IRQHandler
TMR16_4_IRQHandler
TMR5_IRQHandler
TMR16_5_IRQHandler
UART0_IRQHandler
UART1_IRQHandler
UART2_IRQHandler
UART3_IRQHandler
PT_IRQHandler
I2CM0_IRQHandler
I2CM1_IRQHandler
I2CM2_IRQHandler
I2CS_IRQHandler
SPI0_IRQHandler
SPI1_IRQHandler
SPI2_IRQHandler
SPIB_IRQHandler
OWM_IRQHandler
AFE_IRQHandler

B .
ENDP
ALIGN
END
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*******************************************************************************
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*******************************************************************************
*/

#include <rt_misc.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

extern char Image$$RW_IRAM1$$ZI$$Limit[];

extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
uint32_t sp_limit = __current_sp();

zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned

struct __initial_stackheap r;
r.heap_base = zi_limit;
r.heap_limit = sp_limit;
return r;
}

#ifdef __cplusplus
}
#endif
Loading