Skip to content

Commit 978a966

Browse files
authored
Merge pull request #12201 from jeromecoutant/PR_G0REFACTOR
TARGET_STM: FW driver files refactor proposition
2 parents c53f4d2 + 9448ded commit 978a966

File tree

188 files changed

+46270
-117
lines changed

Some content is hidden

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

188 files changed

+46270
-117
lines changed

targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g030xx.h

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

targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g031xx.h

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

targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g041xx.h

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

targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g070xx.h

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

targets/TARGET_STM/TARGET_STM32G0/TARGET_STM32G071xx/device/stm32g071xx.h renamed to targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g071xx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/**
2-
* SPDX-License-Identifier: BSD-3-Clause
32
******************************************************************************
43
* @file stm32g071xx.h
54
* @author MCD Application Team

targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g081xx.h

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

targets/TARGET_STM/TARGET_STM32G0/TARGET_STM32G071xx/device/stm32g0xx.h renamed to targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/CMSIS/stm32g0xx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/**
2-
* SPDX-License-Identifier: BSD-3-Clause
32
******************************************************************************
43
* @file stm32g0xx.h
54
* @author MCD Application Team

targets/TARGET_STM/TARGET_STM32G0/device/stm32g0xx_hal_def.h renamed to targets/TARGET_STM/TARGET_STM32G0/STM32Cube_FW/STM32G0xx_HAL_Driver/stm32g0xx_hal_def.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C" {
2828

2929
/* Includes ------------------------------------------------------------------*/
3030
#include "stm32g0xx.h"
31-
#include "stm32_hal_legacy.h" /* Aliases file for old names compatibility */
31+
#include "Legacy/stm32_hal_legacy.h" /* Aliases file for old names compatibility */
3232
#include <stddef.h>
3333

