Merge pull request #4133 from u-blox/c030-debug-8mhz-xtal

U-BLOX_C030: Default XTAL is now 12MHz onboard. Option to use Debug 8MHz
pull/2203/merge
Sam Grove 2017-04-19 02:14:51 -05:00 committed by GitHub
commit 7bd8c32f2d
2 changed files with 28 additions and 20 deletions

View File

@ -21,20 +21,20 @@
* during program execution. * during program execution.
* *
* This file configures the system clock as follows: * This file configures the system clock as follows:
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
* System clock source | PLL_HSE_XTAL | PLL_HSE_XTAL * System clock source | PLL_HSE_XTAL | PLL_HSE_XTAL | PLL_HSE_XTAL | PLL_HSE_XTAL
* | (external 8 MHz clock) | (external 8 MHz clock) * | (external 8 MHz clock) | (external 8 MHz clock) | (external 12 MHz clock)| (external 12 MHz clock)
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
* SYSCLK(MHz) | 168 | 84 * SYSCLK(MHz) | 168 | 84 | 168 | 84
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
* AHBCLK (MHz) | 168 | 84 * AHBCLK (MHz) | 168 | 84 | 168 | 84
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
* APB1CLK (MHz) | 42 | 42 * APB1CLK (MHz) | 42 | 42 | 42 | 42
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
* APB2CLK (MHz) | 84 | 84 * APB2CLK (MHz) | 84 | 84 | 84 | 84
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
* USB capable (48 MHz precise clock) | YES | YES * USB capable (48 MHz precise clock) | YES | YES | YES | YES
*-------------------------------------------------------------------------------------- *----------------------------------------------------------------------------------------------------------------------------------------
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
@ -136,8 +136,8 @@
*/ */
/* Select the SYSCLOCK to start with (0=OFF, 1=ON) */ /* Select the SYSCLOCK to start with (0=OFF, 1=ON) */
#define USE_SYSCLOCK_168 (1) /* Use external 8MHz xtal and sets SYSCLK to 168MHz */ #define USE_SYSCLOCK_168 (1) /* Use external 8MHz or 12 MHz xtal and sets SYSCLK to 168MHz */
#define USE_SYSCLOCK_84 (0) /* Use external 8MHz xtal and sets SYSCLK to 84MHz */ #define USE_SYSCLOCK_84 (0) /* Use external 8MHz or 12 MHz xtal and sets SYSCLK to 84MHz */
/** /**
* @} * @}
@ -801,7 +801,11 @@ void SetSysClock(void)
RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
#ifdef USE_DEBUG_8MHz_XTAL
RCC_OscInitStruct.PLL.PLLM = 8; RCC_OscInitStruct.PLL.PLLM = 8;
#else
RCC_OscInitStruct.PLL.PLLM = 12;
#endif
RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7; RCC_OscInitStruct.PLL.PLLQ = 7;
@ -838,7 +842,11 @@ void SetSysClock(void)
RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
#ifdef USE_DEBUG_8MHz_XTAL
RCC_OscInitStruct.PLL.PLLM = 8; RCC_OscInitStruct.PLL.PLLM = 8;
#else
RCC_OscInitStruct.PLL.PLLM = 12;
#endif
RCC_OscInitStruct.PLL.PLLN = 336; RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
RCC_OscInitStruct.PLL.PLLQ = 7; RCC_OscInitStruct.PLL.PLLQ = 7;

View File

@ -1340,9 +1340,9 @@
"default_toolchain": "ARM", "default_toolchain": "ARM",
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"], "supported_toolchains": ["GCC_ARM", "ARM", "IAR"],
"extra_labels": ["STM", "STM32F4", "STM32F437", "STM32F437VG", "STM32F437xx", "STM32F437xG"], "extra_labels": ["STM", "STM32F4", "STM32F437", "STM32F437VG", "STM32F437xx", "STM32F437xG"],
"macros": ["TRANSACTION_QUEUE_SIZE_SPI=2", "RTC_LSI=1"], "macros": ["TRANSACTION_QUEUE_SIZE_SPI=2", "RTC_LSI=1", "HSE_VALUE=12000000"],
"inherits": ["Target"], "inherits": ["Target"],
"device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "RTC", "SPI", "SPISLAVE", "STDIO_MESSAGES", "TRNG"], "device_has": ["ANALOGIN", "ANALOGOUT", "I2C", "I2CSLAVE", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "RTC", "SPI", "SPISLAVE","STDIO_MESSAGES", "TRNG"],
"features": ["LWIP"], "features": ["LWIP"],
"release_versions": ["5"], "release_versions": ["5"],
"device_name": "STM32F437VG" "device_name": "STM32F437VG"