mirror of https://github.com/ARMmbed/mbed-os.git
[STM32F7_NUCLEO_F746ZG] Update target files with latest STM32F7Cube_FW version
parent
49338852ad
commit
c97e05f496
|
@ -1,8 +1,8 @@
|
|||
;******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
|
||||
;* File Name : startup_stm32f746xx.s
|
||||
;* Author : MCD Application Team
|
||||
;* Version : V1.0.0
|
||||
;* Date : 28-April-2015
|
||||
;* Version : V1.0.2
|
||||
;* Date : 21-September-2015
|
||||
;* Description : STM32F746xx devices vector table for MDK-ARM toolchain.
|
||||
;* This module performs:
|
||||
;* - Set the initial SP
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;******************** (C) COPYRIGHT 2015 STMicroelectronics ********************
|
||||
;* File Name : startup_stm32f746xx.s
|
||||
;* Author : MCD Application Team
|
||||
;* Version : V1.0.0
|
||||
;* Date : 28-April-2015
|
||||
;* Version : V1.0.2
|
||||
;* Date : 21-September-2015
|
||||
;* Description : STM32F746xx devices vector table for MDK-ARM toolchain.
|
||||
;* This module performs:
|
||||
;* - Set the initial SP
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
******************************************************************************
|
||||
* @file startup_stm32f746xx.s
|
||||
* @author MCD Application Team
|
||||
* Version V1.0.0
|
||||
* Date 28-April-2015
|
||||
* @Version V1.0.2
|
||||
* @Date 21-September-2015
|
||||
* @brief STM32F746xx Devices vector table for GCC based toolchain.
|
||||
* This module performs:
|
||||
* - Set the initial SP
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
;/******************** (C) COPYRIGHT 2016 STMicroelectronics ********************
|
||||
;* File Name : startup_stm32f746xx.s
|
||||
;* Author : MCD Application Team
|
||||
;* Version : V1.0.0
|
||||
;* Date : 28-April-2015
|
||||
;* Version : V1.0.2
|
||||
;* Date : 21-September-2015
|
||||
;* Description : STM32F746xx devices vector table for EWARM toolchain.
|
||||
;* This module performs:
|
||||
;* - Set the initial SP
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
******************************************************************************
|
||||
* @file stm32f746xx.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-June-2015
|
||||
* @version V1.0.2
|
||||
* @date 21-September-2015
|
||||
* @brief CMSIS STM32F746xx Device Peripheral Access Layer Header File.
|
||||
*
|
||||
* This file contains:
|
||||
|
@ -14,7 +14,7 @@
|
|||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
|
@ -64,7 +64,7 @@
|
|||
* @brief STM32F7xx Interrupt Number Definition, according to the selected device
|
||||
* in @ref Library_configuration_section
|
||||
*/
|
||||
typedef enum IRQn
|
||||
typedef enum
|
||||
{
|
||||
/****** Cortex-M7 Processor Exceptions Numbers ****************************************************************/
|
||||
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
|
||||
|
@ -125,7 +125,7 @@ typedef enum IRQn
|
|||
TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare Interrupt */
|
||||
DMA1_Stream7_IRQn = 47, /*!< DMA1 Stream7 Interrupt */
|
||||
FMC_IRQn = 48, /*!< FMC global Interrupt */
|
||||
SDMMC1_IRQn = 49, /*!< SDMMC1 global Interrupt */
|
||||
SDMMC1_IRQn = 49, /*!< SDMMC1 global Interrupt */
|
||||
TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
|
||||
SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
|
||||
UART4_IRQn = 52, /*!< UART4 global Interrupt */
|
||||
|
@ -182,14 +182,14 @@ typedef enum IRQn
|
|||
/**
|
||||
* @brief Configuration of the Cortex-M7 Processor and Core Peripherals
|
||||
*/
|
||||
#define __CM7_REV 0x0000 /*!< Cortex-M7 revision r0p1 */
|
||||
#define __CM7_REV 0x0001 /*!< Cortex-M7 revision r0p1 */
|
||||
#define __MPU_PRESENT 1 /*!< CM7 provides an MPU */
|
||||
#define __NVIC_PRIO_BITS 4 /*!< CM7 uses 4 Bits for the Priority Levels */
|
||||
#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
|
||||
#define __FPU_PRESENT 1 /*!< FPU present */
|
||||
#define __ICACHE_PRESENT 1 /*!< CM7 instruction cache present */
|
||||
#define __DCACHE_PRESENT 1 /*!< CM7 data cache present */
|
||||
#include "core_cm7.h" /*!< Cortex-M7 processor and core peripherals */
|
||||
#include "core_cm7.h" /*!< Cortex-M7 processor and core peripherals */
|
||||
|
||||
|
||||
#include "system_stm32f7xx.h"
|
||||
|
@ -353,6 +353,7 @@ typedef struct
|
|||
__IO uint32_t SR; /*!< DAC status register, Address offset: 0x34 */
|
||||
} DAC_TypeDef;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Debug MCU
|
||||
*/
|
||||
|
@ -697,11 +698,10 @@ typedef struct
|
|||
__IO uint32_t CFBLR; /*!< LTDC Layerx Color Frame Buffer Length Register Address offset: 0xB0 */
|
||||
__IO uint32_t CFBLNR; /*!< LTDC Layerx ColorFrame Buffer Line Number Register Address offset: 0xB4 */
|
||||
uint32_t RESERVED1[3]; /*!< Reserved */
|
||||
__IO uint32_t CLUTWR; /*!< LTDC Layerx CLUT Write Register Address offset: 0x144 */
|
||||
__IO uint32_t CLUTWR; /*!< LTDC Layerx CLUT Write Register Address offset: 0x144 */
|
||||
|
||||
} LTDC_Layer_TypeDef;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Power Control
|
||||
*/
|
||||
|
@ -967,7 +967,6 @@ typedef struct
|
|||
__IO uint32_t CMP; /*!< LPTIM Compare register, Address offset: 0x14 */
|
||||
__IO uint32_t ARR; /*!< LPTIM Autoreload register, Address offset: 0x18 */
|
||||
__IO uint32_t CNT; /*!< LPTIM Counter register, Address offset: 0x1C */
|
||||
__IO uint32_t OR; /*!< LPTIM Option register, Address offset: 0x20 */
|
||||
} LPTIM_TypeDef;
|
||||
|
||||
|
||||
|
@ -1002,6 +1001,7 @@ typedef struct
|
|||
__IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
|
||||
} WWDG_TypeDef;
|
||||
|
||||
|
||||
/**
|
||||
* @brief RNG
|
||||
*/
|
||||
|
@ -1140,7 +1140,8 @@ typedef struct
|
|||
* @}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/** @addtogroup Peripheral_memory_map
|
||||
* @{
|
||||
*/
|
||||
|
@ -1148,13 +1149,13 @@ typedef struct
|
|||
#define FLASHITCM_BASE ((uint32_t)0x00200000) /*!< Base address of :(up to 1 MB) embedded FLASH memory accessible over ITCM */
|
||||
#define FLASHAXI_BASE ((uint32_t)0x08000000) /*!< Base address of : (up to 1 MB) embedded FLASH memory accessible over AXI */
|
||||
#define RAMDTCM_BASE ((uint32_t)0x20000000) /*!< Base address of : 64KB system data RAM accessible over DTCM */
|
||||
#define SRAM1_BASE ((uint32_t)0x20010000) /*!< Base address of : 240KB RAM1 accessible over AXI/AHB */
|
||||
#define SRAM2_BASE ((uint32_t)0x2004C000) /*!< Base address of : 16KB RAM2 accessible over AXI/AHB */
|
||||
#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Base address of : AHB/ABP Peripherals */
|
||||
#define BKPSRAM_BASE ((uint32_t)0x40024000) /*!< Base address of : Backup SRAM(4 KB) */
|
||||
#define QSPI_BASE ((uint32_t)0x90000000) /*!< Base address of : QSPI memories accessible over AXI */
|
||||
#define FMC_R_BASE ((uint32_t)0xA0000000) /*!< Base address of : FMC Control registers */
|
||||
#define QSPI_R_BASE ((uint32_t)0xA0001000) /*!< Base address of : QSPI Control registers */
|
||||
#define SRAM1_BASE ((uint32_t)0x20010000) /*!< Base address of : 240KB RAM1 accessible over AXI/AHB */
|
||||
#define SRAM2_BASE ((uint32_t)0x2004C000) /*!< Base address of : 16KB RAM2 accessible over AXI/AHB */
|
||||
#define FLASH_END ((uint32_t)0x080FFFFF) /*!< FLASH end address */
|
||||
|
||||
/* Legacy define */
|
||||
|
@ -1226,7 +1227,7 @@ typedef struct
|
|||
#define SAI2_Block_B_BASE (SAI2_BASE + 0x024)
|
||||
#define LTDC_BASE (APB2PERIPH_BASE + 0x6800)
|
||||
#define LTDC_Layer1_BASE (LTDC_BASE + 0x84)
|
||||
#define LTDC_Layer2_BASE (LTDC_BASE + 0x104)
|
||||
#define LTDC_Layer2_BASE (LTDC_BASE + 0x104)
|
||||
/*!< AHB1 peripherals */
|
||||
#define GPIOA_BASE (AHB1PERIPH_BASE + 0x0000)
|
||||
#define GPIOB_BASE (AHB1PERIPH_BASE + 0x0400)
|
||||
|
@ -3125,6 +3126,7 @@ typedef struct
|
|||
/******************* Bit definition for CRC_POL register ********************/
|
||||
#define CRC_POL_POL ((uint32_t)0xFFFFFFFF) /*!< Coefficients of the polynomial */
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Digital to Analog Converter */
|
||||
|
@ -3216,6 +3218,7 @@ typedef struct
|
|||
#define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!<DAC channel1 DMA underrun flag */
|
||||
#define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!<DAC channel2 DMA underrun flag */
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Debug MCU */
|
||||
|
@ -3291,7 +3294,7 @@ typedef struct
|
|||
#define DMA_SxCR_CHSEL ((uint32_t)0x0E000000)
|
||||
#define DMA_SxCR_CHSEL_0 ((uint32_t)0x02000000)
|
||||
#define DMA_SxCR_CHSEL_1 ((uint32_t)0x04000000)
|
||||
#define DMA_SxCR_CHSEL_2 ((uint32_t)0x08000000)
|
||||
#define DMA_SxCR_CHSEL_2 ((uint32_t)0x08000000)
|
||||
#define DMA_SxCR_MBURST ((uint32_t)0x01800000)
|
||||
#define DMA_SxCR_MBURST_0 ((uint32_t)0x00800000)
|
||||
#define DMA_SxCR_MBURST_1 ((uint32_t)0x01000000)
|
||||
|
@ -3841,8 +3844,6 @@ typedef struct
|
|||
#define FLASH_OPTCR1_BOOT_ADD0 ((uint32_t)0x0000FFFF)
|
||||
#define FLASH_OPTCR1_BOOT_ADD1 ((uint32_t)0xFFFF0000)
|
||||
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Flexible Memory Controller */
|
||||
|
@ -4877,6 +4878,7 @@ typedef struct
|
|||
#define GPIO_LCKR_LCK15 ((uint32_t)0x00008000)
|
||||
#define GPIO_LCKR_LCKK ((uint32_t)0x00010000)
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Inter-integrated Circuit Interface (I2C) */
|
||||
|
@ -4891,7 +4893,7 @@ typedef struct
|
|||
#define I2C_CR1_STOPIE ((uint32_t)0x00000020) /*!< STOP detection interrupt enable */
|
||||
#define I2C_CR1_TCIE ((uint32_t)0x00000040) /*!< Transfer complete interrupt enable */
|
||||
#define I2C_CR1_ERRIE ((uint32_t)0x00000080) /*!< Errors interrupt enable */
|
||||
#define I2C_CR1_DFN ((uint32_t)0x00000F00) /*!< Digital noise filter */
|
||||
#define I2C_CR1_DNF ((uint32_t)0x00000F00) /*!< Digital noise filter */
|
||||
#define I2C_CR1_ANFOFF ((uint32_t)0x00001000) /*!< Analog noise filter OFF */
|
||||
#define I2C_CR1_SWRST ((uint32_t)0x00002000) /*!< Software reset */
|
||||
#define I2C_CR1_TXDMAEN ((uint32_t)0x00004000) /*!< DMA transmission requests enable */
|
||||
|
@ -4905,6 +4907,9 @@ typedef struct
|
|||
#define I2C_CR1_ALERTEN ((uint32_t)0x00400000) /*!< SMBus alert enable */
|
||||
#define I2C_CR1_PECEN ((uint32_t)0x00800000) /*!< PEC enable */
|
||||
|
||||
/* Legacy define */
|
||||
#define I2C_CR1_DFN I2C_CR1_DNF /*!< Digital noise filter */
|
||||
|
||||
/****************** Bit definition for I2C_CR2 register ********************/
|
||||
#define I2C_CR2_SADD ((uint32_t)0x000003FF) /*!< Slave address (master mode) */
|
||||
#define I2C_CR2_RD_WRN ((uint32_t)0x00000400) /*!< Transfer direction (master mode) */
|
||||
|
@ -5163,7 +5168,6 @@ typedef struct
|
|||
#define LTDC_LxCLUTWR_RED ((uint32_t)0x00FF0000) /*!< Red value */
|
||||
#define LTDC_LxCLUTWR_CLUTADD ((uint32_t)0xFF000000) /*!< CLUT address */
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Power Control */
|
||||
|
@ -5453,6 +5457,7 @@ typedef struct
|
|||
#define RCC_PLLCFGR_PLLQ_2 ((uint32_t)0x04000000)
|
||||
#define RCC_PLLCFGR_PLLQ_3 ((uint32_t)0x08000000)
|
||||
|
||||
|
||||
/******************** Bit definition for RCC_CFGR register ******************/
|
||||
/*!< SW configuration */
|
||||
#define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
|
||||
|
@ -6496,7 +6501,7 @@ typedef struct
|
|||
#define SAI_xCR2_MUTECNT_4 ((uint32_t)0x00000800) /*!<Bit 4 */
|
||||
#define SAI_xCR2_MUTECNT_5 ((uint32_t)0x00001000) /*!<Bit 5 */
|
||||
|
||||
#define SAI_xCR2_CPL ((uint32_t)0x00080000) /*!< Complement Bit */
|
||||
#define SAI_xCR2_CPL ((uint32_t)0x00002000) /*!< Complement Bit */
|
||||
|
||||
#define SAI_xCR2_COMP ((uint32_t)0x0000C000) /*!<COMP[1:0] (Companding mode) */
|
||||
#define SAI_xCR2_COMP_0 ((uint32_t)0x00004000) /*!<Bit 0 */
|
||||
|
@ -6907,13 +6912,15 @@ typedef struct
|
|||
/* */
|
||||
/******************************************************************************/
|
||||
/****************** Bit definition for SYSCFG_MEMRMP register ***************/
|
||||
#define SYSCFG_MEMRMP_MEM_BOOT ((uint32_t)0x00000001) /*!< Boot information after Reset */
|
||||
#define SYSCFG_MEMRMP_MEM_BOOT ((uint32_t)0x00000001) /*!< Boot information after Reset */
|
||||
|
||||
|
||||
#define SYSCFG_MEMRMP_SWP_FMC ((uint32_t)0x00000C00) /*!< FMC Memory Mapping swapping */
|
||||
#define SYSCFG_MEMRMP_SWP_FMC_0 ((uint32_t)0x00000400)
|
||||
#define SYSCFG_MEMRMP_SWP_FMC_1 ((uint32_t)0x00000800)
|
||||
|
||||
/****************** Bit definition for SYSCFG_PMC register ******************/
|
||||
|
||||
#define SYSCFG_PMC_ADCxDC2 ((uint32_t)0x00070000) /*!< Refer to AN4073 on how to use this bit */
|
||||
#define SYSCFG_PMC_ADC1DC2 ((uint32_t)0x00010000) /*!< Refer to AN4073 on how to use this bit */
|
||||
#define SYSCFG_PMC_ADC2DC2 ((uint32_t)0x00020000) /*!< Refer to AN4073 on how to use this bit */
|
||||
|
@ -7540,6 +7547,7 @@ typedef struct
|
|||
/******************* Bit definition for TIM_CCR6 register *******************/
|
||||
#define TIM_CCR6_CCR6 ((uint16_t)0xFFFF) /*!<Capture/Compare 6 Value */
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* Low Power Timer (LPTIM) */
|
||||
|
@ -7705,6 +7713,7 @@ typedef struct
|
|||
#define USART_CR3_SCARCNT_1 ((uint32_t)0x00040000) /*!< Bit 1 */
|
||||
#define USART_CR3_SCARCNT_2 ((uint32_t)0x00080000) /*!< Bit 2 */
|
||||
|
||||
|
||||
/****************** Bit definition for USART_BRR register *******************/
|
||||
#define USART_BRR_DIV_FRACTION ((uint32_t)0x000F) /*!< Fraction of USARTDIV */
|
||||
#define USART_BRR_DIV_MANTISSA ((uint32_t)0xFFF0) /*!< Mantissa of USARTDIV */
|
||||
|
@ -7775,35 +7784,57 @@ typedef struct
|
|||
/* */
|
||||
/******************************************************************************/
|
||||
/******************* Bit definition for WWDG_CR register ********************/
|
||||
#define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
|
||||
#define WWDG_CR_T0 ((uint32_t)0x01) /*!<Bit 0 */
|
||||
#define WWDG_CR_T1 ((uint32_t)0x02) /*!<Bit 1 */
|
||||
#define WWDG_CR_T2 ((uint32_t)0x04) /*!<Bit 2 */
|
||||
#define WWDG_CR_T3 ((uint32_t)0x08) /*!<Bit 3 */
|
||||
#define WWDG_CR_T4 ((uint32_t)0x10) /*!<Bit 4 */
|
||||
#define WWDG_CR_T5 ((uint32_t)0x20) /*!<Bit 5 */
|
||||
#define WWDG_CR_T6 ((uint32_t)0x40) /*!<Bit 6 */
|
||||
#define WWDG_CR_T ((uint32_t)0x7F) /*!<T[6:0] bits (7-Bit counter (MSB to LSB)) */
|
||||
#define WWDG_CR_T_0 ((uint32_t)0x01) /*!<Bit 0 */
|
||||
#define WWDG_CR_T_1 ((uint32_t)0x02) /*!<Bit 1 */
|
||||
#define WWDG_CR_T_2 ((uint32_t)0x04) /*!<Bit 2 */
|
||||
#define WWDG_CR_T_3 ((uint32_t)0x08) /*!<Bit 3 */
|
||||
#define WWDG_CR_T_4 ((uint32_t)0x10) /*!<Bit 4 */
|
||||
#define WWDG_CR_T_5 ((uint32_t)0x20) /*!<Bit 5 */
|
||||
#define WWDG_CR_T_6 ((uint32_t)0x40) /*!<Bit 6 */
|
||||
|
||||
#define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
|
||||
/* Legacy defines */
|
||||
#define WWDG_CR_T0 WWDG_CR_T_0 /*!<Bit 0 */
|
||||
#define WWDG_CR_T1 WWDG_CR_T_1 /*!<Bit 1 */
|
||||
#define WWDG_CR_T2 WWDG_CR_T_2 /*!<Bit 2 */
|
||||
#define WWDG_CR_T3 WWDG_CR_T_3 /*!<Bit 3 */
|
||||
#define WWDG_CR_T4 WWDG_CR_T_4 /*!<Bit 4 */
|
||||
#define WWDG_CR_T5 WWDG_CR_T_5 /*!<Bit 5 */
|
||||
#define WWDG_CR_T6 WWDG_CR_T_6 /*!<Bit 6 */
|
||||
|
||||
#define WWDG_CR_WDGA ((uint32_t)0x80) /*!<Activation bit */
|
||||
|
||||
/******************* Bit definition for WWDG_CFR register *******************/
|
||||
#define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
|
||||
#define WWDG_CFR_W0 ((uint32_t)0x0001) /*!<Bit 0 */
|
||||
#define WWDG_CFR_W1 ((uint32_t)0x0002) /*!<Bit 1 */
|
||||
#define WWDG_CFR_W2 ((uint32_t)0x0004) /*!<Bit 2 */
|
||||
#define WWDG_CFR_W3 ((uint32_t)0x0008) /*!<Bit 3 */
|
||||
#define WWDG_CFR_W4 ((uint32_t)0x0010) /*!<Bit 4 */
|
||||
#define WWDG_CFR_W5 ((uint32_t)0x0020) /*!<Bit 5 */
|
||||
#define WWDG_CFR_W6 ((uint32_t)0x0040) /*!<Bit 6 */
|
||||
#define WWDG_CFR_W ((uint32_t)0x007F) /*!<W[6:0] bits (7-bit window value) */
|
||||
#define WWDG_CFR_W_0 ((uint32_t)0x0001) /*!<Bit 0 */
|
||||
#define WWDG_CFR_W_1 ((uint32_t)0x0002) /*!<Bit 1 */
|
||||
#define WWDG_CFR_W_2 ((uint32_t)0x0004) /*!<Bit 2 */
|
||||
#define WWDG_CFR_W_3 ((uint32_t)0x0008) /*!<Bit 3 */
|
||||
#define WWDG_CFR_W_4 ((uint32_t)0x0010) /*!<Bit 4 */
|
||||
#define WWDG_CFR_W_5 ((uint32_t)0x0020) /*!<Bit 5 */
|
||||
#define WWDG_CFR_W_6 ((uint32_t)0x0040) /*!<Bit 6 */
|
||||
|
||||
#define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
|
||||
#define WWDG_CFR_WDGTB0 ((uint32_t)0x0080) /*!<Bit 0 */
|
||||
#define WWDG_CFR_WDGTB1 ((uint32_t)0x0100) /*!<Bit 1 */
|
||||
/* Legacy defines */
|
||||
#define WWDG_CFR_W0 WWDG_CFR_W_0 /*!<Bit 0 */
|
||||
#define WWDG_CFR_W1 WWDG_CFR_W_1 /*!<Bit 1 */
|
||||
#define WWDG_CFR_W2 WWDG_CFR_W_2 /*!<Bit 2 */
|
||||
#define WWDG_CFR_W3 WWDG_CFR_W_3 /*!<Bit 3 */
|
||||
#define WWDG_CFR_W4 WWDG_CFR_W_4 /*!<Bit 4 */
|
||||
#define WWDG_CFR_W5 WWDG_CFR_W_5 /*!<Bit 5 */
|
||||
#define WWDG_CFR_W6 WWDG_CFR_W_6 /*!<Bit 6 */
|
||||
|
||||
#define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
|
||||
#define WWDG_CFR_WDGTB ((uint32_t)0x0180) /*!<WDGTB[1:0] bits (Timer Base) */
|
||||
#define WWDG_CFR_WDGTB_0 ((uint32_t)0x0080) /*!<Bit 0 */
|
||||
#define WWDG_CFR_WDGTB_1 ((uint32_t)0x0100) /*!<Bit 1 */
|
||||
|
||||
/* Legacy defines */
|
||||
#define WWDG_CFR_WDGTB0 WWDG_CFR_WDGTB_0 /*!<Bit 0 */
|
||||
#define WWDG_CFR_WDGTB1 WWDG_CFR_WDGTB_1 /*!<Bit 1 */
|
||||
|
||||
#define WWDG_CFR_EWI ((uint32_t)0x0200) /*!<Early Wakeup Interrupt */
|
||||
|
||||
/******************* Bit definition for WWDG_SR register ********************/
|
||||
#define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
|
||||
#define WWDG_SR_EWIF ((uint32_t)0x01) /*!<Early Wakeup Interrupt Flag */
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
|
@ -8476,6 +8507,7 @@ typedef struct
|
|||
#define USB_OTG_DOEPMSK_EPDM ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt mask */
|
||||
#define USB_OTG_DOEPMSK_STUPM ((uint32_t)0x00000008) /*!< SETUP phase done mask */
|
||||
#define USB_OTG_DOEPMSK_OTEPDM ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled mask */
|
||||
#define USB_OTG_DOEPMSK_OTEPSPRM ((uint32_t)0x00000020) /*!< Status Phase Received mask */
|
||||
#define USB_OTG_DOEPMSK_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received mask */
|
||||
#define USB_OTG_DOEPMSK_OPEM ((uint32_t)0x00000100) /*!< OUT packet error mask */
|
||||
#define USB_OTG_DOEPMSK_BOIM ((uint32_t)0x00000200) /*!< BNA interrupt mask */
|
||||
|
@ -8943,6 +8975,7 @@ typedef struct
|
|||
#define USB_OTG_DOEPINT_EPDISD ((uint32_t)0x00000002) /*!< Endpoint disabled interrupt */
|
||||
#define USB_OTG_DOEPINT_STUP ((uint32_t)0x00000008) /*!< SETUP phase done */
|
||||
#define USB_OTG_DOEPINT_OTEPDIS ((uint32_t)0x00000010) /*!< OUT token received when endpoint disabled */
|
||||
#define USB_OTG_DOEPINT_OTEPSPR ((uint32_t)0x00000020) /*!< Status Phase Received For Control Write */
|
||||
#define USB_OTG_DOEPINT_B2BSTUP ((uint32_t)0x00000040) /*!< Back-to-back SETUP packets received */
|
||||
#define USB_OTG_DOEPINT_NYET ((uint32_t)0x00004000) /*!< NYET interrupt */
|
||||
|
||||
|
@ -8989,6 +9022,7 @@ typedef struct
|
|||
/******************************* DCMI Instances *******************************/
|
||||
#define IS_DCMI_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == DCMI)
|
||||
|
||||
|
||||
/******************************* DMA2D Instances *******************************/
|
||||
#define IS_DMA2D_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == DMA2D)
|
||||
|
||||
|
@ -9059,6 +9093,7 @@ typedef struct
|
|||
/****************************** LTDC Instances ********************************/
|
||||
#define IS_LTDC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == LTDC)
|
||||
|
||||
|
||||
/******************************* RNG Instances ********************************/
|
||||
#define IS_RNG_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == RNG)
|
||||
|
||||
|
@ -9075,7 +9110,6 @@ typedef struct
|
|||
/******************************** SDMMC Instances *******************************/
|
||||
#define IS_SDMMC_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == SDMMC1)
|
||||
|
||||
|
||||
/****************************** SPDIFRX Instances *********************************/
|
||||
#define IS_SPDIFRX_ALL_INSTANCE(__INSTANCE__) ((__INSTANCE__) == SPDIFRX)
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
******************************************************************************
|
||||
* @file stm32f7xx.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-June-2015
|
||||
* @version V1.0.2
|
||||
* @date 21-September-2015
|
||||
* @brief CMSIS STM32F7xx Device Peripheral Access Layer Header File.
|
||||
*
|
||||
* The file is the unique include file that the application programmer
|
||||
|
@ -18,7 +18,7 @@
|
|||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
******************************************************************************
|
||||
* @file stm32f7xx_hal_conf_template.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-June-2015
|
||||
* @version V1.0.4
|
||||
* @date 09-December-2015
|
||||
* @brief HAL configuration template file.
|
||||
* This file should be copied to the application folder and renamed
|
||||
* to stm32f7xx_hal_conf.h.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
******************************************************************************
|
||||
* @file system_stm32f7xx.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-June-2015
|
||||
* @version V1.0.2
|
||||
* @date 21-September-2015
|
||||
* @brief CMSIS Cortex-M7 Device Peripheral Access Layer System Source File.
|
||||
*
|
||||
* This file provides two functions and one global variable to be called from
|
||||
|
@ -39,7 +39,7 @@
|
|||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2015 STMicroelectronics</center></h2>
|
||||
* <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
|
@ -108,6 +108,14 @@ HAL_StatusTypeDef HAL_Init(void);
|
|||
*/
|
||||
|
||||
/************************* Miscellaneous Configuration ************************/
|
||||
/*!< Uncomment the following line if you need to use external SRAM or SDRAM mounted
|
||||
on STMicroelectronics EVAL/Discovery boards as data memory */
|
||||
/*!< In case of EVAL/Discovery’s LCD use in application code, the DATA_IN_ExtSDRAM define
|
||||
need to be added in the project preprocessor to avoid SDRAM multiple configuration
|
||||
(the LCD uses SDRAM as frame buffer, and its configuration is done by the BSP_SDRAM_Init()) */
|
||||
/* #define DATA_IN_ExtSRAM */
|
||||
/* #define DATA_IN_ExtSDRAM */
|
||||
|
||||
/*!< Uncomment the following line if you need to relocate your vector Table in
|
||||
Internal SRAM. */
|
||||
/* #define VECT_TAB_SRAM */
|
||||
|
@ -153,6 +161,10 @@ const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8,
|
|||
/** @addtogroup STM32F7xx_System_Private_FunctionPrototypes
|
||||
* @{
|
||||
*/
|
||||
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
|
||||
static void SystemInit_ExtMemCtl(void);
|
||||
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
|
||||
|
||||
#if (USE_PLL_HSE_XTAL != 0) || (USE_PLL_HSE_EXTC != 0)
|
||||
uint8_t SetSysClock_PLL_HSE(uint8_t bypass);
|
||||
#endif
|
||||
|
@ -199,9 +211,13 @@ void SystemInit(void)
|
|||
/* Disable all interrupts */
|
||||
RCC->CIR = 0x00000000;
|
||||
|
||||
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
|
||||
SystemInit_ExtMemCtl();
|
||||
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
|
||||
|
||||
/* Configure the Vector Table location add offset address ------------------*/
|
||||
#ifdef VECT_TAB_SRAM
|
||||
SCB->VTOR = SRAM1_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||
SCB->VTOR = RAMDTCM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||
#else
|
||||
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
|
||||
#endif
|
||||
|
@ -307,6 +323,374 @@ void SystemCoreClockUpdate(void)
|
|||
SystemCoreClock >>= tmp;
|
||||
}
|
||||
|
||||
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
|
||||
/**
|
||||
* @brief Setup the external memory controller.
|
||||
* Called in startup_stm32f7xx.s before jump to main.
|
||||
* This function configures the external memories (SRAM/SDRAM)
|
||||
* This SRAM/SDRAM will be used as program data memory (including heap and stack).
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SystemInit_ExtMemCtl(void)
|
||||
{
|
||||
__IO uint32_t tmp = 0;
|
||||
#if defined (DATA_IN_ExtSDRAM) && defined (DATA_IN_ExtSRAM)
|
||||
register uint32_t tmpreg = 0, timeout = 0xFFFF;
|
||||
register uint32_t index;
|
||||
|
||||
/* Enable GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface
|
||||
clock */
|
||||
RCC->AHB1ENR |= 0x000001F8;
|
||||
|
||||
/* Delay after an RCC peripheral clock enabling */
|
||||
tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);
|
||||
|
||||
/* Connect PDx pins to FMC Alternate function */
|
||||
GPIOD->AFR[0] = 0x00CCC0CC;
|
||||
GPIOD->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PDx pins in Alternate function mode */
|
||||
GPIOD->MODER = 0xAAAA0A8A;
|
||||
|
||||
/* Configure PDx pins speed to 100 MHz */
|
||||
GPIOD->OSPEEDR = 0xFFFF0FCF;
|
||||
/* Configure PDx pins Output type to push-pull */
|
||||
GPIOD->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PDx pins */
|
||||
GPIOD->PUPDR = 0x55550545;
|
||||
|
||||
/* Connect PEx pins to FMC Alternate function */
|
||||
GPIOE->AFR[0] = 0xC00CC0CC;
|
||||
GPIOE->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PEx pins in Alternate function mode */
|
||||
GPIOE->MODER = 0xAAAA828A;
|
||||
/* Configure PEx pins speed to 50 MHz */
|
||||
GPIOE->OSPEEDR = 0xFFFFC3CF;
|
||||
/* Configure PEx pins Output type to push-pull */
|
||||
GPIOE->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PEx pins */
|
||||
GPIOE->PUPDR = 0x55554145;
|
||||
|
||||
/* Connect PFx pins to FMC Alternate function */
|
||||
GPIOF->AFR[0] = 0x00CCCCCC;
|
||||
GPIOF->AFR[1] = 0xCCCCC000;
|
||||
/* Configure PFx pins in Alternate function mode */
|
||||
GPIOF->MODER = 0xAA800AAA;
|
||||
/* Configure PFx pins speed to 50 MHz */
|
||||
GPIOF->OSPEEDR = 0xFF800FFF;
|
||||
/* Configure PFx pins Output type to push-pull */
|
||||
GPIOF->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PFx pins */
|
||||
GPIOF->PUPDR = 0x55400555;
|
||||
|
||||
/* Connect PGx pins to FMC Alternate function */
|
||||
GPIOG->AFR[0] = 0x00CC00CC;
|
||||
GPIOG->AFR[1] = 0xC00000CC;
|
||||
/* Configure PGx pins in Alternate function mode */
|
||||
GPIOG->MODER = 0x80220AAA;
|
||||
/* Configure PGx pins speed to 50 MHz */
|
||||
GPIOG->OSPEEDR = 0x80320FFF;
|
||||
/* Configure PGx pins Output type to push-pull */
|
||||
GPIOG->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PGx pins */
|
||||
GPIOG->PUPDR = 0x40110555;
|
||||
|
||||
/* Connect PHx pins to FMC Alternate function */
|
||||
GPIOH->AFR[0] = 0x00C0CC00;
|
||||
GPIOH->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PHx pins in Alternate function mode */
|
||||
GPIOH->MODER = 0xAAAA08A0;
|
||||
/* Configure PHx pins speed to 50 MHz */
|
||||
GPIOH->OSPEEDR = 0xAAAA08A0;
|
||||
/* Configure PHx pins Output type to push-pull */
|
||||
GPIOH->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PHx pins */
|
||||
GPIOH->PUPDR = 0x55550450;
|
||||
|
||||
/* Connect PIx pins to FMC Alternate function */
|
||||
GPIOI->AFR[0] = 0xCCCCCCCC;
|
||||
GPIOI->AFR[1] = 0x00000CC0;
|
||||
/* Configure PIx pins in Alternate function mode */
|
||||
GPIOI->MODER = 0x0028AAAA;
|
||||
/* Configure PIx pins speed to 50 MHz */
|
||||
GPIOI->OSPEEDR = 0x0028AAAA;
|
||||
/* Configure PIx pins Output type to push-pull */
|
||||
GPIOI->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PIx pins */
|
||||
GPIOI->PUPDR = 0x00145555;
|
||||
|
||||
/*-- FMC Configuration ------------------------------------------------------*/
|
||||
/* Enable the FMC interface clock */
|
||||
RCC->AHB3ENR |= 0x00000001;
|
||||
|
||||
/* Delay after an RCC peripheral clock enabling */
|
||||
tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
|
||||
/* Configure and enable Bank1_SRAM2 */
|
||||
FMC_Bank1->BTCR[4] = 0x00001091;
|
||||
FMC_Bank1->BTCR[5] = 0x00110212;
|
||||
FMC_Bank1E->BWTR[4] = 0x0FFFFFFF;
|
||||
|
||||
/* Configure and enable SDRAM bank1 */
|
||||
FMC_Bank5_6->SDCR[0] = 0x000019E5;
|
||||
FMC_Bank5_6->SDTR[0] = 0x01116361;
|
||||
|
||||
/* SDRAM initialization sequence */
|
||||
/* Clock enable command */
|
||||
FMC_Bank5_6->SDCMR = 0x00000011;
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* Delay */
|
||||
for (index = 0; index<1000; index++);
|
||||
|
||||
/* PALL command */
|
||||
FMC_Bank5_6->SDCMR = 0x00000012;
|
||||
timeout = 0xFFFF;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* Auto refresh command */
|
||||
FMC_Bank5_6->SDCMR = 0x000000F3;
|
||||
timeout = 0xFFFF;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* MRD register program */
|
||||
FMC_Bank5_6->SDCMR = 0x00046014;
|
||||
timeout = 0xFFFF;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* Set refresh count */
|
||||
tmpreg = FMC_Bank5_6->SDRTR;
|
||||
FMC_Bank5_6->SDRTR = (tmpreg | (0x00000603<<1));
|
||||
|
||||
/* Disable write protection */
|
||||
tmpreg = FMC_Bank5_6->SDCR[0];
|
||||
FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF);
|
||||
|
||||
#elif defined (DATA_IN_ExtSDRAM)
|
||||
register uint32_t tmpreg = 0, timeout = 0xFFFF;
|
||||
register uint32_t index;
|
||||
|
||||
/* Enable GPIOD, GPIOE, GPIOF, GPIOG, GPIOH and GPIOI interface
|
||||
clock */
|
||||
RCC->AHB1ENR |= 0x000001F8;
|
||||
|
||||
/* Delay after an RCC peripheral clock enabling */
|
||||
tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);
|
||||
|
||||
/* Connect PDx pins to FMC Alternate function */
|
||||
GPIOD->AFR[0] = 0x000000CC;
|
||||
GPIOD->AFR[1] = 0xCC000CCC;
|
||||
/* Configure PDx pins in Alternate function mode */
|
||||
GPIOD->MODER = 0xA02A000A;
|
||||
/* Configure PDx pins speed to 50 MHz */
|
||||
GPIOD->OSPEEDR = 0xA02A000A;
|
||||
/* Configure PDx pins Output type to push-pull */
|
||||
GPIOD->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PDx pins */
|
||||
GPIOD->PUPDR = 0x50150005;
|
||||
|
||||
/* Connect PEx pins to FMC Alternate function */
|
||||
GPIOE->AFR[0] = 0xC00000CC;
|
||||
GPIOE->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PEx pins in Alternate function mode */
|
||||
GPIOE->MODER = 0xAAAA800A;
|
||||
/* Configure PEx pins speed to 50 MHz */
|
||||
GPIOE->OSPEEDR = 0xAAAA800A;
|
||||
/* Configure PEx pins Output type to push-pull */
|
||||
GPIOE->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PEx pins */
|
||||
GPIOE->PUPDR = 0x55554005;
|
||||
|
||||
/* Connect PFx pins to FMC Alternate function */
|
||||
GPIOF->AFR[0] = 0x00CCCCCC;
|
||||
GPIOF->AFR[1] = 0xCCCCC000;
|
||||
/* Configure PFx pins in Alternate function mode */
|
||||
GPIOF->MODER = 0xAA800AAA;
|
||||
/* Configure PFx pins speed to 50 MHz */
|
||||
GPIOF->OSPEEDR = 0xAA800AAA;
|
||||
/* Configure PFx pins Output type to push-pull */
|
||||
GPIOF->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PFx pins */
|
||||
GPIOF->PUPDR = 0x55400555;
|
||||
|
||||
/* Connect PGx pins to FMC Alternate function */
|
||||
GPIOG->AFR[0] = 0x00CC00CC;
|
||||
GPIOG->AFR[1] = 0xC000000C;
|
||||
/* Configure PGx pins in Alternate function mode */
|
||||
GPIOG->MODER = 0x80020A0A;
|
||||
/* Configure PGx pins speed to 50 MHz */
|
||||
GPIOG->OSPEEDR = 0x80020A0A;
|
||||
/* Configure PGx pins Output type to push-pull */
|
||||
GPIOG->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PGx pins */
|
||||
GPIOG->PUPDR = 0x40010505;
|
||||
|
||||
/* Connect PHx pins to FMC Alternate function */
|
||||
GPIOH->AFR[0] = 0x00C0CC00;
|
||||
GPIOH->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PHx pins in Alternate function mode */
|
||||
GPIOH->MODER = 0xAAAA08A0;
|
||||
/* Configure PHx pins speed to 50 MHz */
|
||||
GPIOH->OSPEEDR = 0xAAAA08A0;
|
||||
/* Configure PHx pins Output type to push-pull */
|
||||
GPIOH->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PHx pins */
|
||||
GPIOH->PUPDR = 0x55550450;
|
||||
|
||||
/* Connect PIx pins to FMC Alternate function */
|
||||
GPIOI->AFR[0] = 0xCCCCCCCC;
|
||||
GPIOI->AFR[1] = 0x00000CC0;
|
||||
/* Configure PIx pins in Alternate function mode */
|
||||
GPIOI->MODER = 0x0028AAAA;
|
||||
/* Configure PIx pins speed to 50 MHz */
|
||||
GPIOI->OSPEEDR = 0x0028AAAA;
|
||||
/* Configure PIx pins Output type to push-pull */
|
||||
GPIOI->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PIx pins */
|
||||
GPIOI->PUPDR = 0x00145555;
|
||||
|
||||
/*-- FMC Configuration ------------------------------------------------------*/
|
||||
/* Enable the FMC interface clock */
|
||||
RCC->AHB3ENR |= 0x00000001;
|
||||
|
||||
/* Delay after an RCC peripheral clock enabling */
|
||||
tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
|
||||
/* Configure and enable SDRAM bank1 */
|
||||
FMC_Bank5_6->SDCR[0] = 0x000019E5;
|
||||
FMC_Bank5_6->SDTR[0] = 0x01116361;
|
||||
|
||||
/* SDRAM initialization sequence */
|
||||
/* Clock enable command */
|
||||
FMC_Bank5_6->SDCMR = 0x00000011;
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* Delay */
|
||||
for (index = 0; index<1000; index++);
|
||||
|
||||
/* PALL command */
|
||||
FMC_Bank5_6->SDCMR = 0x00000012;
|
||||
timeout = 0xFFFF;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* Auto refresh command */
|
||||
FMC_Bank5_6->SDCMR = 0x000000F3;
|
||||
timeout = 0xFFFF;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* MRD register program */
|
||||
FMC_Bank5_6->SDCMR = 0x00046014;
|
||||
timeout = 0xFFFF;
|
||||
while((tmpreg != 0) && (timeout-- > 0))
|
||||
{
|
||||
tmpreg = FMC_Bank5_6->SDSR & 0x00000020;
|
||||
}
|
||||
|
||||
/* Set refresh count */
|
||||
tmpreg = FMC_Bank5_6->SDRTR;
|
||||
FMC_Bank5_6->SDRTR = (tmpreg | (0x00000603<<1));
|
||||
|
||||
/* Disable write protection */
|
||||
tmpreg = FMC_Bank5_6->SDCR[0];
|
||||
FMC_Bank5_6->SDCR[0] = (tmpreg & 0xFFFFFDFF);
|
||||
|
||||
#elif defined(DATA_IN_ExtSRAM)
|
||||
/*-- GPIOs Configuration -----------------------------------------------------*/
|
||||
/* Enable GPIOD, GPIOE, GPIOF and GPIOG interface clock */
|
||||
RCC->AHB1ENR |= 0x00000078;
|
||||
|
||||
/* Delay after an RCC peripheral clock enabling */
|
||||
tmp = READ_BIT(RCC->AHB1ENR, RCC_AHB1ENR_GPIOEEN);
|
||||
|
||||
/* Connect PDx pins to FMC Alternate function */
|
||||
GPIOD->AFR[0] = 0x00CCC0CC;
|
||||
GPIOD->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PDx pins in Alternate function mode */
|
||||
GPIOD->MODER = 0xAAAA0A8A;
|
||||
/* Configure PDx pins speed to 100 MHz */
|
||||
GPIOD->OSPEEDR = 0xFFFF0FCF;
|
||||
/* Configure PDx pins Output type to push-pull */
|
||||
GPIOD->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PDx pins */
|
||||
GPIOD->PUPDR = 0x55550545;
|
||||
|
||||
/* Connect PEx pins to FMC Alternate function */
|
||||
GPIOE->AFR[0] = 0xC00CC0CC;
|
||||
GPIOE->AFR[1] = 0xCCCCCCCC;
|
||||
/* Configure PEx pins in Alternate function mode */
|
||||
GPIOE->MODER = 0xAAAA828A;
|
||||
/* Configure PEx pins speed to 100 MHz */
|
||||
GPIOE->OSPEEDR = 0xFFFFC3CF;
|
||||
/* Configure PEx pins Output type to push-pull */
|
||||
GPIOE->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PEx pins */
|
||||
GPIOE->PUPDR = 0x55554145;
|
||||
|
||||
/* Connect PFx pins to FMC Alternate function */
|
||||
GPIOF->AFR[0] = 0x00CCCCCC;
|
||||
GPIOF->AFR[1] = 0xCCCC0000;
|
||||
/* Configure PFx pins in Alternate function mode */
|
||||
GPIOF->MODER = 0xAA000AAA;
|
||||
/* Configure PFx pins speed to 100 MHz */
|
||||
GPIOF->OSPEEDR = 0xFF000FFF;
|
||||
/* Configure PFx pins Output type to push-pull */
|
||||
GPIOF->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PFx pins */
|
||||
GPIOF->PUPDR = 0x55000555;
|
||||
|
||||
/* Connect PGx pins to FMC Alternate function */
|
||||
GPIOG->AFR[0] = 0x00CCCCCC;
|
||||
GPIOG->AFR[1] = 0x000000C0;
|
||||
/* Configure PGx pins in Alternate function mode */
|
||||
GPIOG->MODER = 0x00200AAA;
|
||||
/* Configure PGx pins speed to 100 MHz */
|
||||
GPIOG->OSPEEDR = 0x00300FFF;
|
||||
/* Configure PGx pins Output type to push-pull */
|
||||
GPIOG->OTYPER = 0x00000000;
|
||||
/* No pull-up, pull-down for PGx pins */
|
||||
GPIOG->PUPDR = 0x00100555;
|
||||
|
||||
/*-- FMC/FSMC Configuration --------------------------------------------------*/
|
||||
/* Enable the FMC/FSMC interface clock */
|
||||
RCC->AHB3ENR |= 0x00000001;
|
||||
|
||||
/* Delay after an RCC peripheral clock enabling */
|
||||
tmp = READ_BIT(RCC->AHB3ENR, RCC_AHB3ENR_FMCEN);
|
||||
|
||||
/* Configure and enable Bank1_SRAM2 */
|
||||
FMC_Bank1->BTCR[4] = 0x00001091;
|
||||
FMC_Bank1->BTCR[5] = 0x00110212;
|
||||
FMC_Bank1E->BWTR[4] = 0x0FFFFFFF;
|
||||
|
||||
#endif /* DATA_IN_ExtSRAM */
|
||||
|
||||
(void)(tmp);
|
||||
}
|
||||
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
|
||||
|
||||
/**
|
||||
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
|
||||
* AHB/APBx prescalers and Flash settings
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
******************************************************************************
|
||||
* @file system_stm32f7xx.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.1
|
||||
* @date 25-June-2015
|
||||
* @version V1.0.2
|
||||
* @date 21-September-2015
|
||||
* @brief CMSIS Cortex-M7 Device System Source File for STM32F7xx devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
* <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
|
|
Loading…
Reference in New Issue