Демонстрационная прошивка отладочного комплекта МТС NB-IoT
Макросы | Функции | Переменные
Файл system_stm32l1xx.c

CMSIS Cortex-M3 Device Peripheral Access Layer System Source File. This file contains the system clock configuration for STM32L1xx Ultra Low power devices, and is generated by the clock configuration tool STM32L1xx_Clock_Configuration_V1.1.0.xls. Подробнее...

#include "stm32l1xx.h"

См. исходные тексты.

Макросы

#define VECT_TAB_OFFSET   0x0
 

Функции

void SystemInit (void)
 Setup the microcontroller system. Initialize the Embedded Flash Interface, the PLL and update the SystemCoreClock variable. Подробнее...
 
void SystemCoreClockUpdate (void)
 Update SystemCoreClock according to Clock Register Values The SystemCoreClock variable contains the core clock (HCLK), it can be used by the user application to setup the SysTick timer or configure other parameters. Подробнее...
 

Переменные

uint32_t SystemCoreClock = 32000000
 
__I uint8_t PLLMulTable [9] = {3, 4, 6, 8, 12, 16, 24, 32, 48}
 
__I uint8_t AHBPrescTable [16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}
 

Подробное описание

CMSIS Cortex-M3 Device Peripheral Access Layer System Source File. This file contains the system clock configuration for STM32L1xx Ultra Low power devices, and is generated by the clock configuration tool STM32L1xx_Clock_Configuration_V1.1.0.xls.

Автор
MCD Application Team
Версия
V1.1.0
Дата
12-June-2013
  1. This file provides two functions and one global variable to be called from user application:
    • SystemInit(): Setups the system clock (System clock source, PLL Multiplier and Divider factors, AHB/APBx prescalers and Flash settings), depending on the configuration made in the clock xls tool. This function is called at startup just after reset and before branch to main program. This call is made inside the "startup_stm32l1xx_xx.s" file.
    • SystemCoreClock variable: Contains the core clock (HCLK), it can be used by the user application to setup the SysTick timer or configure other parameters.
    • SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must be called whenever the core clock is changed during program execution.
  2. After each device reset the MSI (2.1 MHz Range) is used as system clock source. Then SystemInit() function is called, in "startup_stm32l1xx_xx.s" file, to configure the system clock before to branch to main program.
  3. If the system clock source selected by user fails to startup, the SystemInit() function will do nothing and MSI still used as system clock source. User can add some code to deal with this issue inside the SetSysClock() function.
  4. The default value of HSE crystal is set to 8MHz, refer to "HSE_VALUE" define in "stm32l1xx.h" file. When HSE is used as system clock source, directly or through PLL, and you are using different crystal you have to adapt the HSE value to your own configuration.

5. This file configures the system clock as follows:

System Clock Configuration

System Clock source | PLL(HSI)

SYSCLK | 32000000 Hz

HCLK | 32000000 Hz

AHB Prescaler | 1

APB1 Prescaler | 1

APB2 Prescaler | 1

HSE Frequency | 8000000 Hz

PLL DIV | 3

PLL MUL | 6

VDD | 3 V

Vcore | 1.8 V (Range 1)

Flash Latency | 1 WS

Require 48MHz for USB clock | Disabled

=============================================================================

Внимание

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

FOR MORE INFORMATION PLEASE READ CAREFULLY THE LICENSE AGREEMENT FILE LOCATED IN THE ROOT DIRECTORY OF THIS FIRMWARE PACKAGE.

© COPYRIGHT 2012 STMicroelectronics

См. определение в файле system_stm32l1xx.c