3434
/* Exported types ------------------------------------------------------------*/
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
;******************************************************************************
2+
;* File Name : startup_stm32g030xx.s
3+
;* Author : MCD Application Team
4+
;* Description : STM32G030xx devices vector table for MDK-ARM toolchain.
5+
;* This module performs:
6+
;* - Set the initial SP
7+
;* - Set the initial PC == Reset_Handler
8+
;* - Set the vector table entries with the exceptions ISR address
9+
;* - Branches to __main in the C library (which eventually
10+
;* calls main()).
11+
;* After Reset the CortexM0 processor is in Thread mode,
12+
;* priority is Privileged, and the Stack is set to Main.
13+
;* <<< Use Configuration Wizard in Context Menu >>>
14+
;******************************************************************************
15+
;* @attention
16+
;*
17+
;* Copyright (c) 2019 STMicroelectronics. All rights reserved.
18+
;*
19+
;* This software component is licensed by ST under BSD 3-Clause license,
20+
;* the "License"; You may not use this file except in compliance with the
21+
;* License. You may obtain a copy of the License at:
22+
;* opensource.org/licenses/BSD-3-Clause
23+
;*
24+
;******************************************************************************
25+
26+
PRESERVE8
27+
THUMB
28+
29+
30+
; Vector Table Mapped to Address 0 at Reset
31+
AREA RESET, DATA, READONLY
32+
EXPORT __Vectors
33+
EXPORT __Vectors_End
34+
EXPORT __Vectors_Size
35+
36+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
37+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
38+
DCD Reset_Handler ; Reset Handler
39+
DCD NMI_Handler ; NMI Handler
40+
DCD HardFault_Handler ; Hard Fault Handler
41+
DCD 0 ; Reserved
42+
DCD 0 ; Reserved
43+
DCD 0 ; Reserved
44+
DCD 0 ; Reserved
45+
DCD 0 ; Reserved
46+
DCD 0 ; Reserved
47+
DCD 0 ; Reserved
48+
DCD SVC_Handler ; SVCall Handler
49+
DCD 0 ; Reserved
50+
DCD 0 ; Reserved
51+
DCD PendSV_Handler ; PendSV Handler
52+
DCD SysTick_Handler ; SysTick Handler
53+
54+
; External Interrupts
55+
DCD WWDG_IRQHandler ; Window Watchdog
56+
DCD 0 ; Reserved
57+
DCD RTC_TAMP_IRQHandler ; RTC through EXTI Line
58+
DCD FLASH_IRQHandler ; FLASH
59+
DCD RCC_IRQHandler ; RCC
60+
DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1
61+
DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3
62+
DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15
63+
DCD 0 ; Reserved
64+
DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1
65+
DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3
66+
DCD DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler ; DMA1 Channel 4 to Channel 5, DMAMUX1 overrun
67+
DCD ADC1_IRQHandler ; ADC1
68+
DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; TIM1 Break, Update, Trigger and Commutation
69+
DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare
70+
DCD 0 ; Reserved
71+
DCD TIM3_IRQHandler ; TIM3
72+
DCD 0 ; Reserved
73+
DCD 0 ; Reserved
74+
DCD TIM14_IRQHandler ; TIM14
75+
DCD 0 ; Reserved
76+
DCD TIM16_IRQHandler ; TIM16
77+
DCD TIM17_IRQHandler ; TIM17
78+
DCD I2C1_IRQHandler ; I2C1
79+
DCD I2C2_IRQHandler ; I2C2
80+
DCD SPI1_IRQHandler ; SPI1
81+
DCD SPI2_IRQHandler ; SPI2
82+
DCD USART1_IRQHandler ; USART1
83+
DCD USART2_IRQHandler ; USART2
84+
DCD 0 ; Reserved
85+
DCD 0 ; Reserved
86+
DCD 0 ; Reserved
87+
88+
__Vectors_End
89+
90+
__Vectors_Size EQU __Vectors_End - __Vectors
91+
92+
AREA |.text|, CODE, READONLY
93+
94+
; Reset handler routine
95+
Reset_Handler PROC
96+
EXPORT Reset_Handler [WEAK]
97+
IMPORT __main
98+
IMPORT SystemInit
99+
LDR R0, =SystemInit
100+
BLX R0
101+
LDR R0, =__main
102+
BX R0
103+
ENDP
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+
SVC_Handler PROC
117+
EXPORT SVC_Handler [WEAK]
118+
B .
119+
ENDP
120+
PendSV_Handler PROC
121+
EXPORT PendSV_Handler [WEAK]
122+
B .
123+
ENDP
124+
SysTick_Handler PROC
125+
EXPORT SysTick_Handler [WEAK]
126+
B .
127+
ENDP
128+
129+
Default_Handler PROC
130+
131+
EXPORT WWDG_IRQHandler [WEAK]
132+
EXPORT RTC_TAMP_IRQHandler [WEAK]
133+
EXPORT FLASH_IRQHandler [WEAK]
134+
EXPORT RCC_IRQHandler [WEAK]
135+
EXPORT EXTI0_1_IRQHandler [WEAK]
136+
EXPORT EXTI2_3_IRQHandler [WEAK]
137+
EXPORT EXTI4_15_IRQHandler [WEAK]
138+
EXPORT DMA1_Channel1_IRQHandler [WEAK]
139+
EXPORT DMA1_Channel2_3_IRQHandler [WEAK]
140+
EXPORT DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler [WEAK]
141+
EXPORT ADC1_IRQHandler [WEAK]
142+
EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK]
143+
EXPORT TIM1_CC_IRQHandler [WEAK]
144+
EXPORT TIM3_IRQHandler [WEAK]
145+
EXPORT TIM14_IRQHandler [WEAK]
146+
EXPORT TIM16_IRQHandler [WEAK]
147+
EXPORT TIM17_IRQHandler [WEAK]
148+
EXPORT I2C1_IRQHandler [WEAK]
149+
EXPORT I2C2_IRQHandler [WEAK]
150+
EXPORT SPI1_IRQHandler [WEAK]
151+
EXPORT SPI2_IRQHandler [WEAK]
152+
EXPORT USART1_IRQHandler [WEAK]
153+
EXPORT USART2_IRQHandler [WEAK]
154+
155+
156+
WWDG_IRQHandler
157+
RTC_TAMP_IRQHandler
158+
FLASH_IRQHandler
159+
RCC_IRQHandler
160+
EXTI0_1_IRQHandler
161+
EXTI2_3_IRQHandler
162+
EXTI4_15_IRQHandler
163+
DMA1_Channel1_IRQHandler
164+
DMA1_Channel2_3_IRQHandler
165+
DMA1_Ch4_5_DMAMUX1_OVR_IRQHandler
166+
ADC1_IRQHandler
167+
TIM1_BRK_UP_TRG_COM_IRQHandler
168+
TIM1_CC_IRQHandler
169+
TIM3_IRQHandler
170+
TIM14_IRQHandler
171+
TIM16_IRQHandler
172+
TIM17_IRQHandler
173+
I2C1_IRQHandler
174+
I2C2_IRQHandler
175+
SPI1_IRQHandler
176+
SPI2_IRQHandler
177+
USART1_IRQHandler
178+
USART2_IRQHandler
179+
180+
B .
181+
182+
ENDP
183+
184+
ALIGN
185+
186+
;*******************************************************************************
187+
; User Stack and Heap initialization
188+
;*******************************************************************************
189+
190+
END
191+
192+
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#! armcc -E
2+
; Scatter-Loading Description File
3+
;
4+
; SPDX-License-Identifier: BSD-3-Clause
5+
;******************************************************************************
6+
;* @attention
7+
;*
8+
;* Copyright (c) 2016-2020 STMicroelectronics.
9+
;* All rights reserved.
10+
;*
11+
;* This software component is licensed by ST under BSD 3-Clause license,
12+
;* the "License"; You may not use this file except in compliance with the
13+
;* License. You may obtain a copy of the License at:
14+
;* opensource.org/licenses/BSD-3-Clause
15+
;*
16+
;******************************************************************************
17+
18+
#include "../cmsis_nvic.h"
19+
20+
#if !defined(MBED_APP_START)
21+
#define MBED_APP_START MBED_ROM_START
22+
#endif
23+
24+
#if !defined(MBED_APP_SIZE)
25+
#define MBED_APP_SIZE MBED_ROM_SIZE
26+
#endif
27+
28+
#if !defined(MBED_BOOT_STACK_SIZE)
29+
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
30+
#define MBED_BOOT_STACK_SIZE 0x400
31+
#endif
32+
33+
/* Round up VECTORS_SIZE to 8 bytes */
34+
#define VECTORS_SIZE (((NVIC_NUM_VECTORS * 4) + 7) AND ~7)
35+
36+
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
37+
38+
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
39+
*.o (RESET, +First)
40+
*(InRoot$$Sections)
41+
.ANY (+RO)
42+
}
43+
44+
RW_IRAM1 (MBED_RAM_START + VECTORS_SIZE) { ; RW data
45+
.ANY (+RW +ZI)
46+
}
47+
48+
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_START + MBED_RAM_SIZE - MBED_BOOT_STACK_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) { ; Heap growing up
49+
}
50+
51+
ARM_LIB_STACK (MBED_RAM_START + MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; Stack region growing down
52+
}
53+
}

0 commit comments

Comments
 (0)