Skip to content

Commit a6892da

Browse files
authored
Merge pull request #5903 from jeromecoutant/PR_F407_ARM
STM32F407 : correct ARM scatter file
2 parents f1cf77f + 3cefae2 commit a6892da

File tree

6 files changed

+128
-86
lines changed

6 files changed

+128
-86
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/TOOLCHAIN_ARM_MICRO/STM32F407.sct

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; *****************************************
2+
; *** Scatter-Loading Description File ***
3+
; *****************************************
4+
5+
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
6+
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
7+
*.o (RESET, +First)
8+
*(InRoot$$Sections)
9+
.ANY (+RO)
10+
}
11+
RW_IRAM1 0x20000188 0x0001FE78 {
12+
.ANY (+RW +ZI)
13+
}
14+
RW_IRAM2 0x10000000 0x00010000 { ; CCM
15+
.ANY (CCMRAM)
16+
}
17+
}
18+

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/TOOLCHAIN_ARM_MICRO/startup_STM32F40x.S renamed to targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/TOOLCHAIN_ARM_MICRO/startup_STM32F407xx.S

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
;/*****************************************************************************
2-
; * @file: startup_STM32F40x.s
3-
; * @purpose: CMSIS Cortex-M4 Core Device Startup File
4-
; * for the ST STM32F40x Device Series
5-
; * @version: V1.20
6-
; * @date: 16. January 2012
7-
; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------
8-
; *
9-
; * Copyright (C) 2012 ARM Limited. All rights reserved.
10-
; * ARM Limited (ARM) is supplying this software for use with Cortex-M4
11-
; * processor based microcontrollers. This file can be freely distributed
12-
; * within development tools that are supporting such ARM based processors.
13-
; *
14-
; * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
15-
; * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
16-
; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
17-
; * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
18-
; * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
19-
; *
20-
; *****************************************************************************/
1+
;******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
2+
;* File Name : startup_stm32f407xx.s
3+
;* Author : MCD Application Team
4+
;* Description : STM32F407xx devices vector table for MDK-ARM_MICRO 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 CortexM4 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+
;
16+
;* Redistribution and use in source and binary forms, with or without modification,
17+
;* are permitted provided that the following conditions are met:
18+
;* 1. Redistributions of source code must retain the above copyright notice,
19+
;* this 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 STMicroelectronics nor the names of its contributors
24+
;* may be used to endorse or promote products derived from this software
25+
;* without 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
29+
;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30+
;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31+
;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32+
;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33+
;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34+
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35+
;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36+
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
;
38+
;*******************************************************************************
2139

2240
; Amount of memory (in bytes) allocated for Stack
2341
; Tailor this value to your application needs
@@ -56,6 +74,8 @@ __heap_limit EQU (__initial_sp - Stack_Size)
5674

5775
AREA RESET, DATA, READONLY
5876
EXPORT __Vectors
77+
EXPORT __Vectors_End
78+
EXPORT __Vectors_Size
5979

6080
__Vectors DCD __initial_sp ; Top of Stack
6181
DCD Reset_Handler ; Reset Handler
@@ -122,7 +142,7 @@ __Vectors DCD __initial_sp ; Top of Stack
122142
DCD TIM8_TRG_COM_TIM14_IRQHandler ; TIM8 Trigger and Commutation and TIM14
123143
DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
124144
DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
125-
DCD FSMC_IRQHandler ; FSMC
145+
DCD FMC_IRQHandler ; FMC
126146
DCD SDIO_IRQHandler ; SDIO
127147
DCD TIM5_IRQHandler ; TIM5
128148
DCD SPI3_IRQHandler ; SPI3
@@ -153,10 +173,12 @@ __Vectors DCD __initial_sp ; Top of Stack
153173
DCD OTG_HS_WKUP_IRQHandler ; USB OTG HS Wakeup through EXTI
154174
DCD OTG_HS_IRQHandler ; USB OTG HS
155175
DCD DCMI_IRQHandler ; DCMI
156-
DCD CRYP_IRQHandler ; CRYP crypto
176+
DCD 0 ; Reserved
157177
DCD HASH_RNG_IRQHandler ; Hash and Rng
158178
DCD FPU_IRQHandler ; FPU
179+
__Vectors_End
159180

