Skip to content

Commit ed97d3c

Browse files
authored
Merge pull request #110 from dmlambo/f103_spl
Add GD32F10x SPL files from GD32F10x_Firmware_Library_V2.2.4
2 parents 0f853a9 + 192bcec commit ed97d3c

168 files changed

Lines changed: 62402 additions & 0 deletions

File tree

Some content is hidden

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

system/GD32F10x_firmware/CMSIS/GD/GD32F10x/Include/gd32f10x.h

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*!
2+
\file system_gd32f10x.h
3+
\brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File for
4+
GD32F10x Device Series
5+
*/
6+
7+
/*
8+
Copyright (c) 2012 ARM LIMITED
9+
10+
All rights reserved.
11+
12+
Redistribution and use in source and binary forms, with or without modification,
13+
are permitted provided that the following conditions are met:
14+
15+
1. Redistributions of source code must retain the above copyright notice, this
16+
list of conditions and the following disclaimer.
17+
2. Redistributions in binary form must reproduce the above copyright notice,
18+
this list of conditions and the following disclaimer in the documentation
19+
and/or other materials provided with the distribution.
20+
3. Neither the name of the copyright holder nor the names of its contributors
21+
may be used to endorse or promote products derived from this software without
22+
specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29+
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
33+
OF SUCH DAMAGE.
34+
*/
35+
36+
/* This file refers the CMSIS standard, some adjustments are made according to GigaDevice chips */
37+
38+
#ifndef SYSTEM_GD32F10X_H
39+
#define SYSTEM_GD32F10X_H
40+
41+
#ifdef __cplusplus
42+
extern "C" {
43+
#endif
44+
45+
#include <stdint.h>
46+
47+
/* system clock frequency (core clock) */
48+
extern uint32_t SystemCoreClock;
49+
50+
/* function declarations */
51+
/* initialize the system and update the SystemCoreClock variable */
52+
extern void SystemInit(void);
53+
/* update the SystemCoreClock with current core clock retrieved from cpu registers */
54+
extern void SystemCoreClockUpdate(void);
55+
56+
#ifdef __cplusplus
57+
}
58+
#endif
59+
60+
#endif /* SYSTEM_GD32F10X_H */

system/GD32F10x_firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_cl.s

Lines changed: 390 additions & 0 deletions
Large diffs are not rendered by default.

system/GD32F10x_firmware/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_hd.s

