Skip to content

Commit ea56684

Browse files
authored
Merge pull request #2531 from radhika-raghavendran/master
ncs36510 from ON Semiconductor
2 parents eeead56 + 2dc3806 commit ea56684

Some content is hidden

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

94 files changed

+10955
-3
lines changed

hal/targets.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,5 +2021,17 @@
20212021
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH"],
20222022
"features": ["IPV4"],
20232023
"release_versions": ["2", "5"]
2024+
},
2025+
"NCS36510": {
2026+
"inherits": ["Target"],
2027+
"core": "Cortex-M3",
2028+
"extra_labels": ["ONSEMI"],
2029+
"post_binary_hook": {"function": "NCS36510TargetCode.ncs36510_addfib"},
2030+
"macros": ["REVD", "CM3", "CPU_NCS36510", "TARGET_NCS36510"],
2031+
"progen": {"target": "ncs36510"},
2032+
"progen_target": "ncs36510",
2033+
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
2034+
"device_has": ["ANALOGIN", "SERIAL", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_FC", "SLEEP", "SPI"],
2035+
"release_versions": ["2", "5"]
20242036
}
20252037
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**************************************************************************/
2+
/**
3+
* @file ARMCM3.h
4+
* @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File
5+
* for CM3 Device Series
6+
* @version V1.05
7+
* @date 26. July 2011
8+
*
9+
* @note
10+
* Copyright (C) 2010-2011 ARM Limited. All rights reserved.
11+
*
12+
* @par
13+
* ARM Limited (ARM) is supplying this software for use with Cortex-M
14+
* processor based microcontrollers. This file can be freely distributed
15+
* within development tools that are supporting such ARM based processors.
16+
*
17+
* @par
18+
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19+
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21+
* ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
22+
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
23+
*
24+
******************************************************************************/
25+
26+
#ifndef ARMCM3_H
27+
#define ARMCM3_H
28+
29+
/**
30+
* ==========================================================================
31+
* ---------- Interrupt Number Definition -----------------------------------
32+
* ==========================================================================
33+
*/
34+
typedef enum IRQn
35+
{
36+
/****** Cortex-M3 Processor Exceptions Numbers ***************************************************/
37+
NonMaskableInt_IRQn = -14, /*!< 2 Cortex-M3 Non Maskable Interrupt */
38+
HardFault_IRQn = -13, /*!< 3 Cortex-M3 Hard Fault Interrupt */
39+
MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
40+
BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
41+
UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
42+
SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
43+
DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
44+
PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
45+
SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
46+
47+
/****** ARMCM3 specific Interrupt Numbers ********************************************************/
48+
Tim0_IRQn = 0,
49+
Tim1_IRQn = 1,
50+
Tim2_IRQn = 2,
51+
Uart1_IRQn = 3,
52+
Spi_IRQn = 4,
53+
I2C_IRQn = 5,
54+
Gpio_IRQn = 6,
55+
Rtc_IRQn = 7,
56+
Flash_IRQn = 8,
57+
MacHw_IRQn = 9,
58+
Aes_IRQn = 10,
59+
Adc_IRQn = 11,
60+
ClockCal_IRQn = 12,
61+
Uart2_IRQn = 13,
62+
Uvi_IRQn = 14,
63+
Dma_IRQn = 15,
64+
DbgPwrUp_IRQn = 16,
65+
Spi2_IRQn = 17,
66+
I2C2_IRQn = 18,
67+
FVDDHComp_IRQn = 19
68+
} IRQn_Type;
69+
70+
/**
71+
* ==========================================================================
72+
* ----------- Processor and Core Peripheral Section ------------------------
73+
* ==========================================================================
74+
*/
75+
76+
/** Configuration of the Cortex-M3 Processor and Core Peripherals */
77+
#define __CM3_REV 0x0201 /*!< Core Revision r2p1 */
78+
#define __MPU_PRESENT 1 /*!< MPU present or not */
79+
#define __NVIC_PRIO_BITS 4 /*!< Number of Bits used for Priority Levels */
80+
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
81+
82+
//#define YOTTA_CFG_CMSIS_NVIC_USER_IRQ_OFFSET 16
83+
//#define YOTTA_CFG_CMSIS_NVIC_USER_IRQ_NUMBER 20
84+
//#define NVIC_NUM_VECTORS (NVIC_USER_IRQ_OFFSET + NVIC_USER_IRQ_NUMBER)
85+
86+
//#define YOTTA_CFG_CMSIS_NVIC_RAM_VECTOR_ADDRESS
87+
//#define YOTTA_CFG_CMSIS_NVIC_FLASH_VECTOR_ADDRESS 0x3000
88+
89+
#include <core_cm3.h> /* Cortex-M3 processor and core peripherals */
90+
#include "system_NCS36510.h" /* System Header */
91+
92+
#endif /* ARMCM3_H */
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#! armcc -E
2+
3+
#define Heap_Size 0x0400
4+
5+
LR_IROM1 0x00003000 0x0004F000 { ; load region size_region
6+
ER_IROM1 0x00003000 0x0004F000 { ; load address = execution address
7+
*.o (RESET, +First)
8+
*(InRoot$$Sections)
9+
.ANY (*)
10+
}
11+
12+
; no uvisor support at this time
13+
14+
;ARM_LIB_STACK AlignExpr(+0, 8) EMPTY 0x1000 {}
15+
ARM_LIB_STACK 0x3FFF4000 EMPTY 0x1000 {}
16+
17+
RW_IRAM0 +0 {
18+
.ANY(+RW +ZI)
19+
}
20+
RW_IRAM1 ImageLimit(RW_IRAM0) EMPTY Heap_Size { ; Heap region growing up
21+
}
22+
ARM_LIB_HEAP AlignExpr(+0, 8) ALIGN 8 EMPTY (0x3FFF4000 + 0xC000 - AlignExpr(ImageLimit(RW_IRAM1),8) ) {}
23+
}
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
;/* File: startup_ncs36510.s
2+
; * Purpose: startup file for Cortex-M3 devices. Should use with
3+
; * ARMGCC for ARM Embedded Processors
4+
; * Version: V2.00
5+
; * Date: 25 Feb 2016
6+
; *
7+
; */
8+
;/* Copyright (c) 2011 - 2014 ARM LIMITED
9+
;
10+
; All rights reserved.
11+
; Redistribution and use in source and binary forms, with or without
12+
; modification, are permitted provided that the following conditions are met:
13+
; - Redistributions of source code must retain the above copyright
14+
; notice, this list of conditions and the following disclaimer.
15+
; - Redistributions in binary form must reproduce the above copyright
16+
; notice, this list of conditions and the following disclaimer in the
17+
; documentation and/or other materials provided with the distribution.
18+
; - Neither the name of ARM nor the names of its contributors may be used
19+
; to endorse or promote products derived from this software without
20+
; specific prior written permission.
21+
; *
22+
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+
; ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
26+
; LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27+
; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28+
; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29+
; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30+
; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31+
; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32+
; POSSIBILITY OF SUCH DAMAGE.
33+
; ---------------------------------------------------------------------------*/
34+
35+
36+
PRESERVE8
37+
THUMB
38+
39+
40+
; Vector Table Mapped to Address 0x3000 at Reset
41+
42+
AREA RESET, DATA, READONLY
43+
EXPORT __Vectors
44+
EXPORT __Vectors_End
45+
EXPORT __Vectors_Size
46+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
47+
48+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
49+
DCD Reset_Handler ; Reset Handler
50+
DCD NMI_Handler ; NMI Handler
51+
DCD HardFault_Handler ; Hard Fault Handler
52+
DCD MemManage_Handler ; MPU Fault Handler
53+
DCD BusFault_Handler ; Bus Fault Handler
54+
DCD UsageFault_Handler ; Usage Fault Handler
55+
DCD 0 ; Reserved
56+
DCD 0 ; Reserved
57+
DCD 0 ; Reserved
58+
DCD 0 ; Reserved
59+
DCD SVC_Handler ; SVCall Handler
60+
DCD DebugMon_Handler ; Debug Monitor Handler
61+
DCD 0 ; Reserved
62+
DCD PendSV_Handler ; PendSV Handler
63+
DCD SysTick_Handler ; SysTick Handler
64+
65+
; External Interrupts
66+
DCD fIrqTim0Handler
67+
DCD fIrqTim1Handler
68+
DCD fIrqTim2Handler
69+
DCD fIrqUart1Handler
70+
DCD fIrqSpiHandler
71+
DCD fIrqI2CHandler
72+
DCD fIrqGpioHandler
73+
DCD fIrqRtcHandler
74+
DCD fIrqFlashHandler
75+
DCD fIrqMacHwHandler
76+
DCD fIrqAesHandler
77+
DCD fIrqAdcHandler
78+
DCD fIrqClockCalHandler
79+
DCD fIrqUart2Handler
80+
DCD fIrqUviHandler
81+
DCD fIrqDmaHandler
82+
DCD fIrqDbgPwrUpHandler
83+
DCD fIrqSpi2Handler
84+
DCD fIrqI2C2Handler
85+
DCD fIrqFVDDHCompHandler
86+
__Vectors_End
87+
88+
__Vectors_Size EQU __Vectors_End - __Vectors
89+
90+
AREA |.text|, CODE, READONLY
91+
92+
; Reset Handler
93+
94+
Reset_Handler PROC
95+
EXPORT Reset_Handler [WEAK]
96+
IMPORT SystemInit
97+
IMPORT __main
98+
LDR R0, =SystemInit
99+
BLX R0
100+
LDR R0, =__main
101+
BX R0
102+
ENDP
103+
104+
105+
; Dummy Exception Handlers (infinite loops which can be modified)
106+
107+
NMI_Handler PROC
108+
EXPORT NMI_Handler [WEAK]
109+
B .
110+
ENDP
111+
HardFault_Handler\
112+
PROC
113+
EXPORT HardFault_Handler [WEAK]
114+
B .
115+
ENDP
116+
MemManage_Handler\
117+
PROC
118+
EXPORT MemManage_Handler [WEAK]
119+
B .
120+
ENDP
121+
BusFault_Handler\
122+
PROC
123+
EXPORT BusFault_Handler [WEAK]
124+
B .
125+
ENDP
126+
UsageFault_Handler\
127+
PROC
128+
EXPORT UsageFault_Handler [WEAK]
129+
B .
130+
ENDP
131+
SVC_Handler PROC
132+
EXPORT SVC_Handler [WEAK]
133+
B .
134+
ENDP
135+
DebugMon_Handler\
136+
PROC
137+
EXPORT DebugMon_Handler [WEAK]
138+
B .
139+
ENDP
140+
PendSV_Handler PROC
141+
EXPORT PendSV_Handler [WEAK]
142+
B .
143+
ENDP
144+
SysTick_Handler PROC
145+
EXPORT SysTick_Handler [WEAK]
146+
B .
147+
ENDP
148+
149+
Default_Handler PROC
150+
EXPORT fIrqTim0Handler [WEAK]
151+
EXPORT fIrqTim1Handler [WEAK]
152+
EXPORT fIrqTim2Handler [WEAK]
153+
EXPORT fIrqUart1Handler [WEAK]
154+
EXPORT fIrqSpiHandler [WEAK]
155+
EXPORT fIrqI2CHandler [WEAK]
156+
EXPORT fIrqGpioHandler [WEAK]
157+
EXPORT fIrqRtcHandler [WEAK]
158+
EXPORT fIrqFlashHandler [WEAK]
159+
EXPORT fIrqMacHwHandler [WEAK]
160+
EXPORT fIrqAesHandler [WEAK]
161+
EXPORT fIrqAdcHandler [WEAK]
162+
EXPORT fIrqClockCalHandler [WEAK]
163+
EXPORT fIrqUart2Handler [WEAK]
164+
EXPORT fIrqUviHandler [WEAK]
165+
EXPORT fIrqDmaHandler [WEAK]
166+
EXPORT fIrqDbgPwrUpHandler [WEAK]
167+
EXPORT fIrqSpi2Handler [WEAK]
168+
EXPORT fIrqI2C2Handler [WEAK]
169+
EXPORT fIrqFVDDHCompHandler [WEAK]
170+
171+
fIrqTim0Handler
172+
fIrqTim1Handler
173+
fIrqTim2Handler
174+
fIrqUart1Handler
175+
fIrqSpiHandler
176+
fIrqI2CHandler
177+
fIrqGpioHandler
178+
fIrqRtcHandler
179+
fIrqFlashHandler
180+
fIrqMacHwHandler
181+
fIrqAesHandler
182+
fIrqAdcHandler
183+
fIrqClockCalHandler
184+
fIrqUart2Handler
185+
fIrqUviHandler
186+
fIrqDmaHandler
187+
fIrqDbgPwrUpHandler
188+
fIrqSpi2Handler
189+
fIrqI2C2Handler
190+
fIrqFVDDHCompHandler
191+
DefaultISR
192+
193+
B .
194+
195+
ENDP
196+
197+
EXPORT __user_initial_stackheap
198+
IMPORT |Image$$ARM_LIB_HEAP$$Base|
199+
IMPORT |Image$$ARM_LIB_HEAP$$ZI$$Limit|
200+
201+
__user_initial_stackheap PROC
202+
LDR R0, = |Image$$ARM_LIB_HEAP$$Base|
203+
LDR R2, = |Image$$ARM_LIB_HEAP$$ZI$$Limit|
204+
BX LR
205+
ENDP
206+
207+
ALIGN
208+
END

0 commit comments

Comments
 (0)