181+
__Vectors_Size EQU __Vectors_End - __Vectors
160182

161183
AREA |.text|, CODE, READONLY
162184

@@ -268,7 +290,7 @@ Default_Handler PROC
268290
EXPORT TIM8_TRG_COM_TIM14_IRQHandler [WEAK]
269291
EXPORT TIM8_CC_IRQHandler [WEAK]
270292
EXPORT DMA1_Stream7_IRQHandler [WEAK]
271-
EXPORT FSMC_IRQHandler [WEAK]
293+
EXPORT FMC_IRQHandler [WEAK]
272294
EXPORT SDIO_IRQHandler [WEAK]
273295
EXPORT TIM5_IRQHandler [WEAK]
274296
EXPORT SPI3_IRQHandler [WEAK]
@@ -299,7 +321,6 @@ Default_Handler PROC
299321
EXPORT OTG_HS_WKUP_IRQHandler [WEAK]
300322
EXPORT OTG_HS_IRQHandler [WEAK]
301323
EXPORT DCMI_IRQHandler [WEAK]
302-
EXPORT CRYP_IRQHandler [WEAK]
303324
EXPORT HASH_RNG_IRQHandler [WEAK]
304325
EXPORT FPU_IRQHandler [WEAK]
305326

@@ -351,7 +372,7 @@ TIM8_UP_TIM13_IRQHandler
351372
TIM8_TRG_COM_TIM14_IRQHandler
352373
TIM8_CC_IRQHandler
353374
DMA1_Stream7_IRQHandler
354-
FSMC_IRQHandler
375+
FMC_IRQHandler
355376
SDIO_IRQHandler
356377
TIM5_IRQHandler
357378
SPI3_IRQHandler
@@ -382,7 +403,6 @@ OTG_HS_EP1_IN_IRQHandler
382403
OTG_HS_WKUP_IRQHandler
383404
OTG_HS_IRQHandler
384405
DCMI_IRQHandler
385-
CRYP_IRQHandler
386406
HASH_RNG_IRQHandler
387407
FPU_IRQHandler
388408

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/TOOLCHAIN_ARM_STD/STM32F407.sct

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; *****************************************
2+
; *** Scatter-Loading Description File ***
3+
; *****************************************
4+
5+
LR_IROM1 0x08000000 0x00100000 { ; load region size_region
6+
ER_IROM1 0x08000000 0x00100000 { ; load address = execution address
7+
*.o (RESET, +First)
8+
*(InRoot$$Sections)
9+
.ANY (+RO)
10+
}
11+
RW_IRAM1 0x20000188 0x0001FE78 {
12+
.ANY (+RW +ZI)
13+
}
14+
RW_IRAM2 0x10000000 0x00010000 { ; CCM
15+
.ANY (CCMRAM)
16+
}
17+
}
18+

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/TOOLCHAIN_ARM_STD/startup_STM32F40x.S renamed to targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/TOOLCHAIN_ARM_STD/startup_STM32F407xx.S

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,41 @@
1-
;/*****************************************************************************
2-
; * @file: startup_STM32F40x.s
3-
; * @purpose: CMSIS Cortex-M4 Core Device Startup File
4-
; * for the ST STM32F40x Device Series
5-
; * @version: V1.20
6-
; * @date: 16. January 2012
7-
; *------- <<< Use Configuration Wizard in Context Menu >>> ------------------
8-
; *
9-
; * Copyright (C) 2012 ARM Limited. All rights reserved.
10-
; * ARM Limited (ARM) is supplying this software for use with Cortex-M4
11-
; * processor based microcontrollers. This file can be freely distributed
12-
; * within development tools that are supporting such ARM based processors.
13-
; *
14-
; * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
15-
; * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
16-
; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
17-
; * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
18-
; * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
19-
; *
20-
; *****************************************************************************/
1+
;******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
2+
;* File Name : startup_stm32f407xx.s
3+
;* Author : MCD Application Team
4+
;* Description : STM32F407xx devices vector table for MDK-ARM_STD 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 CortexM4 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+
;
16+
;* Redistribution and use in source and binary forms, with or without modification,
17+
;* are permitted provided that the following conditions are met:
18+
;* 1. Redistributions of source code must retain the above copyright notice,
19+
;* this 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 STMicroelectronics nor the names of its contributors
24+
;* may be used to endorse or promote products derived from this software
25+
;* without 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
29+
;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
30+
;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
31+
;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32+
;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33+
;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
34+
;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
35+
;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36+
;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37+
;
38+
;*******************************************************************************
2139

