stm32内 misc stm32f10x_hd stm32f10x_it stm32f10x_conf关系

STM32启动流程

总结在最后

初始位置 

startup_stm32f10x_hd.s

查看源码

;******************** (C) COPYRIGHT 2010 STMicroelectronics ********************

;* File Name          : startup_stm32f10x_hd.s

;* Author             : MCD Application Team

;* Version            : V3.4.0

;* Date               : 10/15/2010

;* Description        : STM32F10x High Density Devices vector table for MDK-ARM

;*                      toolchain.

;*                      This module performs:

;*                      - Set the initial SP

;*                      - Set the initial PC == Reset_Handler

;*                      - Set the vector table entries with the exceptions ISR address

;*                      - Configure the clock system and also configure the external

;*                        SRAM mounted on STM3210E-EVAL board to be used as data

;*                        memory (optional, to be enabled by user)

;*                      - Branches to __main in the C library (which eventually

;*                        calls main()).

;*                      After Reset the CortexM3 processor is in Thread mode,

;*                      priority is Privileged, and the Stack is set to Main.

;* <<< Use Configuration Wizard in Context Menu >>>  

描述:STM 32 f 10 x MDK ARM高密度器件向量表;*工具链。;*此模块执行:* -设置初始SP* -设置初始PC = = Reset _ Handler* -用异常ISR地址设置向量表项;* -配置时钟系统并配置外部;*安装在STM3210E-EVAL板上的SRAM用作数据;*内存(可选,由用户启用)* -分支到C库中的__main(最终;*调用main())。;*复位后CortexM3处理器处于线程模式;*优先级是有特权的,堆栈设置为Main。;* < < <在上下文菜单中使用配置向导>>>

; Reset handler

Reset_Handler   PROC

                EXPORT  Reset_Handler             [WEAK]

                IMPORT  __main

                IMPORT  SystemInit

                LDR     R0, =SystemInit

                BLX     R0              

                LDR     R0, =__main  //跳转入main

                BX      R0

                ENDP

main()

文件关系

core_cm3.c

/**************************************************************************//**

 * @file     core_cm3.c

 * @brief    CMSIS Cortex-M3 Core Peripheral Access Layer Source File

 * @version  V1.30

 * @date     30. October 2009

 *

 * @note

 * Copyright (C) 2009 ARM Limited. All rights reserved.

 *

 * @par

 * ARM Limited (ARM) is supplying this software for use with Cortex-M

 * processor based microcontrollers.  This file can be freely distributed

 * within development tools that are supporting such ARM based processors.

/*------------------ ICC Compiler -------------------*/

/* define compiler specific symbols */

stm32f10x.h

#include "core_cm3.h"

编译相关的命令与字节翻转命令,编译时包含头文件

system_stm32f10x.c

/**

  ******************************************************************************

  * @file    system_stm32f10x.c

  * @author  MCD Application Team

  * @version V3.4.0

  * @date    10/15/2010

  * @brief   CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.

  ****************************************************************************** 

系统时钟等设置

startup_stm32f10x_hd.s将调用相应的函数

misc.c

/**

  ******************************************************************************

  * @file    misc.c

  * @author  MCD Application Team

  * @version V3.4.0

  * @date    10/15/2010

  * @brief   This file provides all the miscellaneous firmware functions (add-on

  *          to CMSIS functions).

/**

  * @brief  Configures the priority grouping: pre-emption priority and subpriority.

  * @param  NVIC_PriorityGroup: specifies the priority grouping bits length.

  *   This parameter can be one of the following values:

  *     @arg NVIC_PriorityGroup_0: 0 bits for pre-emption priority

  *                                4 bits for subpriority

  *     @arg NVIC_PriorityGroup_1: 1 bits for pre-emption priority

  *                                3 bits for subpriority

  *     @arg NVIC_PriorityGroup_2: 2 bits for pre-emption priority

  *                                2 bits for subpriority

  *     @arg NVIC_PriorityGroup_3: 3 bits for pre-emption priority

  *                                1 bits for subpriority

  *     @arg NVIC_PriorityGroup_4: 4 bits for pre-emption priority

  *                                0 bits for subpriority

  * @retval None

  */

中断优先级等相关设置

stm32f10x_it.c

  ******************************************************************************

  * @file    Project/STM32F10x_StdPeriph_Template/stm32f10x_it.c

  * @author  MCD Application Team

  * @version V3.4.0

  * @date    10/15/2010

  * @brief   Main Interrupt Service Routines.

  *          This file provides template for all exceptions handler and

  *          peripherals interrupt service routine.

关系:

startup_stm32f10x_hd.s 中将此文件中相应的中断命令

stm32f10x_conf.h

  * @file    Project/STM32F10x_StdPeriph_Template/stm32f10x_conf.h

  * @author  MCD Application Team

  * @version V3.4.0

  * @date    10/15/2010

  * @brief   Library configuration file.

外设:头文件包含,要不要包含头文件设置

外设SPI ADC UART GPIO

总结:如果使用hal库的话,需要添加这些依赖文件 ,如果使用汇编的话则不需要;(其产生的更可能的是因为多款芯片的统一标准化来管理,而不是为每个芯片重写代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值