Modified mbed library sources only for STM32F030K6, LQFP32 (0.8mm pitch) package, 32K Flash, 4K SRAM. Compiler target: Nucleo 32F030R8
Fork of mbed-src by
Revision 520:7182721120da, committed 2015-04-23
- Comitter:
- mbed_official
- Date:
- Thu Apr 23 08:00:08 2015 +0100
- Parent:
- 519:ec58d8604398
- Child:
- 521:149b1eddda04
- Commit message:
- Synchronized with git revision b73059c798bfc528a56a32338beda95fafea4cdf
Full URL: https://github.com/mbedmicro/mbed/commit/b73059c798bfc528a56a32338beda95fafea4cdf/
STM32 - Fix HSE/HSI clk source detection
Changed in this revision
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/system_stm32f0xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/system_stm32f0xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -209,6 +209,7 @@ RCC->CIR = 0x00000000; /* Configure the Cube driver */ + SystemCoreClock = 8000000; // At this stage the HSI is used as system clock HAL_Init(); /* Configure the System clock source, PLL Multiplier and Divider factors,
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/system_stm32f0xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/system_stm32f0xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -226,6 +226,7 @@ RCC->CIR = 0x00000000; /* Configure the Cube driver */ + SystemCoreClock = 8000000; // At this stage the HSI is used as system clock HAL_Init(); /* Configure the System clock source, PLL Multiplier and Divider factors,
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/system_stm32f1xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/system_stm32f1xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -159,7 +159,7 @@ uint32_t SystemCoreClock = 72000000; /*!< System Clock Frequency (Core Clock) */ #endif -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @} */
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/system_stm32f1xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/system_stm32f1xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -161,7 +161,7 @@ uint32_t SystemCoreClock = 72000000; /*!< System Clock Frequency (Core Clock) */ #endif -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @} */
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_rcc.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/stm32f30x_rcc.c Thu Apr 23 08:00:08 2015 +0100 @@ -141,8 +141,8 @@ /* Private macro -------------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/ -static __I uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; -static __I uint16_t ADCPrescTable[16] = {1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256, 0, 0, 0, 0 }; +const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint16_t ADCPrescTable[16] = {1, 2, 4, 6, 8, 10, 12, 16, 32, 64, 128, 256, 0, 0, 0, 0 }; /* Private function prototypes -----------------------------------------------*/ /* Private functions ---------------------------------------------------------*/
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/system_stm32f30x.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F3XX/system_stm32f30x.c Thu Apr 23 08:00:08 2015 +0100 @@ -143,7 +143,7 @@ uint32_t SystemCoreClock = 64000000; /* Default with HSI. Will be updated if HSE is used */ -__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/system_stm32f4xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -155,7 +155,7 @@ variable is updated automatically. */ uint32_t SystemCoreClock = 168000000; - __IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/system_stm32f4xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -158,7 +158,7 @@ variable is updated automatically. */ uint32_t SystemCoreClock = 16000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/system_stm32f4xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -163,7 +163,7 @@ variable is updated automatically. */ uint32_t SystemCoreClock = 16000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/system_stm32f4xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/system_stm32f4xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -157,7 +157,7 @@ variable is updated automatically. */ uint32_t SystemCoreClock = 16000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/system_stm32f4xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_C029/system_stm32f4xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -157,7 +157,7 @@ variable is updated automatically. */ uint32_t SystemCoreClock = 16000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.h Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4/stm32f4xx_hal_rcc.h Thu Apr 23 08:00:08 2015 +0100 @@ -190,7 +190,7 @@ #define DBP_TIMEOUT_VALUE ((uint32_t)100) -#define LSE_TIMEOUT_VALUE ((uint32_t)600) +#define LSE_TIMEOUT_VALUE ((uint32_t)5000) /** * @} */
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F4XX/system_stm32f4xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F4XX/system_stm32f4xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -184,7 +184,7 @@ uint32_t SystemCoreClock = 168000000; - __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/system_stm32l0xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -145,9 +145,9 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ - uint32_t SystemCoreClock = 32000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -__IO const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +uint32_t SystemCoreClock = 32000000; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/system_stm32l0xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/system_stm32l0xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -145,9 +145,9 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ - uint32_t SystemCoreClock = 32000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -__IO const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +uint32_t SystemCoreClock = 32000000; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/system_stm32l0xx.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/system_stm32l0xx.c Thu Apr 23 08:00:08 2015 +0100 @@ -145,9 +145,9 @@ is no need to call the 2 first functions listed above, since SystemCoreClock variable is updated automatically. */ - uint32_t SystemCoreClock = 32000000; -__IO const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; -__IO const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +uint32_t SystemCoreClock = 32000000; +const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_conf.h Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_conf.h Thu Apr 23 08:00:08 2015 +0100 @@ -123,7 +123,7 @@ #if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)500) /*!< Time out for LSE start up, in ms */ + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_rcc.c Thu Apr 23 08:00:08 2015 +0100 @@ -118,8 +118,8 @@ /** @defgroup RCC_Private_Vatiables RCC Private Data * @{ */ -static __IO const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; -static __IO const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; +const uint8_t PLLMulTable[9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}; +const uint8_t APBAHBPrescTable[16] = {0, 0, 0, 0, 1, 2, 3, 4, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @}
--- a/targets/cmsis/TARGET_STM/TARGET_STM32L1/stm32l1xx_hal_conf.h Tue Apr 21 11:45:19 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32L1/stm32l1xx_hal_conf.h Thu Apr 23 08:00:08 2015 +0100 @@ -122,7 +122,7 @@ #if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)500) /*!< Time out for LSE start up, in ms */ + #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ #endif /* HSE_STARTUP_TIMEOUT */