STM32_COMMON.ld 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. Common part of the linker scripts for STR32 devices
  3. Copyright RAISONANCE 2007
  4. You can use, modify and distribute thisfile freely, but without any waranty.
  5. */
  6. /* default stack sizes.
  7. These are used by the startup in order to allocate stacks for the different modes.
  8. */
  9. __Stack_Size = 1024 ;
  10. PROVIDE ( _Stack_Size = __Stack_Size ) ;
  11. __Stack_Init = _estack - __Stack_Size ;
  12. /*"PROVIDE" allows to easily override these values from an object file or the commmand line.*/
  13. PROVIDE ( _Stack_Init = __Stack_Init ) ;
  14. /*
  15. There will be a link error if there is not this amount of RAM free at the end.
  16. */
  17. _Minimum_Stack_Size = 0x100 ;
  18. /*
  19. this sends all unreferenced IRQHandlers to reset
  20. */
  21. PROVIDE ( Undefined_Handler = 0 ) ;
  22. PROVIDE ( SWI_Handler = 0 ) ;
  23. PROVIDE ( IRQ_Handler = 0 ) ;
  24. PROVIDE ( Prefetch_Handler = 0 ) ;
  25. PROVIDE ( Abort_Handler = 0 ) ;
  26. PROVIDE ( FIQ_Handler = 0 ) ;
  27. PROVIDE ( NMIException = 0 ) ;
  28. PROVIDE ( HardFaultException = 0 ) ;
  29. PROVIDE ( MemManageException = 0 ) ;
  30. PROVIDE ( BusFaultException = 0 ) ;
  31. PROVIDE ( UsageFaultException = 0 ) ;
  32. PROVIDE ( SVCHandler = 0 ) ;
  33. PROVIDE ( DebugMonitor = 0 ) ;
  34. PROVIDE ( PendSVC = 0 ) ;
  35. PROVIDE ( SysTickHandler = 0 ) ;
  36. PROVIDE ( WWDG_IRQHandler = 0 ) ;
  37. PROVIDE ( PVD_IRQHandler = 0 ) ;
  38. PROVIDE ( TAMPER_IRQHandler = 0 ) ;
  39. PROVIDE ( RTC_IRQHandler = 0 ) ;
  40. PROVIDE ( FLASH_IRQHandler = 0 ) ;
  41. PROVIDE ( RCC_IRQHandler = 0 ) ;
  42. PROVIDE ( EXTI0_IRQHandler = 0 ) ;
  43. PROVIDE ( EXTI1_IRQHandler = 0 ) ;
  44. PROVIDE ( EXTI2_IRQHandler = 0 ) ;
  45. PROVIDE ( EXTI3_IRQHandler = 0 ) ;
  46. PROVIDE ( EXTI4_IRQHandler = 0 ) ;
  47. PROVIDE ( DMAChannel1_IRQHandler = 0 ) ;
  48. PROVIDE ( DMAChannel2_IRQHandler = 0 ) ;
  49. PROVIDE ( DMAChannel3_IRQHandler = 0 ) ;
  50. PROVIDE ( DMAChannel4_IRQHandler = 0 ) ;
  51. PROVIDE ( DMAChannel5_IRQHandler = 0 ) ;
  52. PROVIDE ( DMAChannel6_IRQHandler = 0 ) ;
  53. PROVIDE ( DMAChannel7_IRQHandler = 0 ) ;
  54. PROVIDE ( ADC_IRQHandler = 0 ) ;
  55. PROVIDE ( USB_HP_CAN_TX_IRQHandler = 0 ) ;
  56. PROVIDE ( USB_LP_CAN_RX0_IRQHandler = 0 ) ;
  57. PROVIDE ( CAN_RX1_IRQHandler = 0 ) ;
  58. PROVIDE ( CAN_SCE_IRQHandler = 0 ) ;
  59. PROVIDE ( EXTI9_5_IRQHandler = 0 ) ;
  60. PROVIDE ( TIM1_BRK_IRQHandler = 0 ) ;
  61. PROVIDE ( TIM1_UP_IRQHandler = 0 ) ;
  62. PROVIDE ( TIM1_TRG_COM_IRQHandler = 0 ) ;
  63. PROVIDE ( TIM1_CC_IRQHandler = 0 ) ;
  64. PROVIDE ( TIM2_IRQHandler = 0 ) ;
  65. PROVIDE ( TIM3_IRQHandler = 0 ) ;
  66. PROVIDE ( TIM4_IRQHandler = 0 ) ;
  67. PROVIDE ( I2C1_EV_IRQHandler = 0 ) ;
  68. PROVIDE ( I2C1_ER_IRQHandler = 0 ) ;
  69. PROVIDE ( I2C2_EV_IRQHandler = 0 ) ;
  70. PROVIDE ( I2C2_ER_IRQHandler = 0 ) ;
  71. PROVIDE ( SPI1_IRQHandler = 0 ) ;
  72. PROVIDE ( SPI2_IRQHandler = 0 ) ;
  73. PROVIDE ( USART1_IRQHandler = 0 ) ;
  74. PROVIDE ( USART2_IRQHandler = 0 ) ;
  75. PROVIDE ( USART3_IRQHandler = 0 ) ;
  76. PROVIDE ( EXTI15_10_IRQHandler = 0 ) ;
  77. PROVIDE ( RTCAlarm_IRQHandler = 0 ) ;
  78. PROVIDE ( USBWakeUp_IRQHandler = 0 ) ;
  79. /******************************************************************************/
  80. /* Peripheral memory map */
  81. /******************************************************************************/
  82. /*this allows to compile the ST lib in "non-debug" mode*/
  83. /* Peripheral and SRAM base address in the alias region */
  84. PERIPH_BB_BASE = 0x42000000;
  85. SRAM_BB_BASE = 0x22000000;
  86. /* Peripheral and SRAM base address in the bit-band region */
  87. SRAM_BASE = 0x20000000;
  88. PERIPH_BASE = 0x40000000;
  89. /* Flash registers base address */
  90. PROVIDE ( FLASH_BASE = 0x40022000);
  91. /* Flash Option Bytes base address */
  92. PROVIDE ( OB_BASE = 0x1FFFF800);
  93. /* Peripheral memory map */
  94. APB1PERIPH_BASE = PERIPH_BASE ;
  95. APB2PERIPH_BASE = (PERIPH_BASE + 0x10000) ;
  96. AHBPERIPH_BASE = (PERIPH_BASE + 0x20000) ;
  97. PROVIDE ( TIM2 = (APB1PERIPH_BASE + 0x0000) ) ;
  98. PROVIDE ( TIM3 = (APB1PERIPH_BASE + 0x0400) ) ;
  99. PROVIDE ( TIM4 = (APB1PERIPH_BASE + 0x0800) ) ;
  100. PROVIDE ( RTC = (APB1PERIPH_BASE + 0x2800) ) ;
  101. PROVIDE ( WWDG = (APB1PERIPH_BASE + 0x2C00) ) ;
  102. PROVIDE ( IWDG = (APB1PERIPH_BASE + 0x3000) ) ;
  103. PROVIDE ( SPI2 = (APB1PERIPH_BASE + 0x3800) ) ;
  104. PROVIDE ( USART2 = (APB1PERIPH_BASE + 0x4400) ) ;
  105. PROVIDE ( USART3 = (APB1PERIPH_BASE + 0x4800) ) ;
  106. PROVIDE ( I2C1 = (APB1PERIPH_BASE + 0x5400) ) ;
  107. PROVIDE ( I2C2 = (APB1PERIPH_BASE + 0x5800) ) ;
  108. PROVIDE ( CAN = (APB1PERIPH_BASE + 0x6400) ) ;
  109. PROVIDE ( BKP = (APB1PERIPH_BASE + 0x6C00) ) ;
  110. PROVIDE ( PWR = (APB1PERIPH_BASE + 0x7000) ) ;
  111. PROVIDE ( AFIO = (APB2PERIPH_BASE + 0x0000) ) ;
  112. PROVIDE ( EXTI = (APB2PERIPH_BASE + 0x0400) ) ;
  113. PROVIDE ( GPIOA = (APB2PERIPH_BASE + 0x0800) ) ;
  114. PROVIDE ( GPIOB = (APB2PERIPH_BASE + 0x0C00) ) ;
  115. PROVIDE ( GPIOC = (APB2PERIPH_BASE + 0x1000) ) ;
  116. PROVIDE ( GPIOD = (APB2PERIPH_BASE + 0x1400) ) ;
  117. PROVIDE ( GPIOE = (APB2PERIPH_BASE + 0x1800) ) ;
  118. PROVIDE ( ADC1 = (APB2PERIPH_BASE + 0x2400) ) ;
  119. PROVIDE ( ADC2 = (APB2PERIPH_BASE + 0x2800) ) ;
  120. PROVIDE ( TIM1 = (APB2PERIPH_BASE + 0x2C00) ) ;
  121. PROVIDE ( SPI1 = (APB2PERIPH_BASE + 0x3000) ) ;
  122. PROVIDE ( USART1 = (APB2PERIPH_BASE + 0x3800) ) ;
  123. PROVIDE ( DMA = (AHBPERIPH_BASE + 0x0000) ) ;
  124. PROVIDE ( DMA_Channel1 = (AHBPERIPH_BASE + 0x0008) ) ;
  125. PROVIDE ( DMA_Channel2 = (AHBPERIPH_BASE + 0x001C) ) ;
  126. PROVIDE ( DMA_Channel3 = (AHBPERIPH_BASE + 0x0030) ) ;
  127. PROVIDE ( DMA_Channel4 = (AHBPERIPH_BASE + 0x0044) ) ;
  128. PROVIDE ( DMA_Channel5 = (AHBPERIPH_BASE + 0x0058) ) ;
  129. PROVIDE ( DMA_Channel6 = (AHBPERIPH_BASE + 0x006C) ) ;
  130. PROVIDE ( DMA_Channel7 = (AHBPERIPH_BASE + 0x0080) ) ;
  131. PROVIDE ( RCC = (AHBPERIPH_BASE + 0x1000) ) ;
  132. /* System Control Space memory map */
  133. SCS_BASE = 0xE000E000;
  134. PROVIDE ( SysTick = (SCS_BASE + 0x0010) ) ;
  135. PROVIDE ( NVIC = (SCS_BASE + 0x0100) ) ;
  136. PROVIDE ( SCB = (SCS_BASE + 0x0D00) ) ;