Skip to content

Commit 8d54214

Browse files
committed
STM32F7: directory restructuration
1 parent ecf4008 commit 8d54214

File tree

247 files changed

+463
-815
lines changed

Some content is hidden

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

247 files changed

+463
-815
lines changed

targets/TARGET_STM/PeripheralPins.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ extern const PinMap PinMap_CAN_RD[];
8080
extern const PinMap PinMap_CAN_TD[];
8181
#endif
8282

83+
//*** QSPI ***
8384
#if DEVICE_QSPI
8485
extern const PinMap PinMap_QSPI_DATA0[];
8586
extern const PinMap PinMap_QSPI_DATA1[];
@@ -89,16 +90,15 @@ extern const PinMap PinMap_QSPI_SCLK[];
8990
extern const PinMap PinMap_QSPI_SSEL[];
9091
#endif
9192

92-
#if DEVICE_USBDEVICE
93-
93+
//*** USB ***
9494
#define USE_USB_NO_OTG 0
9595
#define USE_USB_OTG_FS 1
9696
#define USE_USB_OTG_HS 2
9797
#define USE_USB_HS_IN_FS 3
9898

99+
#if DEVICE_USBDEVICE
99100
extern const PinMap PinMap_USB_HS[];
100101
extern const PinMap PinMap_USB_FS[];
101-
102102
#endif /* DEVICE_USBDEVICE */
103103

104104
#endif

targets/TARGET_STM/README.md

Lines changed: 1 addition & 1 deletion

targets/TARGET_STM/TARGET_STM32F7/device/stm32f7xx_hal_def.h renamed to targets/TARGET_STM/TARGET_STM32F7/STM32Cube_FW/STM32F7xx_HAL_Driver/stm32f7xx_hal_def.h

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

2929
/* Includes ------------------------------------------------------------------*/
3030
#include "stm32f7xx.h"
31-
#include "stm32_hal_legacy.h"
31+
#include "Legacy/stm32_hal_legacy.h"
3232
#include <stddef.h>
3333

3434
/* Exported types ------------------------------------------------------------*/

targets/TARGET_STM/TARGET_STM32F7/device/system_stm32f7xx.c renamed to targets/TARGET_STM/TARGET_STM32F7/STM32Cube_FW/system_stm32f7xx.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
******************************************************************************
33
* @file system_stm32f7xx.c
44
* @author MCD Application Team
5-
* @version V1.2.0
6-
* @date 30-December-2016
75
* @brief CMSIS Cortex-M7 Device Peripheral Access Layer System Source File.
86
*
97
* This file provides two functions and one global variable to be called from
@@ -142,18 +140,14 @@
142140
* @{
143141
*/
144142

145-
/*+ MBED */
146-
#if 0
147-
/*- MBED */
148-
149143
/**
150144
* @brief Setup the microcontroller system
151145
* Initialize the Embedded Flash Interface, the PLL and update the
152146
* SystemFrequency variable.
153147
* @param None
154148
* @retval None
155149
*/
156-
void SystemInit(void)
150+
__weak void SystemInit(void)
157151
{
158152
/* FPU settings ------------------------------------------------------------*/
159153
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
@@ -182,14 +176,11 @@ void SystemInit(void)
182176
#ifdef VECT_TAB_SRAM
183177
SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
184178
#else
185-
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
179+
#include "nvic_addr.h" // MBED
180+
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; // MBED
186181
#endif
187182
}
188183

189-
/*+ MBED */
190-
#endif
191-
/*- MBED */
192-
193184
/**
194185
* @brief Update SystemCoreClock variable according to Clock Register Values.
195186
* The SystemCoreClock variable contains the core clock (HCLK), it can

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/TARGET_DISCO_F746NG/system_clock.c

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2017 ARM Limited
2+
* Copyright (c) 2006-2019 ARM Limited
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
35
*
46
* Licensed under the Apache License, Version 2.0 (the "License");
57
* you may not use this file except in compliance with the License.
@@ -30,15 +32,8 @@
3032
**/
3133

3234
#include "stm32f7xx.h"
33-
#include "nvic_addr.h"
3435
#include "mbed_error.h"
3536

36-
/*!< Uncomment the following line if you need to relocate your vector Table in
37-
Internal SRAM. */
38-
/* #define VECT_TAB_SRAM */
39-
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
40-
This value must be a multiple of 0x200. */
41-
4237
// clock source is selected with CLOCK_SOURCE in json config
4338
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO)
4439
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
@@ -53,51 +48,6 @@ uint8_t SetSysClock_PLL_HSI(void);
5348
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */
5449

