微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > Cortex-M3 (NXP LPC1788)之启动代码分析

Cortex-M3 (NXP LPC1788)之启动代码分析

时间:11-19 来源:互联网 点击:
在Keil uVision4中新建一个基于NXP1788的工程后,会提示添加启动汇编代码startup_LPC177x_8x.S。该文件进行从汇编到C语言运行环境的初始化工作。

  1. ;/*****************************************************************************
  2. ;*@file:startup_LPC177x_8x.s
  3. ;*@purpose:CMSISCortex-M3CoreDeviceStartupFile
  4. ;*fortheNXPLPC177x_8xDeviceSeries
  5. ;*@version:V1.20
  6. ;*@date:07.October2010
  7. ;*------->>------------------
  8. ;*
  9. ;*Copyright(C)2010ARMLimited.Allrightsreserved.
  10. ;*ARMLimited(ARM)issupplyingthissoftwareforusewithCortex-M3
  11. ;*processorbasedmicrocontrollers.Thisfilecanbefreelydistributed
  12. ;*withindevelopmenttoolsthataresupportingsuchARMbasedprocessors.
  13. ;*
  14. ;*THISSOFTWAREISPROVIDED"ASIS".NOWARRANTIES,WHETHEREXPRESS,IMPLIED
  15. ;*ORSTATUTORY,INCLUDING,BUTNOTLIMITEDTO,IMPLIEDWARRANTIESOF
  16. ;*MERCHANTABILITYANDFITNESSFORAPARTICULARPURPOSEAPPLYTOTHISSOFTWARE.
  17. ;*ARMSHALLNOT,INANYCIRCUMSTANCES,BELIABLEFORSPECIAL,INCIDENTAL,OR
  18. ;*CONSEQUENTIALDAMAGES,FORANYREASONWHATSOEVER.
  19. ;*
  20. ;*****************************************************************************/
  21. ;StackConfiguration
  22. ;StackSize(inBytes)<0x0-0xFFFFFFFF:8>
  23. ;
  24. Stack_SizeEQU0x00000200
  25. AREASTACK,NOINIT,READWRITE,ALIGN=3
  26. Stack_MemSPACEStack_Size
  27. __initial_sp
  28. ;HeapConfiguration
  29. ;HeapSize(inBytes)<0x0-0xFFFFFFFF:8>
  30. ;
  31. Heap_SizeEQU0x00000400
  32. AREAHEAP,NOINIT,READWRITE,ALIGN=3
  33. __heap_base
  34. Heap_MemSPACEHeap_Size
  35. __heap_limit
  36. PRESERVE8
  37. THUMB
  38. ;VectorTableMappedtoAddress0atReset
  39. AREARESET,DATA,READONLY
  40. EXPORT__Vectors
  41. __VectorsDCD__initial_sp;TopofStack
  42. DCDReset_Handler;ResetHandler
  43. DCDNMI_Handler;NMIHandler
  44. DCDHardFault_Handler;HardFaultHandler
  45. DCDMemManage_Handler;MPUFaultHandler
  46. DCDBusFault_Handler;BusFaultHandler
  47. DCDUsageFault_Handler;UsageFaultHandler
  48. DCD0;Reserved
  49. DCD0;Reserved
  50. DCD0;Reserved
  51. DCD0;Reserved
  52. DCDSVC_Handler;SVCallHandler
  53. DCDDebugMon_Handler;DebugMonitorHandler
  54. DCD0;Reserved
  55. DCDPendSV_Handler;PendSVHandler
  56. DCDSysTick_Handler;SysTickHandler
  57. ;ExternalInterrupts
  58. DCDWDT_IRQHandler;16:WatchdogTimer
  59. DCDTIMER0_IRQHandler;17:Timer0
  60. DCDTIMER1_IRQHandler;18:Timer1
  61. DCDTIMER2_IRQHandler;19:Timer2
  62. DCDTIMER3_IRQHandler;20:Timer3
  63. DCDUART0_IRQHandler;21:UART0
  64. DCDUART1_IRQHandler;22:UART1
  65. DCDUART2_IRQHandler;23:UART2
  66. DCDUART3_IRQHandler;24:UART3
  67. DCDPWM1_IRQHandler;25:PWM1
  68. DCDI2C0_IRQHandler;26:I2C0
  69. DCDI2C1_IRQHandler;27:I2C1
  70. DCDI2C2_IRQHandler;28:I2C2
  71. DCDSPIFI_IRQHandler;29:SPIFI
  72. DCDSSP0_IRQHandler;30:SSP0
  73. DCDSSP1_IRQHandler;31:SSP1
  74. DCDPLL0_IRQHandler;32:PLL0Lock(MainPLL)
  75. DCDRTC_IRQHandler;33:RealTimeClock
  76. DCDEINT0_IRQHandler;34:ExternalInterrupt0
  77. DCDEINT1_IRQHandler;35:ExternalInterrupt1
  78. DCDEINT2_IRQHandler;36:ExternalInterrupt2
  79. DCDEINT3_IRQHandler;37:ExternalInterrupt3
  80. DCDADC_IRQHandler;38:A/DConverter
  81. DCDBOD_IRQHandler;39:Brown-OutDetect
  82. DCDUSB_IRQHandler;40:USB
  83. DCDCAN_IRQHandler;41:CAN
  84. DCDDMA_IRQHandler;42:GeneralPurposeDMA
  85. DCDI2S_IRQHandler;43:I2S
  86. DCDENET_IRQHandler;44:Ethernet
  87. DCDMCI_IRQHandler;45:SD/MMCcardI/F
  88. DCDMCPWM_IRQHandler;46:MotorControlPWM
  89. DCDQEI_IRQHandler;47:QuadratureEncoderInterface
  90. DCDPLL1_IRQHandler;48:PLL1Lock(USBPLL)
  91. DCDUSBActivity_IRQHandler;49:USBActivityinterrupttowakeup
  92. DCDCANActivity_IRQHandler;50:CANActivityinterrupttowakeup
  93. DCDUART4_IRQHandler;51:UART4
  94. DCDSSP2_IRQHandler;52:SSP2
  95. DCDLCD_IRQHandler;53:LCD
  96. DCDGPIO_IRQHandler;54:GPIO
  97. DCDPWM0_IRQHandler;55:PWM0
  98. DCDEEPROM_IRQHandler;56:EEPROM
  99. IF:LNOT::DEF:NO_CRP
  100. AREA|.ARM.__at_0x02FC|,CODE,READONLY
  101. CRP_KeyDCD0xFFFFFFFF
  102. ENDIF
  103. AREA|.text|,CODE,READONLY
  104. ;ResetHandler
  105. Reset_HandlerPROC
  106. EXPORTReset_Handler[WEAK]
  107. IMPORTSystemInit
  108. IMPORT__main
  109. LDRR0,=SystemInit
  110. BLXR0
  111. LDRR0,=__main
  112. BXR0
  113. ENDP
  114. ;DummyExceptionHandlers(infiniteloopswhichcanbemodified)
  115. NMI_HandlerPROC
  116. EXPORTNMI_Handler[WEAK]
  117. B.
  118. ENDP
  119. HardFault_Handler\
  120. PROC
  121. EXPORTHardFault_Handler[WEAK]
  122. B.
  123. ENDP
  124. MemManage_Handler\
  125. PROC
  126. EXPORTMemManage_Handler[WEAK]
  127. B.
  128. ENDP

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top