cstartup.s

来自「STM3240G-Eval_uCOS-III」· S 代码 · 共 399 行 · 第 1/2 页

S
399
字号
@/*
@*********************************************************************************************************
@*                                              EXAMPLE CODE
@*
@*                             (c) Copyright 2013; Micrium, Inc.; Weston, FL
@*
@*                   All rights reserved.  Protected by international copyright laws.
@*                   Knowledge of the source code may not be used to write a similar
@*                   product.  This file may only be used in accordance with a license
@*                   and should not be redistributed in any way.
@*********************************************************************************************************
@*/


@/*
@*********************************************************************************************************
@*
@*                                            STARTUP FILE
@*
@*                                     ST Microelectronics STM32
@*                                              on the
@*
@*                                           STM3240G-EVAL
@*                                         Evaluation Board
@*
@* Filename      : cstartup.c
@* Version       : V1.00
@* Programmer(s) : DC
@*********************************************************************************************************
@*/
    



@/*
@********************************************************************************************************
@*                                              STACK DEFINITIONS
@*
@* Configuration Wizard Menu:
@* // <h> Stack Configuration
@* //   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
@* // </h>;
@*********************************************************************************************************
@*/

  .syntax unified
  .cpu cortex-m3
  .fpu softvfp
  .thumb

.global  g_pfnVectors


@/*
@********************************************************************************************************
@*                                      LINKER SCRIPT DEFINITIONS
@*********************************************************************************************************
@*/

@ Start address for the initialization values of the .data section.
.word  _sidata

@ Start address for the .data section.
.word  _sdata

@ End address for the .data section.
.word  _edata

@ Start address for the .bss section.
.word  _sbss

@ End address for the .bss section.
.word  _ebss


@/*
@**********************************************************************************************************
@ Description:      This is the code that gets called when the processor first
@                   starts execution following a reset event. Only the absolutely
@                   necessary set is performed, after which the application
@                   supplied main() routine is called.
@ Parameters:  None
@
@ Return Value: None
@**********************************************************************************************************
@*/

@ Reset Handler
   .section  .text.Reset_Handler
  .weak  Reset_Handler
  .type  Reset_Handler, %function
Reset_Handler:  

@ Copy the data segment initializers from flash to SRAM.
  movs  r1, #0
  b  LoopCopyDataInit

CopyDataInit:
  ldr  r3, =_sidata
  ldr  r3, [r3, r1]
  str  r3, [r0, r1]
  adds  r1, r1, #4
    
LoopCopyDataInit:
  ldr  r0, =_sdata
  ldr  r3, =_edata
  adds  r2, r0, r1
  cmp  r2, r3
  bcc  CopyDataInit
  ldr  r2, =_sbss
  b  LoopFillZerobss

FillZerobss:                                            @ Zero fill the bss segment.
  movs  r3, #0
  str  r3, [r2], #4
    
LoopFillZerobss:
  ldr  r3, = _ebss
  cmp  r2, r3
  bcc  FillZerobss

@ Call the clock system intitialization function.
  @bl  SystemInit

  bl __libc_init_array                                @ Call static constructors

@ Call the application's entry point.
  bl  main
  bx  lr    
.size  Reset_Handler, .-Reset_Handler


@/*
@*********************************************************************************************************
@*                                  EXCEPTION / INTERRUPT VECTOR TABLE
@*
@* Note(s) : (1) The Cortex-M3 may have up to 256 external interrupts, which are the final entries in the
@*               vector table.  The STM32Fxxx has 81 external interrupt vectors.
@*
@*           (2) Interrupts vector 2-13 are implemented in this file as infinite loop for debuging
@*               purposes only. The application might implement a recover procedure if it is needed.
@*
@*           (3) OS_CPU_PendSVHandler() and OS_CPU_SysTickHandler() are implemented in the generic OS
@*               port.
@*********************************************************************************************************
@*/

   .section  .isr_vector,"a",%progbits
  .type  g_pfnVectors, %object
  .size  g_pfnVectors, .-g_pfnVectors
    
                                                                @ Vector Table Mapped to Address 0 at Reset
                    .extern  BSP_IntHandlerWWDG
                    .extern  BSP_IntHandlerWWDG
				    .extern  BSP_IntHandlerPVD
				    .extern  BSP_IntHandlerTAMP_STAMP
				    .extern  BSP_IntHandlerRTC_WKUP
				    .extern  BSP_IntHandlerFLASH
				    .extern  BSP_IntHandlerRCC
				    .extern  BSP_IntHandlerEXTI0
				    .extern  BSP_IntHandlerEXTI1
				    .extern  BSP_IntHandlerEXTI2
				    .extern  BSP_IntHandlerEXTI3
				    .extern  BSP_IntHandlerEXTI4
				    .extern  BSP_IntHandlerDMA1_CH0
				    .extern  BSP_IntHandlerDMA1_CH1
				    .extern  BSP_IntHandlerDMA1_CH2
				    .extern  BSP_IntHandlerDMA1_CH3
				    .extern  BSP_IntHandlerDMA1_CH4
				    .extern  BSP_IntHandlerDMA1_CH5
				    .extern  BSP_IntHandlerDMA1_CH6
				    .extern  BSP_IntHandlerADC
				    .extern  BSP_IntHandlerCAN1_TX
				    .extern  BSP_IntHandlerCAN1_RX0
				    .extern  BSP_IntHandlerCAN1_RX1
				    .extern  BSP_IntHandlerCAN1_SCE
				    .extern  BSP_IntHandlerEXTI9_5
				    .extern  BSP_IntHandlerTIM1_BRK_TIM9
				    .extern  BSP_IntHandlerTIM1_UP_TIM10
				    .extern  BSP_IntHandlerTIM1_TRG_COM_TIM11
				    .extern  BSP_IntHandlerTIM1_CC
				    .extern  BSP_IntHandlerTIM2
				    .extern  BSP_IntHandlerTIM3
				    .extern  BSP_IntHandlerTIM4
				    .extern  BSP_IntHandlerI2C1_EV
				    .extern  BSP_IntHandlerI2C1_ER
				    .extern  BSP_IntHandlerI2C2_EV
				    .extern  BSP_IntHandlerI2C2_ER
				    .extern  BSP_IntHandlerSPI1
				    .extern  BSP_IntHandlerSPI2
				    .extern  BSP_IntHandlerUSART1
				    .extern  BSP_IntHandlerUSART2
				    .extern  BSP_IntHandlerUSART3
				    .extern  BSP_IntHandlerEXTI15_10
				    .extern  BSP_IntHandlerRTCAlarm
				    .extern  BSP_IntHandlerOTG_FS_WKUP
				    .extern  BSP_IntHandlerTIM8_BRK_TIM12
				    .extern  BSP_IntHandlerTIM8_UP_TIM13
				    .extern  BSP_IntHandlerTIM8_TRG_COM_TIM14
				    .extern  BSP_IntHandlerTIM8_CC

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?