Skip to content

Commit 7836c6e

Browse files
mfiore02sg-
authored andcommitted
rebase support for MultiTech xDot platform
[XDOT_L151] copy new target CMSIS files from NZ32_SC151 target [XDOT_L151] remove Modtronix code, add HardFault_Handler, update clock configuration to match xDot hardware [XDOT_L151] copy new target HAL files from NZ32_SC151 target [XDOT_L151] update HAL to match xDot hardware [XDOT_L151] add xdot_eeprom.* and xdot_low_power.* files [XDOT_L151] add RTOS support for target Conflicts: rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c [XDOT_L151] match NUCLEO_L152RE startup code for GCC_ARM so RTOS works [XDOT_L151] fix GPIO write failure [XDOT_L151] add XDOT_L151CC target to targets.json [XDOT_L151] change xDot default stack size to 256 bytes and main stack size to 1.5kB [XDOT_L151] update PinNames.h to match rev E hardware - no change to external pinout [XDOT_L151] update style in custom xDot HAL files Conflicts: rtos/rtx/TARGET_CORTEX_M/RTX_CM_lib.h rtos/rtx/TARGET_CORTEX_M/RTX_Conf_CM.c
1 parent 8155513 commit 7836c6e

32 files changed

+13319
-1
lines changed

hal/targets.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,16 @@
11791179
"device_has": ["ANALOGIN", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "STDIO_MESSAGES"],
11801180
"release_versions": ["2", "5"]
11811181
},
1182+
"XDOT_L151CC": {
1183+
"inherits": ["Target"],
1184+
"core": "Cortex-M3",
1185+
"default_toolchain": "ARM",
1186+
"extra_labels": ["STM", "STM32L1", "STM32L151CC"],
1187+
"supported_toolchains": ["ARM", "GCC_ARM"],
1188+
"progen": {"target": "xdot-l151cc"},
1189+
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SLEEP", "SPI", "SPISLAVE", "STDIO_MESSAGES"],
1190+
"default_lib": "std"
1191+
},
11821192
"MOTE_L152RC": {
11831193
"inherits": ["Target"],
11841194
"core": "Cortex-M3",
Lines changed: 334 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,334 @@
1+
;******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
2+
;* File Name : startup_stm32l151xc.s
3+
;* Author : MCD Application Team
4+
;* Version : V2.2.0
5+
;* Date : 01-July-2016
6+
;* Description : STM32L151XC Devices vector for MDK-ARM toolchain.
7+
;* This module performs:
8+
;* - Set the initial SP
9+
;* - Set the initial PC == Reset_Handler
10+
;* - Set the vector table entries with the exceptions ISR
11+
;* address.
12+
;* - Configure the system clock
13+
;* - Branches to __main in the C library (which eventually
14+
;* calls main()).
15+
;* After Reset the Cortex-M3 processor is in Thread mode,
16+
;* priority is Privileged, and the Stack is set to Main.
17+
;********************************************************************************
18+
;*
19+
;* COPYRIGHT(c) 2016 STMicroelectronics
20+
;*
21+
;* Redistribution and use in source and binary forms, with or without modification,
22+
;* are permitted provided that the following conditions are met:
23+
;* 1. Redistributions of source code must retain the above copyright notice,
24+
;* this list of conditions and the following disclaimer.
25+
;* 2. Redistributions in binary form must reproduce the above copyright notice,
26+
;* this list of conditions and the following disclaimer in the documentation
27+
;* and/or other materials provided with the distribution.
28+
;* 3. Neither the name of STMicroelectronics nor the names of its contributors
29+
;* may be used to endorse or promote products derived from this software
30+
;* without specific prior written permission.
31+
;*
32+
;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
33+
;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34+
;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
35+
;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
36+
;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37+
;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
38+
;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
39+
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
40+
;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41+
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42+
;
43+
;*******************************************************************************
44+
;
45+
; Amount of memory (in bytes) allocated for Stack
46+
; Tailor this value to your application needs
47+
; <h> Stack Configuration
48+
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
49+
; </h>
50+
51+
Stack_Size EQU 0x00000400
52+
53+
AREA STACK, NOINIT, READWRITE, ALIGN=3
54+
EXPORT __initial_sp
55+
56+
Stack_Mem SPACE Stack_Size
57+
__initial_sp EQU 0x20008000 ; Top of RAM (32 KB)
58+
59+
60+
; <h> Heap Configuration
61+
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
62+
; </h>
63+
64+
Heap_Size EQU 0x00000200
65+
66+
AREA HEAP, NOINIT, READWRITE, ALIGN=3
67+
EXPORT __heap_base
68+
EXPORT __heap_limit
69+
70+
__heap_base
71+
Heap_Mem SPACE Heap_Size
72+
__heap_limit EQU (__initial_sp - Stack_Size)
73+
74+
PRESERVE8
75+
THUMB
76+
77+
78+
; Vector Table Mapped to Address 0 at Reset
79+
AREA RESET, DATA, READONLY
80+
EXPORT __Vectors
81+
EXPORT __Vectors_End
82+
EXPORT __Vectors_Size
83+
84+
__Vectors DCD __initial_sp ; Top of Stack
85+
DCD Reset_Handler ; Reset Handler
86+
DCD NMI_Handler ; NMI Handler
87+
DCD HardFault_Handler ; Hard Fault Handler
88+
DCD MemManage_Handler ; MPU Fault Handler
89+
DCD BusFault_Handler ; Bus Fault Handler
90+
DCD UsageFault_Handler ; Usage Fault Handler
91+
DCD 0 ; Reserved
92+
DCD 0 ; Reserved
93+
DCD 0 ; Reserved
94+
DCD 0 ; Reserved
95+
DCD SVC_Handler ; SVCall Handler
96+
DCD DebugMon_Handler ; Debug Monitor Handler
97+
DCD 0 ; Reserved
98+
DCD PendSV_Handler ; PendSV Handler
99+
DCD SysTick_Handler ; SysTick Handler
100+
101+
; External Interrupts
102+
DCD WWDG_IRQHandler ; Window Watchdog
103+
DCD PVD_IRQHandler ; PVD through EXTI Line detect
104+
DCD TAMPER_STAMP_IRQHandler ; Tamper and Time Stamp
105+
DCD RTC_WKUP_IRQHandler ; RTC Wakeup
106+
DCD FLASH_IRQHandler ; FLASH
107+
DCD RCC_IRQHandler ; RCC
108+
DCD EXTI0_IRQHandler ; EXTI Line 0
109+
DCD EXTI1_IRQHandler ; EXTI Line 1
110+
DCD EXTI2_IRQHandler ; EXTI Line 2
111+
DCD EXTI3_IRQHandler ; EXTI Line 3
112+
DCD EXTI4_IRQHandler ; EXTI Line 4
113+
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
114+
DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2
115+
DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3
116+
DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4
117+
DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5
118+
DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6
119+
DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7
120+
DCD ADC1_IRQHandler ; ADC1
121+
DCD USB_HP_IRQHandler ; USB High Priority
122+
DCD USB_LP_IRQHandler ; USB Low Priority
123+
DCD DAC_IRQHandler ; DAC
124+
DCD COMP_IRQHandler ; COMP through EXTI Line
125+
DCD EXTI9_5_IRQHandler ; EXTI Line 9..5
126+
DCD 0 ; Reserved
127+
DCD TIM9_IRQHandler ; TIM9
128+
DCD TIM10_IRQHandler ; TIM10
129+
DCD TIM11_IRQHandler ; TIM11
130+
DCD TIM2_IRQHandler ; TIM2
131+
DCD TIM3_IRQHandler ; TIM3
132+
DCD TIM4_IRQHandler ; TIM4
133+
DCD I2C1_EV_IRQHandler ; I2C1 Event
134+
DCD I2C1_ER_IRQHandler ; I2C1 Error
135+
DCD I2C2_EV_IRQHandler ; I2C2 Event
136+
DCD I2C2_ER_IRQHandler ; I2C2 Error
137+
DCD SPI1_IRQHandler ; SPI1
138+
DCD SPI2_IRQHandler ; SPI2
139+
DCD USART1_IRQHandler ; USART1
140+
DCD USART2_IRQHandler ; USART2
141+
DCD USART3_IRQHandler ; USART3
142+
DCD EXTI15_10_IRQHandler ; EXTI Line 15..10
143+
DCD RTC_Alarm_IRQHandler ; RTC Alarm through EXTI Line
144+
DCD USB_FS_WKUP_IRQHandler ; USB FS Wakeup from suspend
145+
DCD TIM6_IRQHandler ; TIM6
146+
DCD TIM7_IRQHandler ; TIM7
147+
DCD 0 ; Reserved
148+
DCD TIM5_IRQHandler ; TIM5
149+
DCD SPI3_IRQHandler ; SPI3
150+
DCD 0 ; Reserved
151+
DCD 0 ; Reserved
152+
DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1
153+
DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2
154+
DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3
155+
DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4
156+
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5
157+
DCD 0 ; Reserved
158+
DCD COMP_ACQ_IRQHandler ; Comparator Channel Acquisition
159+
160+
__Vectors_End
161+
162+
__Vectors_Size EQU __Vectors_End - __Vectors
163+
164+
AREA |.text|, CODE, READONLY
165+
166+
; Reset handler routine
167+
Reset_Handler PROC
168+
EXPORT Reset_Handler [WEAK]
169+
IMPORT __main
170+
IMPORT SystemInit
171+
LDR R0, =SystemInit
172+
BLX R0
173+
LDR R0, =__main
174+
BX R0
175+
ENDP
176+
177+
; Dummy Exception Handlers (infinite loops which can be modified)
178+
179+
NMI_Handler PROC
180+
EXPORT NMI_Handler [WEAK]
181+
B .
182+
ENDP
183+
HardFault_Handler\
184+
PROC
185+
EXPORT HardFault_Handler [WEAK]
186+
B .
187+
ENDP
188+
MemManage_Handler\
189+
PROC
190+
EXPORT MemManage_Handler [WEAK]
191+
B .
192+
ENDP
193+
BusFault_Handler\
194+
PROC
195+
EXPORT BusFault_Handler [WEAK]
196+
B .
197+
ENDP
198+
UsageFault_Handler\
199+
PROC
200+
EXPORT UsageFault_Handler [WEAK]
201+
B .
202+
ENDP
203+
SVC_Handler PROC
204+
EXPORT SVC_Handler [WEAK]
205+
B .
206+
ENDP
207+
DebugMon_Handler\
208+
PROC
209+
EXPORT DebugMon_Handler [WEAK]
210+
B .
211+
ENDP
212+
PendSV_Handler PROC
213+
EXPORT PendSV_Handler [WEAK]
214+
B .
215+
ENDP
216+
SysTick_Handler PROC
217+
EXPORT SysTick_Handler [WEAK]
218+
B .
219+
ENDP
220+
221+
Default_Handler PROC
222+
223+
EXPORT WWDG_IRQHandler [WEAK]
224+
EXPORT PVD_IRQHandler [WEAK]
225+
EXPORT TAMPER_STAMP_IRQHandler [WEAK]
226+
EXPORT RTC_WKUP_IRQHandler [WEAK]
227+
EXPORT FLASH_IRQHandler [WEAK]
228+
EXPORT RCC_IRQHandler [WEAK]
229+
EXPORT EXTI0_IRQHandler [WEAK]
230+
EXPORT EXTI1_IRQHandler [WEAK]
231+
EXPORT EXTI2_IRQHandler [WEAK]
232+
EXPORT EXTI3_IRQHandler [WEAK]
233+
EXPORT EXTI4_IRQHandler [WEAK]
234+
EXPORT DMA1_Channel1_IRQHandler [WEAK]
235+
EXPORT DMA1_Channel2_IRQHandler [WEAK]
236+
EXPORT DMA1_Channel3_IRQHandler [WEAK]
237+
EXPORT DMA1_Channel4_IRQHandler [WEAK]
238+
EXPORT DMA1_Channel5_IRQHandler [WEAK]
239+
EXPORT DMA1_Channel6_IRQHandler [WEAK]
240+
EXPORT DMA1_Channel7_IRQHandler [WEAK]
241+
EXPORT ADC1_IRQHandler [WEAK]
242+
EXPORT USB_HP_IRQHandler [WEAK]
243+
EXPORT USB_LP_IRQHandler [WEAK]
244+
EXPORT DAC_IRQHandler [WEAK]
245+
EXPORT COMP_IRQHandler [WEAK]
246+
EXPORT EXTI9_5_IRQHandler [WEAK]
247+
EXPORT TIM9_IRQHandler [WEAK]
248+
EXPORT TIM10_IRQHandler [WEAK]
249+
EXPORT TIM11_IRQHandler [WEAK]
250+
EXPORT TIM2_IRQHandler [WEAK]
251+
EXPORT TIM3_IRQHandler [WEAK]
252+
EXPORT TIM4_IRQHandler [WEAK]
253+
EXPORT I2C1_EV_IRQHandler [WEAK]
254+
EXPORT I2C1_ER_IRQHandler [WEAK]
255+
EXPORT I2C2_EV_IRQHandler [WEAK]
256+
EXPORT I2C2_ER_IRQHandler [WEAK]
257+
EXPORT SPI1_IRQHandler [WEAK]
258+
EXPORT SPI2_IRQHandler [WEAK]
259+
EXPORT USART1_IRQHandler [WEAK]
260+
EXPORT USART2_IRQHandler [WEAK]
261+
EXPORT USART3_IRQHandler [WEAK]
262+
EXPORT EXTI15_10_IRQHandler [WEAK]
263+
EXPORT RTC_Alarm_IRQHandler [WEAK]
264+
EXPORT USB_FS_WKUP_IRQHandler [WEAK]
265+
EXPORT TIM6_IRQHandler [WEAK]
266+
EXPORT TIM7_IRQHandler [WEAK]
267+
EXPORT TIM5_IRQHandler [WEAK]
268+
EXPORT SPI3_IRQHandler [WEAK]
269+
EXPORT DMA2_Channel1_IRQHandler [WEAK]
270+
EXPORT DMA2_Channel2_IRQHandler [WEAK]
271+
EXPORT DMA2_Channel3_IRQHandler [WEAK]
272+
EXPORT DMA2_Channel4_IRQHandler [WEAK]
273+
EXPORT DMA2_Channel5_IRQHandler [WEAK]
274+
EXPORT COMP_ACQ_IRQHandler [WEAK]
275+
276+
WWDG_IRQHandler
277+
PVD_IRQHandler
278+
TAMPER_STAMP_IRQHandler
279+
RTC_WKUP_IRQHandler
280+
FLASH_IRQHandler
281+
RCC_IRQHandler
282+
EXTI0_IRQHandler
283+
EXTI1_IRQHandler
284+
EXTI2_IRQHandler
285+
EXTI3_IRQHandler
286+
EXTI4_IRQHandler
287+
DMA1_Channel1_IRQHandler
288+
DMA1_Channel2_IRQHandler
289+
DMA1_Channel3_IRQHandler
290+
DMA1_Channel4_IRQHandler
291+
DMA1_Channel5_IRQHandler
292+
DMA1_Channel6_IRQHandler
293+
DMA1_Channel7_IRQHandler
294+
ADC1_IRQHandler
295+
USB_HP_IRQHandler
296+
USB_LP_IRQHandler
297+
DAC_IRQHandler
298+
COMP_IRQHandler
299+
EXTI9_5_IRQHandler
300+
TIM9_IRQHandler
301+
TIM10_IRQHandler
302+
TIM11_IRQHandler
303+
TIM2_IRQHandler
304+
TIM3_IRQHandler
305+
TIM4_IRQHandler
306+
I2C1_EV_IRQHandler
307+
I2C1_ER_IRQHandler
308+
I2C2_EV_IRQHandler
309+
I2C2_ER_IRQHandler
310+
SPI1_IRQHandler
311+
SPI2_IRQHandler
312+
USART1_IRQHandler
313+
USART2_IRQHandler
314+
USART3_IRQHandler
315+
EXTI15_10_IRQHandler
316+
RTC_Alarm_IRQHandler
317+
USB_FS_WKUP_IRQHandler
318+
TIM6_IRQHandler
319+
TIM7_IRQHandler
320+
TIM5_IRQHandler
321+
SPI3_IRQHandler
322+
DMA2_Channel1_IRQHandler
323+
DMA2_Channel2_IRQHandler
324+
DMA2_Channel3_IRQHandler
325+
DMA2_Channel4_IRQHandler
326+
DMA2_Channel5_IRQHandler
327+
COMP_ACQ_IRQHandler
328+
329+
B .
330+
331+
ENDP
332+
333+
ALIGN
334+
END
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
; Scatter-Loading Description File
2+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3+
; Copyright (c) 2015, STMicroelectronics
4+
; All rights reserved.
5+
;
6+
; Redistribution and use in source and binary forms, with or without
7+
; modification, are permitted provided that the following conditions are met:
8+
;
9+
; 1. Redistributions of source code must retain the above copyright notice,
10+
; this list of conditions and the following disclaimer.
11+
; 2. Redistributions in binary form must reproduce the above copyright notice,
12+
; this list of conditions and the following disclaimer in the documentation
13+
; and/or other materials provided with the distribution.
14+
; 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
; may be used to endorse or promote products derived from this software
16+
; without specific prior written permission.
17+
;
18+
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29+
30+
; STM32L151RC: 256KB FLASH + 32KB SRAM
31+
LR_IROM1 0x08000000 0x40000 { ; load region size_region
32+
33+
ER_IROM1 0x08000000 0x40000 { ; load address = execution address
34+
*.o (RESET, +First)
35+
*(InRoot$$Sections)
36+
.ANY (+RO)
37+
}
38+
39+
; 73 vectors = 292 bytes (0x124) to be reserved in RAM
40+
RW_IRAM1 (0x20000000+0x124) (0x8000-0x124) { ; RW data
41+
.ANY (+RW +ZI)
42+
}
43+
44+
}
45+

0 commit comments

Comments
 (0)