Lines changed: 371 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 328 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
;/*!
2+
; \file startup_gd32f10x_md.s
3+
; \brief start up file
4+
;
5+
; \version 2014-12-26, V1.0.0, firmware for GD32F10x
6+
; \version 2017-06-20, V2.0.0, firmware for GD32F10x
7+
; \version 2018-07-31, V2.1.0, firmware for GD32F10x
8+
;*/
9+
;
10+
;/*
11+
; Copyright (c) 2018, GigaDevice Semiconductor Inc.
12+
;
13+
; All rights reserved.
14+
;
15+
; Redistribution and use in source and binary forms, with or without modification,
16+
;are permitted provided that the following conditions are met:
17+
;
18+
; 1. Redistributions of source code must retain the above copyright notice, this
19+
; list of conditions and the following disclaimer.
20+
; 2. Redistributions in binary form must reproduce the above copyright notice,
21+
; this list of conditions and the following disclaimer in the documentation
22+
; and/or other materials provided with the distribution.
23+
; 3. Neither the name of the copyright holder nor the names of its contributors
24+
; may be used to endorse or promote products derived from this software without
25+
; specific prior written permission.
26+
;
27+
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28+
;AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
29+
;WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30+
;IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
31+
;INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
32+
;NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33+
;PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34+
;WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
;ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
36+
;OF SUCH DAMAGE.
37+
;*/
38+
39+
; <h> Stack Configuration
40+
; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
41+
; </h>
42+
43+
Stack_Size EQU 0x00000400
44+
45+
AREA STACK, NOINIT, READWRITE, ALIGN = 3
46+
Stack_Mem SPACE Stack_Size
47+
__initial_sp
48+
49+
50+
; <h> Heap Configuration
51+
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
52+
; </h>
53+
54+
Heap_Size EQU 0x00000200
55+
56+
AREA HEAP, NOINIT, READWRITE, ALIGN = 3
57+
__heap_base
58+
Heap_Mem SPACE Heap_Size
59+
__heap_limit
60+
61+
62+
PRESERVE8
63+
THUMB
64+
65+
; /* reset Vector Mapped to at Address 0 */
66+
AREA RESET, DATA, READONLY
67+
EXPORT __Vectors
68+
EXPORT __Vectors_End
69+
EXPORT __Vectors_Size
70+
71+
__Vectors DCD __initial_sp ; Top of Stack
72+
DCD Reset_Handler ; Reset Handler
73+
DCD NMI_Handler ; NMI Handler
74+
DCD HardFault_Handler ; Hard Fault Handler
75+
DCD MemManage_Handler ; MPU Fault Handler
76+
DCD BusFault_Handler ; Bus Fault Handler
77+
DCD UsageFault_Handler ; Usage Fault Handler
78+
DCD 0 ; Reserved
79+
DCD 0 ; Reserved
80+
DCD 0 ; Reserved
81+
DCD 0 ; Reserved
82+
DCD SVC_Handler ; SVCall Handler
83+
DCD DebugMon_Handler ; Debug Monitor Handler
84+
DCD 0 ; Reserved
85+
DCD PendSV_Handler ; PendSV Handler
86+
DCD SysTick_Handler ; SysTick Handler
87+
88+
; /* external interrupts handler */
89+
DCD WWDGT_IRQHandler ; 16:Window Watchdog Timer
90+
DCD LVD_IRQHandler ; 17:LVD through EXTI Line detect
91+
DCD TAMPER_IRQHandler ; 18:Tamper Interrupt
92+
DCD RTC_IRQHandler ; 19:RTC through EXTI Line
93+
DCD FMC_IRQHandler ; 20:FMC
94+
DCD RCU_IRQHandler ; 21:RCU
95+
DCD EXTI0_IRQHandler ; 22:EXTI Line 0
96+
DCD EXTI1_IRQHandler ; 23:EXTI Line 1
97+
DCD EXTI2_IRQHandler ; 24:EXTI Line 2
98+
DCD EXTI3_IRQHandler ; 25:EXTI Line 3
99+
DCD EXTI4_IRQHandler ; 26:EXTI Line 4
100+
DCD DMA0_Channel0_IRQHandler ; 27:DMA0 Channel 0
101+
DCD DMA0_Channel1_IRQHandler ; 28:DMA0 Channel 1
102+
DCD DMA0_Channel2_IRQHandler ; 29:DMA0 Channel 2
103+
DCD DMA0_Channel3_IRQHandler ; 30:DMA0 Channel 3
104+
DCD DMA0_Channel4_IRQHandler ; 31:DMA0 Channel 4
105+
DCD DMA0_Channel5_IRQHandler ; 32:DMA0 Channel 5
106+
DCD DMA0_Channel6_IRQHandler ; 33:DMA0 Channel 6
107+
DCD ADC0_1_IRQHandler ; 34:ADC0 and ADC1
108+
DCD USBD_HP_CAN0_TX_IRQHandler ; 35:USBD and CAN0 TX
109+
DCD USBD_LP_CAN0_RX0_IRQHandler ; 36:USBD and CAN0 RX0
110+
DCD CAN0_RX1_IRQHandler ; 37:CAN0 RX1
111+
DCD CAN0_EWMC_IRQHandler ; 38:CAN0 EWMC
112+
DCD EXTI5_9_IRQHandler ; 39:EXTI Line 5 to EXTI Line 9
113+
DCD TIMER0_BRK_IRQHandler ; 40:TIMER0 Break
114+
DCD TIMER0_UP_IRQHandler ; 41:TIMER0 Update
115+
DCD TIMER0_TRG_CMT_IRQHandler ; 42:TIMER0 Trigger
116+
DCD TIMER0_Channel_IRQHandler ; 43:TIMER0 Channel Capture Compare
117+
DCD TIMER1_IRQHandler ; 44:TIMER1
118+
DCD TIMER2_IRQHandler ; 45:TIMER2
119+
DCD TIMER3_IRQHandler ; 46:TIMER3
120+
DCD I2C0_EV_IRQHandler ; 47:I2C0 Event
121+
DCD I2C0_ER_IRQHandler ; 48:I2C0 Error
122+
DCD I2C1_EV_IRQHandler ; 49:I2C1 Event
123+
DCD I2C1_ER_IRQHandler ; 50:I2C1 Error
124+
DCD SPI0_IRQHandler ; 51:SPI0
125+
DCD SPI1_IRQHandler ; 52:SPI1
126+
DCD USART0_IRQHandler ; 53:USART0
127+
DCD USART1_IRQHandler ; 54:USART1
128+
DCD USART2_IRQHandler ; 55:USART2
129+
DCD EXTI10_15_IRQHandler ; 56:EXTI Line 10 to EXTI Line 15
130+
DCD RTC_Alarm_IRQHandler ; 57:RTC Alarm through EXTI Line
131+
DCD USBD_WKUP_IRQHandler ; 58:USBD WakeUp from suspend through EXTI Line
132+
DCD 0 ; Reserved
133+
DCD 0 ; Reserved
134+
DCD 0 ; Reserved
135+
DCD 0 ; Reserved
136+
DCD 0 ; Reserved
137+
DCD EXMC_IRQHandler ; 64:EXMC
138+
139+
__Vectors_End
140+
141+
__Vectors_Size EQU __Vectors_End - __Vectors
142+
143+
AREA |.text|, CODE, READONLY
144+
145+
;/* reset Handler */
146+
Reset_Handler PROC
147+
EXPORT Reset_Handler [WEAK]
148+
IMPORT __main
149+
IMPORT SystemInit
150+
LDR R0, =SystemInit
151+
BLX R0
152+
LDR R0, =__main
153+
BX R0
154+
ENDP
155+
156+
;/* dummy Exception Handlers */
157+
NMI_Handler PROC
158+
EXPORT NMI_Handler [WEAK]
159+
B .
160+
ENDP
161+
162+
HardFault_Handler PROC
163+
EXPORT HardFault_Handler [WEAK]
164+
B .
165+
ENDP
166+
167+
MemManage_Handler PROC
168+
EXPORT MemManage_Handler [WEAK]
169+
B .
170+
ENDP
171+
172+
BusFault_Handler PROC
173+
EXPORT BusFault_Handler [WEAK]
174+
B .
175+
ENDP
176+
177+
UsageFault_Handler PROC
178+
EXPORT UsageFault_Handler [WEAK]
179+
B .
180+
ENDP
181+
182+
SVC_Handler PROC
183+
EXPORT SVC_Handler [WEAK]
184+
B .
185+
ENDP
186+
187+
DebugMon_Handler PROC
188+
EXPORT DebugMon_Handler [WEAK]
189+
B .
190+
ENDP
191+
192+
PendSV_Handler PROC
193+
EXPORT PendSV_Handler [WEAK]
194+
B .
195+
ENDP
196+
197+
SysTick_Handler PROC
198+
EXPORT SysTick_Handler [WEAK]
199+
B .
200+
ENDP
201+
202+
Default_Handler PROC
203+
; /* external interrupts handler */
204+
EXPORT WWDGT_IRQHandler [WEAK]
205+
EXPORT LVD_IRQHandler [WEAK]
206+
EXPORT TAMPER_IRQHandler [WEAK]
207+
EXPORT RTC_IRQHandler [WEAK]
208+
EXPORT FMC_IRQHandler [WEAK]
209+
EXPORT RCU_IRQHandler [WEAK]
210+
EXPORT EXTI0_IRQHandler [WEAK]
211+
EXPORT EXTI1_IRQHandler [WEAK]
212+
EXPORT EXTI2_IRQHandler [WEAK]
213+
EXPORT EXTI3_IRQHandler [WEAK]
214+
EXPORT EXTI4_IRQHandler [WEAK]
215+
EXPORT DMA0_Channel0_IRQHandler [WEAK]
216+
EXPORT DMA0_Channel1_IRQHandler [WEAK]
217+
EXPORT DMA0_Channel2_IRQHandler [WEAK]
218+
EXPORT DMA0_Channel3_IRQHandler [WEAK]
219+
EXPORT DMA0_Channel4_IRQHandler [WEAK]
220+
EXPORT DMA0_Channel5_IRQHandler [WEAK]
221+
EXPORT DMA0_Channel6_IRQHandler [WEAK]
222+
EXPORT ADC0_1_IRQHandler [WEAK]
223+
EXPORT USBD_HP_CAN0_TX_IRQHandler [WEAK]
224+
EXPORT USBD_LP_CAN0_RX0_IRQHandler [WEAK]
225+
EXPORT CAN0_RX1_IRQHandler [WEAK]
226+
EXPORT CAN0_EWMC_IRQHandler [WEAK]
227+
EXPORT EXTI5_9_IRQHandler [WEAK]
228+
EXPORT TIMER0_BRK_IRQHandler [WEAK]
229+
EXPORT TIMER0_UP_IRQHandler [WEAK]
230+
EXPORT TIMER0_TRG_CMT_IRQHandler [WEAK]
231+
EXPORT TIMER0_Channel_IRQHandler [WEAK]
232+
EXPORT TIMER1_IRQHandler [WEAK]
233+
EXPORT TIMER2_IRQHandler [WEAK]
234+
EXPORT TIMER3_IRQHandler [WEAK]
235+
EXPORT I2C0_EV_IRQHandler [WEAK]
236+
EXPORT I2C0_ER_IRQHandler [WEAK]
237+
EXPORT I2C1_EV_IRQHandler [WEAK]
238+
EXPORT I2C1_ER_IRQHandler [WEAK]
239+
EXPORT SPI0_IRQHandler [WEAK]
240+
EXPORT SPI1_IRQHandler [WEAK]
241+
EXPORT USART0_IRQHandler [WEAK]
242+
EXPORT USART1_IRQHandler [WEAK]
243+
EXPORT USART2_IRQHandler [WEAK]
244+
EXPORT EXTI10_15_IRQHandler [WEAK]
245+
EXPORT RTC_Alarm_IRQHandler [WEAK]
246+
EXPORT USBD_WKUP_IRQHandler [WEAK]
247+
EXPORT EXMC_IRQHandler [WEAK]
248+
249+
250+
;/* external interrupts handler */
251+
WWDGT_IRQHandler
252+
LVD_IRQHandler
253+
TAMPER_IRQHandler
254+
RTC_IRQHandler
255+
FMC_IRQHandler
256+
RCU_IRQHandler
257+
EXTI0_IRQHandler
258+
EXTI1_IRQHandler
259+
EXTI2_IRQHandler
260+
EXTI3_IRQHandler
261+
EXTI4_IRQHandler
262+
DMA0_Channel0_IRQHandler
263+
DMA0_Channel1_IRQHandler
264+
DMA0_Channel2_IRQHandler
265+
DMA0_Channel3_IRQHandler
266+
DMA0_Channel4_IRQHandler
267+
DMA0_Channel5_IRQHandler
268+
DMA0_Channel6_IRQHandler
269+
ADC0_1_IRQHandler
270+
USBD_HP_CAN0_TX_IRQHandler
271+
USBD_LP_CAN0_RX0_IRQHandler
272+
CAN0_RX1_IRQHandler
273+
CAN0_EWMC_IRQHandler
274+
EXTI5_9_IRQHandler
275+
TIMER0_BRK_IRQHandler
276+
TIMER0_UP_IRQHandler
277+
TIMER0_TRG_CMT_IRQHandler
278+
TIMER0_Channel_IRQHandler
279+
TIMER1_IRQHandler
280+
TIMER2_IRQHandler
281+
TIMER3_IRQHandler
282+
I2C0_EV_IRQHandler
283+
I2C0_ER_IRQHandler
284+
I2C1_EV_IRQHandler
285+
I2C1_ER_IRQHandler
286+
SPI0_IRQHandler
287+
SPI1_IRQHandler
288+
USART0_IRQHandler
289+
USART1_IRQHandler
290+
USART2_IRQHandler
291+
EXTI10_15_IRQHandler
292+
RTC_Alarm_IRQHandler
293+
USBD_WKUP_IRQHandler
294+
EXMC_IRQHandler
295+
296+
297+
298+
B .
299+
ENDP
300+
301+
ALIGN
302+
303+
; user Initial Stack & Heap
304+
305+
IF :DEF:__MICROLIB
306+
307+
EXPORT __initial_sp
308+
EXPORT __heap_base
309+
EXPORT __heap_limit
310+
311+
ELSE
312+
313+
IMPORT __use_two_region_memory
314+
EXPORT __user_initial_stackheap
315+
316+
__user_initial_stackheap PROC
317+
LDR R0, = Heap_Mem
318+
LDR R1, =(Stack_Mem + Stack_Size)
319+
LDR R2, = (Heap_Mem + Heap_Size)
320+
LDR R3, = Stack_Mem
321+
BX LR
322+
ENDP
323+
324+
ALIGN
325+
326+
ENDIF
327+
328+
END

0 commit comments

Comments
 (0)