stm32F4各个库文件的作用分析

system_stm32f4xx.c:This file contains the system clock configuration for STM32F4xx devices.

  1 /**
  2   ******************************************************************************
  3   * @file    system_stm32f4xx.c
  4   * @author  MCD Application Team
  5   * @version V1.4.0
  6   * @date    04-August-2014
  7   * @brief   CMSIS Cortex-M4 Device Peripheral Access Layer System Source File.
  8   *          This file contains the system clock configuration for STM32F4xx devices.
  9   *
 10   * 1.  This file provides two functions and one global variable to be called from
 11   *     user application:
 12   *      - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
 13   *                      and Divider factors, AHB/APBx prescalers and Flash settings),
 14   *                      depending on the configuration made in the clock xls tool.
 15   *                      This function is called at startup just after reset and
 16   *                      before branch to main program. This call is made inside
 17   *                      the "startup_stm32f4xx.s" file.
 18   *
 19   *      - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
 20   *                                  by the user application to setup the SysTick
 21   *                                  timer or configure other parameters.
 22   *
 23   *      - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
 24   *                                 be called whenever the core clock is changed
 25   *                                 during program execution.
 26   *
 27   * 2. After each device reset the HSI (16 MHz) is used as system clock source.
 28   *    Then SystemInit() function is called, in "startup_stm32f4xx.s" file, to
 29   *    configure the system clock before to branch to main program.
 30   *
 31   * 3. If the system clock source selected by user fails to startup, the SystemInit()
 32   *    function will do nothing and HSI still used as system clock source. User can
 33   *    add some code to deal with this issue inside the SetSysClock() function.
 34   *
 35   * 4. The default value of HSE crystal is set to 25MHz, refer to "HSE_VALUE" define
 36   *    in "stm32f4xx.h" file. When HSE is used as system clock source, directly or
 37   *    through PLL, and you are using different crystal you have to adapt the HSE
 38   *    value to your own configuration.
 39   *
 40   * 5. This file configures the system clock as follows:
 41   *=============================================================================
 42   *=============================================================================
 43   *                    Supported STM32F40xxx/41xxx devices
 44   *-----------------------------------------------------------------------------
 45   *        System Clock source                    | PLL (HSE)
 46   *-----------------------------------------------------------------------------
 47   *        SYSCLK(Hz)                             | 168000000
 48   *-----------------------------------------------------------------------------
 49   *        HCLK(Hz)                               | 168000000
 50   *-----------------------------------------------------------------------------
 51   *        AHB Prescaler                          | 1
 52   *-----------------------------------------------------------------------------
 53   *        APB1 Prescaler                         | 4
 54   *-----------------------------------------------------------------------------
 55   *        APB2 Prescaler                         | 2
 56   *-----------------------------------------------------------------------------
 57   *        HSE Frequency(Hz)                      | 25000000
 58   *-----------------------------------------------------------------------------
 59   *        PLL_M                                  | 25
 60   *-----------------------------------------------------------------------------
 61   *        PLL_N                                  | 336
 62   *-----------------------------------------------------------------------------
 63   *        PLL_P                                  | 2
 64   *-----------------------------------------------------------------------------
 65   *        PLL_Q                                  | 7
 66   *-----------------------------------------------------------------------------
 67   *        PLLI2S_N                               | NA
 68   *-----------------------------------------------------------------------------
 69   *        PLLI2S_R                               | NA
 70   *-----------------------------------------------------------------------------
 71   *        I2S input clock                        | NA
 72   *-----------------------------------------------------------------------------
 73   *        VDD(V)                                 | 3.3
 74   *-----------------------------------------------------------------------------
 75   *        Main regulator output voltage          | Scale1 mode
 76   *-----------------------------------------------------------------------------
 77   *        Flash Latency(WS)                      | 5
 78   *-----------------------------------------------------------------------------
 79   *        Prefetch Buffer                        | ON
 80   *-----------------------------------------------------------------------------
 81   *        Instruction cache                      | ON
 82   *-----------------------------------------------------------------------------
 83   *        Data cache                             | ON
 84   *-----------------------------------------------------------------------------
 85   *        Require 48MHz for USB OTG FS,          | Disabled
 86   *        SDIO and RNG clock                     |
 87   *-----------------------------------------------------------------------------
 88   *=============================================================================
 89   *=============================================================================
 90   *                    Supported STM32F42xxx/43xxx devices
 91   *-----------------------------------------------------------------------------
 92   *        System Clock source                    | PLL (HSE)
 93   *-----------------------------------------------------------------------------
 94   *        SYSCLK(Hz)                             | 180000000
 95   *-----------------------------------------------------------------------------
 96   *        HCLK(Hz)                               | 180000000
 97   *-----------------------------------------------------------------------------
 98   *        AHB Prescaler                          | 1
 99   *-----------------------------------------------------------------------------
100   *        APB1 Prescaler                         | 4
101   *-----------------------------------------------------------------------------
102   *        APB2 Prescaler                         | 2
103   *-----------------------------------------------------------------------------
104   *        HSE Frequency(Hz)                      | 25000000
105   *-----------------------------------------------------------------------------
106   *        PLL_M                                  | 25
107   *-----------------------------------------------------------------------------
108   *        PLL_N                                  | 360
109   *-----------------------------------------------------------------------------
110   *        PLL_P                                  | 2
111   *-----------------------------------------------------------------------------
112   *        PLL_Q                                  | 7
113   *-----------------------------------------------------------------------------
114   *        PLLI2S_N                               | NA
115   *-----------------------------------------------------------------------------
116   *        PLLI2S_R                               | NA
117   *-----------------------------------------------------------------------------
118   *        I2S input clock                        | NA
119   *-----------------------------------------------------------------------------
120   *        VDD(V)                                 | 3.3
121   *-----------------------------------------------------------------------------
122   *        Main regulator output voltage          | Scale1 mode
123   *-----------------------------------------------------------------------------
124   *        Flash Latency(WS)                      | 5
125   *-----------------------------------------------------------------------------
126   *        Prefetch Buffer                        | ON
127   *-----------------------------------------------------------------------------
128   *        Instruction cache                      | ON
129   *-----------------------------------------------------------------------------
130   *        Data cache                             | ON
131   *-----------------------------------------------------------------------------
132   *        Require 48MHz for USB OTG FS,          | Disabled
133   *        SDIO and RNG clock                     |
134   *-----------------------------------------------------------------------------
135   *=============================================================================
136   *=============================================================================
137   *                         Supported STM32F401xx devices
138   *-----------------------------------------------------------------------------
139   *        System Clock source                    | PLL (HSE)
140   *-----------------------------------------------------------------------------
141   *        SYSCLK(Hz)                             | 84000000
142   *-----------------------------------------------------------------------------
143   *        HCLK(Hz)                               | 84000000
144   *-----------------------------------------------------------------------------
145   *        AHB Prescaler                          | 1
146   *-----------------------------------------------------------------------------
147   *        APB1 Prescaler                         | 2
148   *-----------------------------------------------------------------------------
149   *        APB2 Prescaler                         | 1
150   *-----------------------------------------------------------------------------
151   *        HSE Frequency(Hz)                      | 25000000
152   *-----------------------------------------------------------------------------
153   *        PLL_M                                  | 25
154   *-----------------------------------------------------------------------------
155   *        PLL_N                                  | 336
156   *-----------------------------------------------------------------------------
157   *        PLL_P                                  | 4
158   *-----------------------------------------------------------------------------
159   *        PLL_Q                                  | 7
160   *-----------------------------------------------------------------------------
161   *        PLLI2S_N                               | NA
162   *-----------------------------------------------------------------------------
163   *        PLLI2S_R                               | NA
164   *-----------------------------------------------------------------------------
165   *        I2S input clock                        | NA
166   *-----------------------------------------------------------------------------
167   *        VDD(V)                                 | 3.3
168   *-----------------------------------------------------------------------------
169   *        Main regulator output voltage          | Scale1 mode
170   *-----------------------------------------------------------------------------
171   *        Flash Latency(WS)                      | 2
172   *-----------------------------------------------------------------------------
173   *        Prefetch Buffer                        | ON
174   *-----------------------------------------------------------------------------
175   *        Instruction cache                      | ON
176   *-----------------------------------------------------------------------------
177   *        Data cache                             | ON
178   *-----------------------------------------------------------------------------
179   *        Require 48MHz for USB OTG FS,          | Disabled
180   *        SDIO and RNG clock                     |
181   *-----------------------------------------------------------------------------
182   *=============================================================================
183   *=============================================================================
184   *                         Supported STM32F411xx devices
185   *-----------------------------------------------------------------------------
186   *        System Clock source                    | PLL (HSI)
187   *-----------------------------------------------------------------------------
188   *        SYSCLK(Hz)                             | 100000000
189   *-----------------------------------------------------------------------------
190   *        HCLK(Hz)                               | 100000000
191   *-----------------------------------------------------------------------------
192   *        AHB Prescaler                          | 1
193   *-----------------------------------------------------------------------------
194   *        APB1 Prescaler                         | 2
195   *-----------------------------------------------------------------------------
196   *        APB2 Prescaler                         | 1
197   *-----------------------------------------------------------------------------
198   *        HSI Frequency(Hz)                      | 16000000
199   *-----------------------------------------------------------------------------
200   *        PLL_M                                  | 16
201   *-----------------------------------------------------------------------------
202   *        PLL_N                                  | 400
203   *-----------------------------------------------------------------------------
204   *        PLL_P                                  | 4
205   *-----------------------------------------------------------------------------
206   *        PLL_Q                                  | 7
207   *-----------------------------------------------------------------------------
208   *        PLLI2S_N                               | NA
209   *-----------------------------------------------------------------------------
210   *        PLLI2S_R                               | NA
211   *-----------------------------------------------------------------------------
212   *        I2S input clock                        | NA
213   *-----------------------------------------------------------------------------
214   *        VDD(V)                                 | 3.3
215   *-----------------------------------------------------------------------------
216   *        Main regulator output voltage          | Scale1 mode
217   *-----------------------------------------------------------------------------
218   *        Flash Latency(WS)                      | 3
219   *-----------------------------------------------------------------------------
220   *        Prefetch Buffer                        | ON
221   *-----------------------------------------------------------------------------
222   *        Instruction cache                      | ON
223   *-----------------------------------------------------------------------------
224   *        Data cache                             | ON
225   *-----------------------------------------------------------------------------
226   *        Require 48MHz for USB OTG FS,          | Disabled
227   *        SDIO and RNG clock                     |
228   *-----------------------------------------------------------------------------
229   *=============================================================================
230   ******************************************************************************
231   * @attention
232   *
233   * <h2><center>&copy; COPYRIGHT 2014 STMicroelectronics</center></h2>
234   *
235   * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
236   * You may not use this file except in compliance with the License.
237   * You may obtain a copy of the License at:
238   *
239   *        http://www.st.com/software_license_agreement_liberty_v2
240   *
241   * Unless required by applicable law or agreed to in writing, software
242   * distributed under the License is distributed on an "AS IS" BASIS,
243   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
244   * See the License for the specific language governing permissions and
245   * limitations under the License.
246   *
时间: 2024-10-10 13:54:37

stm32F4各个库文件的作用分析的相关文章

usb库文件usb_desc.c分析

参考<圈圈教你玩USB> usb协议中使用的是小端结构,所以实际数据在传输时是低字节在先的. 设备描述符的实现: 已知每个设备都必须有且仅有一个设备描述符,它的结构在USB协议中有详细的定义.               偏移量                             域                  大小/字节                          说 明                        0 bLength 1 该描述符的长度(18字节) 1 b

.h头文件、 .lib库文件、 .dll动态链接库文件之间的关系(转)

h头文件作用:声明函数接口 dll动态链接库作用:含有函数的可执行代码 lib库有两种: (1)静态链接库(Static Libary,以下简称“静态库”) (2)动态连接库(DLL,以下简称“动态库”)的导入库(Import Libary,以下简称“导入库”) 两者的区别: 实质是不一样的东西. 静态库本身就包含了实际执行代码.符号表等等,而对于导入库而言,其实际的执行代码位于动态库中,导入库只包含了地址符号表等,确保程序找到对应函数的一些基本地址信息. 如:当我们在自己的程序中引用了一个h头

怎么将第三方的库文件只复制而不编译呢

我遇到这个问题是我cocos2d-x2.2.2版本游戏在更新移动mm3.1.7版本的sdk遇到的,下面我会具体说明问题和解决方案. 一..相信cocos2dx的程序在接入安卓方面的支付功能常常会接触到第三方sdk的.so库文件,这些库文件的作用是对支付信息做出了封装,但是有的sdk你会发现把第三方的.so文件复制到libs文件夹下,再编译完成项目后会出现原本复制到libs文件夹下的.so文件消失的情况,针对这种情况我原来的解决方案是在代码文件夹下创建一个文件夹prebuilt,将第三方的.so文

分析MAC*.a库文件信息

一.起因 在前面的文章中,我尝试在MAC终端上编译构建了可直接用于COCOS2D-X C++开发的Lean Cloud库.于是,接下来制作一个基本的例子去使用这个库中功能.出于类似于windows vc开发时候的好奇吧,我想先瞅瞅(使用mac下的工具)这个.a文件中包含/输出哪些内容.于是,在网络上搜索找到几个基本工具. 二.分析工具 目前我使用的工具有MAC终端命令行工具(系统本身提供,但是需要安装xcode,我的是version 7.2): ar nm otool file lipo 还有专

C&amp;C++——库头文件及其作用

1. 一些头文件的作用::ANSI C.提供断言,assert(表达式):GCC.GTK,GNOME的基础库,提供很多有用的函数,如有数据结构操作函数.使用glib只需要包含:GCC.文件夹操作函数.struct dirent,struct DIR,opendir(),closedir(),readdir(),readdir64()等:ANSI C.字符测试函数.isdigit(),islower()等:ANSI C.查看错误代码errno是调试程序的一个重要方法.当linuc C api函数发

【discuzX2】/source/function/function_core.php通用核心函数库文件分析

[php] view plain copy print? <?php /** *      [Discuz!] (C)2001-2099 Comsenz Inc. *      This is NOT a freeware, use is subject to license terms * *      $Id: function_core.php 28890 2012-03-19 02:05:42Z liudongdong $ */ if(!defined('IN_DISCUZ')) { e

很详细、很移动的Linux makefile教程:介绍,总述,书写规则,书写命令,使用变量,使用条件推断,使用函数,Make 的运行,隐含规则 使用make更新函数库文件 后序

很详细.很移动的Linux makefile 教程 内容如下: Makefile 介绍 Makefile 总述 书写规则 书写命令 使用变量 使用条件推断 使用函数 make 的运行 隐含规则 使用make更新函数库文件 后序 近期在学习Linux下的C编程,买了一本叫<Linux环境下的C编程指南>读到makefile就越看越迷糊,可能是我的理解能不行. 于是google到了以下这篇文章.通俗易懂.然后把它贴出来,方便学习. 后记,看完发现这篇文章和<Linux环境下的C编程指南>

小黑的日常折腾-复制外部命令的可执行文件和依赖库文件到指定目录下的对应目录

清明三天假期基本都是在写脚本中度过了,今天又折腾了一个新的脚本,该脚本的作用是快速复制一个或多个命令的可执行文件和依赖库文件到一个模拟的根文件系统下的相应目录下,这个脚本平时运维估计用不到,只有自己制作一个小的Linux发行版时才有可能使用该脚本. 脚本具体的功能如下: 1)提示用户选择要从文本中读取要复制的命令名还是从当前终端中交互式输入命令名. 2)用户选择前者,会自动使用vim打开一个文件,用户根据格式说明填入要复制的命令的名称,可以是多个命令,保存退出后自动执行复制操作. 3)用户选择后

库文件的使用

背景: 初学者经常搞不清楚,一个main.cpp文件,调用了某库(可能静态也可动态)中的函数,如何将它跑起来. 编译: g++ -c main.cpp main.cpp:3:26: fatal error: leveldb/db.h: No such file or directory #include "leveldb/db.h" ^ compilation terminated. 缺少头文件,加上再编译(编译只与头文件有关,不需要关注库): g++ -c main.cpp -I/h