5550

56-
/**
57-
* @brief Setup the microcontroller system
58-
* Initialize the Embedded Flash Interface, the PLL and update the
59-
* SystemFrequency variable.
60-
* @param None
61-
* @retval None
62-
*/
63-
void SystemInit(void)
64-
{
65-
/* FPU settings ------------------------------------------------------------*/
66-
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
67-
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10 and CP11 Full Access */
68-
#endif
69-
/* Reset the RCC clock configuration to the default reset state ------------*/
70-
/* Set HSION bit */
71-
RCC->CR |= (uint32_t)0x00000001;
72-
73-
/* Reset CFGR register */
74-
RCC->CFGR = 0x00000000;
75-
76-
/* Reset HSEON, CSSON and PLLON bits */
77-
RCC->CR &= (uint32_t)0xFEF6FFFF;
78-
79-
/* Reset PLLCFGR register */
80-
RCC->PLLCFGR = 0x24003010;
81-
82-
/* Reset HSEBYP bit */
83-
RCC->CR &= (uint32_t)0xFFFBFFFF;
84-
85-
/* Disable all interrupts */
86-
RCC->CIR = 0x00000000;
87-
88-
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
89-
SystemInit_ExtMemCtl();
90-
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
91-
92-
/* Configure the Vector Table location add offset address ------------------*/
93-
#ifdef VECT_TAB_SRAM
94-
SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
95-
#else
96-
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
97-
#endif
98-
99-
}
100-
10151
/**
10252
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
10353
* AHB/APBx prescalers and Flash settings

targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/TARGET_NUCLEO_F746ZG/system_clock.c

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2017 ARM Limited
2+
* Copyright (c) 2006-2019 ARM Limited
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
35
*
46
* Licensed under the Apache License, Version 2.0 (the "License");
57
* you may not use this file except in compliance with the License.
@@ -30,15 +32,8 @@
3032
**/
3133

3234
#include "stm32f7xx.h"
33-
#include "nvic_addr.h"
3435
#include "mbed_error.h"
3536

36-
/*!< Uncomment the following line if you need to relocate your vector Table in
37-
Internal SRAM. */
38-
/* #define VECT_TAB_SRAM */
39-
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
40-
This value must be a multiple of 0x200. */
41-
4237
// clock source is selected with CLOCK_SOURCE in json config
4338
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO)
4439
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
@@ -53,51 +48,6 @@ uint8_t SetSysClock_PLL_HSI(void);
5348
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */
5449

5550

