Rename board specific demos as appropriate
[fw/stlink] / example / 32l_dac / startup_stm32l1xx_md.s
diff --git a/example/32l_dac/startup_stm32l1xx_md.s b/example/32l_dac/startup_stm32l1xx_md.s
new file mode 100644 (file)
index 0000000..9a8389c
--- /dev/null
@@ -0,0 +1,365 @@
+/**\r
+ ******************************************************************************\r
+ * @file      startup_stm32l1xx_md.s\r
+ * @author    MCD Application Team\r
+ * @version   V1.0.0\r
+ * @date      31-December-2010\r
+ * @brief     STM32L1xx Ultra Low Power Medium-density Devices vector table for \r
+ *            RIDE7 toolchain.\r
+ *            This module performs:\r
+ *                - Set the initial SP\r
+ *                - Set the initial PC == Reset_Handler,\r
+ *                - Set the vector table entries with the exceptions ISR address\r
+ *                - Branches to main in the C library (which eventually\r
+ *                  calls main()).\r
+ *            After Reset the Cortex-M3 processor is in Thread mode,\r
+ *            priority is Privileged, and the Stack is set to Main.\r
+ *******************************************************************************\r
+ * @attention\r
+ *\r
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS\r
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE\r
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY\r
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING\r
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE\r
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.\r
+ *\r
+ * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>\r
+ ******************************************************************************* \r
+ */\r
+    \r
+  .syntax unified\r
+  .cpu cortex-m3\r
+  .fpu softvfp\r
+  .thumb\r
+\r
+.global g_pfnVectors\r
+.global Default_Handler\r
+\r
+/* start address for the initialization values of the .data section. \r
+defined in linker script */\r
+.word _sidata\r
+/* start address for the .data section. defined in linker script */  \r
+.word _sdata\r
+/* end address for the .data section. defined in linker script */\r
+.word _edata\r
+/* start address for the .bss section. defined in linker script */\r
+.word _sbss\r
+/* end address for the .bss section. defined in linker script */\r
+.word _ebss\r
+\r
+.equ  BootRAM, 0xF108F85F\r
+/**\r
+ * @brief  This is the code that gets called when the processor first\r
+ *          starts execution following a reset event. Only the absolutely\r
+ *          necessary set is performed, after which the application\r
+ *          supplied main() routine is called. \r
+ * @param  None\r
+ * @retval : None\r
+*/\r
+\r
+    .section .text.Reset_Handler\r
+  .weak Reset_Handler\r
+  .type Reset_Handler, %function\r
+Reset_Handler:\r
+/* Copy the data segment initializers from flash to SRAM */  \r
+  movs r1, #0\r
+  b LoopCopyDataInit\r
+\r
+CopyDataInit:\r
+  ldr r3, =_sidata\r
+  ldr r3, [r3, r1]\r
+  str r3, [r0, r1]\r
+  adds r1, r1, #4\r
+    \r
+LoopCopyDataInit:\r
+  ldr r0, =_sdata\r
+  ldr r3, =_edata\r
+  adds r2, r0, r1\r
+  cmp r2, r3\r
+  bcc CopyDataInit\r
+  ldr r2, =_sbss\r
+  b LoopFillZerobss\r
+/* Zero fill the bss segment. */  \r
+FillZerobss:\r
+  movs r3, #0\r
+  str r3, [r2], #4\r
+    \r
+LoopFillZerobss:\r
+  ldr r3, = _ebss\r
+  cmp r2, r3\r
+  bcc FillZerobss\r
+/* Call the clock system intitialization function.*/\r
+/* let main do the system initialization */\r
+  bl  SystemInit\r
+/* Call the application's entry point.*/\r
+  bl main\r
+  bx lr\r
+.size Reset_Handler, .-Reset_Handler\r
+\r
+/**\r
+ * @brief  This is the code that gets called when the processor receives an \r
+ *         unexpected interrupt.  This simply enters an infinite loop, preserving\r
+ *         the system state for examination by a debugger.\r
+ *\r
+ * @param  None     \r
+ * @retval None       \r
+*/\r
+    .section .text.Default_Handler,"ax",%progbits\r
+Default_Handler:\r
+Infinite_Loop:\r
+  b Infinite_Loop\r
+  .size Default_Handler, .-Default_Handler\r
+/*******************************************************************************\r
+*\r
+* The minimal vector table for a Cortex M3. Note that the proper constructs\r
+* must be placed on this to ensure that it ends up at physical address\r
+* 0x0000.0000.\r
+*******************************************************************************/    \r
+  .section .isr_vector,"a",%progbits\r
+  .type g_pfnVectors, %object\r
+  .size g_pfnVectors, .-g_pfnVectors\r
+    \r
+    \r
+g_pfnVectors:\r
+  .word _estack\r
+  .word Reset_Handler\r
+  .word NMI_Handler\r
+  .word HardFault_Handler\r
+  .word MemManage_Handler\r
+  .word BusFault_Handler\r
+  .word UsageFault_Handler\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word SVC_Handler\r
+  .word DebugMon_Handler\r
+  .word 0\r
+  .word PendSV_Handler\r
+  .word SysTick_Handler\r
+  .word WWDG_IRQHandler\r
+  .word PVD_IRQHandler\r
+  .word TAMPER_STAMP_IRQHandler\r
+  .word RTC_WKUP_IRQHandler\r
+  .word FLASH_IRQHandler\r
+  .word RCC_IRQHandler\r
+  .word EXTI0_IRQHandler\r
+  .word EXTI1_IRQHandler\r
+  .word EXTI2_IRQHandler\r
+  .word EXTI3_IRQHandler\r
+  .word EXTI4_IRQHandler\r
+  .word DMA1_Channel1_IRQHandler\r
+  .word DMA1_Channel2_IRQHandler\r
+  .word DMA1_Channel3_IRQHandler\r
+  .word DMA1_Channel4_IRQHandler\r
+  .word DMA1_Channel5_IRQHandler\r
+  .word DMA1_Channel6_IRQHandler\r
+  .word DMA1_Channel7_IRQHandler\r
+  .word ADC1_IRQHandler\r
+  .word USB_HP_IRQHandler\r
+  .word USB_LP_IRQHandler\r
+  .word DAC_IRQHandler\r
+  .word COMP_IRQHandler\r
+  .word EXTI9_5_IRQHandler\r
+  .word LCD_IRQHandler\r
+  .word TIM9_IRQHandler\r
+  .word TIM10_IRQHandler\r
+  .word TIM11_IRQHandler\r
+  .word TIM2_IRQHandler\r
+  .word TIM3_IRQHandler\r
+  .word TIM4_IRQHandler\r
+  .word I2C1_EV_IRQHandler\r
+  .word I2C1_ER_IRQHandler\r
+  .word I2C2_EV_IRQHandler\r
+  .word I2C2_ER_IRQHandler\r
+  .word SPI1_IRQHandler\r
+  .word SPI2_IRQHandler\r
+  .word USART1_IRQHandler\r
+  .word USART2_IRQHandler\r
+  .word USART3_IRQHandler\r
+  .word EXTI15_10_IRQHandler\r
+  .word RTC_Alarm_IRQHandler\r
+  .word USB_FS_WKUP_IRQHandler\r
+  .word TIM6_IRQHandler\r
+  .word TIM7_IRQHandler\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word 0\r
+  .word BootRAM          /* @0x108. This is for boot in RAM mode for \r
+                            STM32L15x ULtra Low Power Medium-density devices. */\r
+   \r
+/*******************************************************************************\r
+*\r
+* Provide weak aliases for each Exception handler to the Default_Handler. \r
+* As they are weak aliases, any function with the same name will override \r
+* this definition.\r
+*\r
+*******************************************************************************/\r
+    \r
+  .weak NMI_Handler\r
+  .thumb_set NMI_Handler,Default_Handler\r
+\r
+  .weak HardFault_Handler\r
+  .thumb_set HardFault_Handler,Default_Handler\r
+\r
+  .weak MemManage_Handler\r
+  .thumb_set MemManage_Handler,Default_Handler\r
+\r
+  .weak BusFault_Handler\r
+  .thumb_set BusFault_Handler,Default_Handler\r
+\r
+  .weak UsageFault_Handler\r
+  .thumb_set UsageFault_Handler,Default_Handler\r
+\r
+  .weak SVC_Handler\r
+  .thumb_set SVC_Handler,Default_Handler\r
+\r
+  .weak DebugMon_Handler\r
+  .thumb_set DebugMon_Handler,Default_Handler\r
+\r
+  .weak PendSV_Handler\r
+  .thumb_set PendSV_Handler,Default_Handler\r
+\r
+  .weak SysTick_Handler\r
+  .thumb_set SysTick_Handler,Default_Handler\r
+\r
+  .weak WWDG_IRQHandler\r
+  .thumb_set WWDG_IRQHandler,Default_Handler\r
+\r
+  .weak PVD_IRQHandler\r
+  .thumb_set PVD_IRQHandler,Default_Handler\r
+\r
+  .weak TAMPER_STAMP_IRQHandler\r
+  .thumb_set TAMPER_STAMP_IRQHandler,Default_Handler\r
+\r
+  .weak RTC_WKUP_IRQHandler\r
+  .thumb_set RTC_WKUP_IRQHandler,Default_Handler\r
+\r
+  .weak FLASH_IRQHandler\r
+  .thumb_set FLASH_IRQHandler,Default_Handler\r
+\r
+  .weak RCC_IRQHandler\r
+  .thumb_set RCC_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI0_IRQHandler\r
+  .thumb_set EXTI0_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI1_IRQHandler\r
+  .thumb_set EXTI1_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI2_IRQHandler\r
+  .thumb_set EXTI2_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI3_IRQHandler\r
+  .thumb_set EXTI3_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI4_IRQHandler\r
+  .thumb_set EXTI4_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel1_IRQHandler\r
+  .thumb_set DMA1_Channel1_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel2_IRQHandler\r
+  .thumb_set DMA1_Channel2_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel3_IRQHandler\r
+  .thumb_set DMA1_Channel3_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel4_IRQHandler\r
+  .thumb_set DMA1_Channel4_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel5_IRQHandler\r
+  .thumb_set DMA1_Channel5_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel6_IRQHandler\r
+  .thumb_set DMA1_Channel6_IRQHandler,Default_Handler\r
+\r
+  .weak DMA1_Channel7_IRQHandler\r
+  .thumb_set DMA1_Channel7_IRQHandler,Default_Handler\r
+\r
+  .weak ADC1_IRQHandler\r
+  .thumb_set ADC1_IRQHandler,Default_Handler\r
+\r
+  .weak USB_HP_IRQHandler\r
+  .thumb_set USB_HP_IRQHandler,Default_Handler\r
+\r
+  .weak USB_LP_IRQHandler\r
+  .thumb_set USB_LP_IRQHandler,Default_Handler\r
+\r
+  .weak DAC_IRQHandler\r
+  .thumb_set DAC_IRQHandler,Default_Handler\r
+\r
+  .weak COMP_IRQHandler\r
+  .thumb_set COMP_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI9_5_IRQHandler\r
+  .thumb_set EXTI9_5_IRQHandler,Default_Handler\r
+\r
+  .weak LCD_IRQHandler\r
+  .thumb_set LCD_IRQHandler,Default_Handler\r
+  \r
+  .weak TIM9_IRQHandler\r
+  .thumb_set TIM9_IRQHandler,Default_Handler\r
+\r
+  .weak TIM10_IRQHandler\r
+  .thumb_set TIM10_IRQHandler,Default_Handler\r
+\r
+  .weak TIM11_IRQHandler\r
+  .thumb_set TIM11_IRQHandler,Default_Handler\r
+\r
+  .weak TIM2_IRQHandler\r
+  .thumb_set TIM2_IRQHandler,Default_Handler\r
+\r
+  .weak TIM3_IRQHandler\r
+  .thumb_set TIM3_IRQHandler,Default_Handler\r
+\r
+  .weak TIM4_IRQHandler\r
+  .thumb_set TIM4_IRQHandler,Default_Handler\r
+\r
+  .weak I2C1_EV_IRQHandler\r
+  .thumb_set I2C1_EV_IRQHandler,Default_Handler\r
+\r
+  .weak I2C1_ER_IRQHandler\r
+  .thumb_set I2C1_ER_IRQHandler,Default_Handler\r
+\r
+  .weak I2C2_EV_IRQHandler\r
+  .thumb_set I2C2_EV_IRQHandler,Default_Handler\r
+\r
+  .weak I2C2_ER_IRQHandler\r
+  .thumb_set I2C2_ER_IRQHandler,Default_Handler\r
+\r
+  .weak SPI1_IRQHandler\r
+  .thumb_set SPI1_IRQHandler,Default_Handler\r
+\r
+  .weak SPI2_IRQHandler\r
+  .thumb_set SPI2_IRQHandler,Default_Handler\r
+\r
+  .weak USART1_IRQHandler\r
+  .thumb_set USART1_IRQHandler,Default_Handler\r
+\r
+  .weak USART2_IRQHandler\r
+  .thumb_set USART2_IRQHandler,Default_Handler\r
+\r
+  .weak USART3_IRQHandler\r
+  .thumb_set USART3_IRQHandler,Default_Handler\r
+\r
+  .weak EXTI15_10_IRQHandler\r
+  .thumb_set EXTI15_10_IRQHandler,Default_Handler\r
+\r
+  .weak RTC_Alarm_IRQHandler\r
+  .thumb_set RTC_Alarm_IRQHandler,Default_Handler\r
+\r
+  .weak USB_FS_WKUP_IRQHandler\r
+  .thumb_set USB_FS_WKUP_IRQHandler,Default_Handler\r
+\r
+  .weak TIM6_IRQHandler\r
+  .thumb_set TIM6_IRQHandler,Default_Handler\r
+\r
+  .weak TIM7_IRQHandler\r
+  .thumb_set TIM7_IRQHandler,Default_Handler\r
+\r
+/******************** (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE***/\r
+\r