2240

2341

@@ -30,6 +48,8 @@ __initial_sp EQU 0x20020000 ; Top of RAM
3048

3149
AREA RESET, DATA, READONLY
3250
EXPORT __Vectors
51+
EXPORT __Vectors_End
52+
EXPORT __Vectors_Size
3353

3454
__Vectors DCD __initial_sp ; Top of Stack
3555
DCD Reset_Handler ; Reset Handler
@@ -96,7 +116,7 @@ __Vectors DCD __initial_sp ; Top of Stack
96116
DCD TIM8_TRG_COM_TIM14_IRQHandler ; TIM8 Trigger and Commutation and TIM14
97117
DCD TIM8_CC_IRQHandler ; TIM8 Capture Compare
98118
DCD DMA1_Stream7_IRQHandler ; DMA1 Stream7
99-
DCD FSMC_IRQHandler ; FSMC
119+
DCD FMC_IRQHandler ; FMC
100120
DCD SDIO_IRQHandler ; SDIO
101121
DCD TIM5_IRQHandler ; TIM5
102122
DCD SPI3_IRQHandler ; SPI3
@@ -127,10 +147,12 @@ __Vectors DCD __initial_sp ; Top of Stack
127147
DCD OTG_HS_WKUP_IRQHandler ; USB OTG HS Wakeup through EXTI
128148
DCD OTG_HS_IRQHandler ; USB OTG HS
129149
DCD DCMI_IRQHandler ; DCMI
130-
DCD CRYP_IRQHandler ; CRYP crypto
150+
DCD 0 ; Reserved
131151
DCD HASH_RNG_IRQHandler ; Hash and Rng
132152
DCD FPU_IRQHandler ; FPU
153+
__Vectors_End
133154

155+
__Vectors_Size EQU __Vectors_End - __Vectors
134156

135157
AREA |.text|, CODE, READONLY
136158

@@ -242,7 +264,7 @@ Default_Handler PROC
242264
EXPORT TIM8_TRG_COM_TIM14_IRQHandler [WEAK]
243265
EXPORT TIM8_CC_IRQHandler [WEAK]
244266
EXPORT DMA1_Stream7_IRQHandler [WEAK]
245-
EXPORT FSMC_IRQHandler [WEAK]
267+
EXPORT FMC_IRQHandler [WEAK]
246268
EXPORT SDIO_IRQHandler [WEAK]
247269
EXPORT TIM5_IRQHandler [WEAK]
248270
EXPORT SPI3_IRQHandler [WEAK]
@@ -273,7 +295,6 @@ Default_Handler PROC
273295
EXPORT OTG_HS_WKUP_IRQHandler [WEAK]
274296
EXPORT OTG_HS_IRQHandler [WEAK]
275297
EXPORT DCMI_IRQHandler [WEAK]
276-
EXPORT CRYP_IRQHandler [WEAK]
277298
EXPORT HASH_RNG_IRQHandler [WEAK]
278299
EXPORT FPU_IRQHandler [WEAK]
279300

@@ -325,7 +346,7 @@ TIM8_UP_TIM13_IRQHandler
325346
TIM8_TRG_COM_TIM14_IRQHandler
326347
TIM8_CC_IRQHandler
327348
DMA1_Stream7_IRQHandler
328-
FSMC_IRQHandler
349+
FMC_IRQHandler
329350
SDIO_IRQHandler
330351
TIM5_IRQHandler
331352
SPI3_IRQHandler
@@ -356,7 +377,6 @@ OTG_HS_EP1_IN_IRQHandler
356377
OTG_HS_WKUP_IRQHandler
357378
OTG_HS_IRQHandler
358379
DCMI_IRQHandler
359-
CRYP_IRQHandler
360380
HASH_RNG_IRQHandler
361381
FPU_IRQHandler
362382

0 commit comments

Comments
 (0)