56-
/**
57-
* @brief Setup the microcontroller system
58-
* Initialize the Embedded Flash Interface, the PLL and update the
59-
* SystemFrequency variable.
60-
* @param None
61-
* @retval None
62-
*/
63-
void SystemInit(void)
64-
{
65-
/* FPU settings ------------------------------------------------------------*/
66-
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
67-
SCB->CPACR |= ((3UL << 10 * 2) | (3UL << 11 * 2)); /* set CP10 and CP11 Full Access */
68-
#endif
69-
/* Reset the RCC clock configuration to the default reset state ------------*/
70-
/* Set HSION bit */
71-
RCC->CR |= (uint32_t)0x00000001;
72-
73-
/* Reset CFGR register */
74-
RCC->CFGR = 0x00000000;
75-
76-
/* Reset HSEON, CSSON and PLLON bits */
77-
RCC->CR &= (uint32_t)0xFEF6FFFF;
78-
79-
/* Reset PLLCFGR register */
80-
RCC->PLLCFGR = 0x24003010;
81-
82-
/* Reset HSEBYP bit */
83-
RCC->CR &= (uint32_t)0xFFFBFFFF;
84-
85-
/* Disable all interrupts */
86-
RCC->CIR = 0x00000000;
87-
88-
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
89-
SystemInit_ExtMemCtl();
90-
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
91-
92-
/* Configure the Vector Table location add offset address ------------------*/
93-
#ifdef VECT_TAB_SRAM
94-
SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
95-
#else
96-
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
97-
#endif
98-
99-
}
100-
10151
/**
10252
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
10353
* AHB/APBx prescalers and Flash settings
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
;******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
1+
;******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
22
;* File Name : startup_stm32f746xx.s
33
;* Author : MCD Application Team
4-
;* Version : V1.0.2
5-
;* Date : 21-September-2015
64
;* Description : STM32F746xx devices vector table for MDK-ARM toolchain.
75
;* This module performs:
86
;* - Set the initial SP
@@ -48,9 +46,9 @@
4846
EXPORT __Vectors
4947
EXPORT __Vectors_End
5048
EXPORT __Vectors_Size
51-
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
5249

53-
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
50+
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
51+
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
5452
DCD Reset_Handler ; Reset Handler
5553
DCD NMI_Handler ; NMI Handler
5654
DCD HardFault_Handler ; Hard Fault Handler
@@ -148,7 +146,7 @@ __Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
148146
DCD OTG_HS_IRQHandler ; USB OTG HS
149147
DCD DCMI_IRQHandler ; DCMI
150148
DCD 0 ; Reserved
151-
DCD RNG_IRQHandler ; Hash and Rng
149+
DCD RNG_IRQHandler ; Rng
152150
DCD FPU_IRQHandler ; FPU
153151
DCD UART7_IRQHandler ; UART7
154152
DCD UART8_IRQHandler ; UART8
@@ -325,9 +323,9 @@ Default_Handler PROC
325323
EXPORT LPTIM1_IRQHandler [WEAK]
326324
EXPORT CEC_IRQHandler [WEAK]
327325
EXPORT I2C4_EV_IRQHandler [WEAK]
328-
EXPORT I2C4_ER_IRQHandler [WEAK]
326+
EXPORT I2C4_ER_IRQHandler [WEAK]
329327
EXPORT SPDIF_RX_IRQHandler [WEAK]
330-
328+
331329
WWDG_IRQHandler
332330
PVD_IRQHandler
333331
TAMP_STAMP_IRQHandler
@@ -430,6 +428,11 @@ SPDIF_RX_IRQHandler
430428
ENDP
431429

432430
ALIGN
433-
END
431+
432+
;*******************************************************************************
433+
; User Stack and Heap initialization
434+
;*******************************************************************************
435+
436+
END
434437

435438
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
;******************************************************************************
66
;* @attention
77
;*
8-
;* Copyright (c) 2016-2019 STMicroelectronics.
8+
;* Copyright (c) 2016-2020 STMicroelectronics.
99
;* All rights reserved.
1010
;*
1111
;* This software component is licensed by ST under BSD 3-Clause license,
@@ -14,32 +14,20 @@
1414
;* opensource.org/licenses/BSD-3-Clause
1515
;*
1616
;******************************************************************************
17-
#include "../cmsis_nvic.h"
18-
19-
; STM32F746xG:
20-
; FLASH: 1024K (0x100000) @0x08000000
21-
; SRAM1: 240K (0x3C000) @0x20010000
22-
; SRAM2: 16K (0x4000) @0x2004C000
23-
; DTCM-RAM: 64K (0x10000) @0x20000000
24-
; ITCM-RAM: 16K (0x3FFF) @0x00000000
2517

26-
#define MBED_ROM_START 0x8000000
27-
#define MBED_ROM_SIZE 0x100000
28-
#define MBED_RAM_START 0x20010000
29-
#define MBED_RAM_SIZE 0x40000
30-
#define MBED_RAM1_START 0x20000000
31-
#define MBED_RAM1_SIZE 0x10000
18+
#include "../cmsis_nvic.h"
3219

3320
#if !defined(MBED_APP_START)
34-
#define MBED_APP_START MBED_ROM_START
21+
#define MBED_APP_START MBED_ROM_START
3522
#endif
3623

3724
#if !defined(MBED_APP_SIZE)
38-
#define MBED_APP_SIZE MBED_ROM_SIZE
25+
#define MBED_APP_SIZE MBED_ROM_SIZE
3926
#endif
4027

4128
#if !defined(MBED_BOOT_STACK_SIZE)
42-
#define MBED_BOOT_STACK_SIZE 0x400
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
4331
#endif
4432

4533
#define Stack_Size MBED_BOOT_STACK_SIZE

0 commit comments

Comments
 (0)