repo_id
stringlengths
5
115
size
int64
590
5.01M
file_path
stringlengths
4
212
content
stringlengths
590
5.01M
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_OptionByteWrite_RST/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_OptionByteWrite_RST/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_OptionByteWrite_RST/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_PageEraseAndWrite/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_PageEraseAndWrite/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_PageEraseAndWrite/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_SectorEraseAndWrite/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_SectorEraseAndWrite/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_SectorEraseAndWrite/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_OptionByteWrite_Boot_LoadFlash/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_OptionByteWrite_Boot_LoadFlash/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/FLASH/FLASH_OptionByteWrite_Boot_LoadFlash/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/CRC/CRC_CalculateCheckValue/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/CRC/CRC_CalculateCheckValue/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/CRC/CRC_CalculateCheckValue/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_ContinuousMode_WakeUp_WFE/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_ContinuousMode_WakeUp_WFE/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_ContinuousMode_WakeUp_WFE/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_OnceMode_WakeUp_WFE/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_OnceMode_WakeUp_WFE/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_OnceMode_WakeUp_WFE/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_OnceMode_WakeUp_WFI/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_OnceMode_WakeUp_WFI/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_OnceMode_WakeUp_WFI/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_ContinuousMode_WakeUp_WFI/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_ContinuousMode_WakeUp_WFI/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/LPTIM/LPTIM_ContinuousMode_WakeUp_WFI/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_Polling_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_Polling_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_Polling_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_WakeupFromSleep/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_WakeupFromSleep/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_WakeupFromSleep/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_Window/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_Window/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/COMP/COMP_CompareGpioVs1_2VCC_Window/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/RCC/RCC_LSI_Output/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/RCC/RCC_LSI_Output/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/RCC/RCC_LSI_Output/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/RCC/RCC_HSE_Bypass_Output/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/RCC/RCC_HSE_Bypass_Output/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/RCC/RCC_HSE_Bypass_Output/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/RCC/RCC_HSI_Output/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/RCC/RCC_HSI_Output/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/RCC/RCC_HSI_Output/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/RCC/RCC_LSE_Output/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/RCC/RCC_LSE_Output/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/RCC/RCC_LSE_Output/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_IT/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_IT/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_IT/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_MultichannelSwitch/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_MultichannelSwitch/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_MultichannelSwitch/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_AWD/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_AWD/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_AWD/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_StopForLowPower/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_StopForLowPower/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_StopForLowPower/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_Temperature_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_Temperature_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_Temperature_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefbufManualOffsetCalibration/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefbufManualOffsetCalibration/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefbufManualOffsetCalibration/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_Polling/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_Polling/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_SingleConversion_TriggerTimer_Polling/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefintAndVrefbuf2P5_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefintAndVrefbuf2P5_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefintAndVrefbuf2P5_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefintAndVrefbuf_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefintAndVrefbuf_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/ADC/ADC_VrefintAndVrefbuf_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexMaster_Polling_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexMaster_Polling_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexMaster_Polling_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexSlave_IT_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexSlave_IT_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexSlave_IT_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexMaster_IT_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexMaster_IT_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexMaster_IT_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexSlave_Polling_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexSlave_Polling_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/SPI/SPI_TwoBoards_FullDuplexSlave_Polling_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_Toggle/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_Toggle/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_Toggle/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_FastIO/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_FastIO/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_FastIO/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_Toggle_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_Toggle_Init/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/GPIO/GPIO_Toggle_Init/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/TIM/TIM1_OC_Toggle/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,258
Projects/PY32F002B-STK/Example_LL/TIM/TIM1_OC_Toggle/EWARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx devices vector table for EWARM toolchain. ;* This module performs: ;* - Set the initial SP ;* - Set the initial PC == __iar_program_start ;* - Set the vector table entries with the exceptions ISR address ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ; ; The modules in this file are included in the libraries, and may be replaced ; by any user-defined modules that define the PUBLIC symbol _program_start or ; a user defined start symbol. ; To override the cstartup defined in the library, simply add your modified ; version to the workbench project. ; ; The vector table is normally located at address 0. ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. ; The name "__vector_table" has special meaning for C-SPY: ; it is where the SP start value is found, and the NVIC vector ; table register (VTOR) is initialized to this address if != 0. ; ; Cortex-M version ; MODULE ?cstartup ;; Forward declaration of sections. SECTION CSTACK:DATA:NOROOT(3) SECTION .intvec:CODE:NOROOT(2) EXTERN __iar_program_start EXTERN SystemInit PUBLIC __vector_table DATA __vector_table DCD sfe(CSTACK) ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Default interrupt handlers. ;; THUMB PUBWEAK Reset_Handler SECTION .text:CODE:REORDER:NOROOT(2) Reset_Handler LDR R0, =SystemInit BLX R0 LDR R0, =__iar_program_start BX R0 PUBWEAK NMI_Handler SECTION .text:CODE:REORDER:NOROOT(1) NMI_Handler B NMI_Handler PUBWEAK HardFault_Handler SECTION .text:CODE:REORDER:NOROOT(1) HardFault_Handler B HardFault_Handler PUBWEAK SVC_Handler SECTION .text:CODE:REORDER:NOROOT(1) SVC_Handler B SVC_Handler PUBWEAK PendSV_Handler SECTION .text:CODE:REORDER:NOROOT(1) PendSV_Handler B PendSV_Handler PUBWEAK SysTick_Handler SECTION .text:CODE:REORDER:NOROOT(1) SysTick_Handler B SysTick_Handler PUBWEAK FLASH_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) FLASH_IRQHandler B FLASH_IRQHandler PUBWEAK RCC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) RCC_IRQHandler B RCC_IRQHandler PUBWEAK EXTI0_1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI0_1_IRQHandler B EXTI0_1_IRQHandler PUBWEAK EXTI2_3_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI2_3_IRQHandler B EXTI2_3_IRQHandler PUBWEAK EXTI4_15_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) EXTI4_15_IRQHandler B EXTI4_15_IRQHandler PUBWEAK ADC_COMP_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) ADC_COMP_IRQHandler B ADC_COMP_IRQHandler PUBWEAK TIM1_BRK_UP_TRG_COM_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_BRK_UP_TRG_COM_IRQHandler B TIM1_BRK_UP_TRG_COM_IRQHandler PUBWEAK TIM1_CC_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM1_CC_IRQHandler B TIM1_CC_IRQHandler PUBWEAK LPTIM1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) LPTIM1_IRQHandler B LPTIM1_IRQHandler PUBWEAK TIM14_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) TIM14_IRQHandler B TIM14_IRQHandler PUBWEAK I2C1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) I2C1_IRQHandler B I2C1_IRQHandler PUBWEAK SPI1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) SPI1_IRQHandler B SPI1_IRQHandler PUBWEAK USART1_IRQHandler SECTION .text:CODE:REORDER:NOROOT(1) USART1_IRQHandler B USART1_IRQHandler END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************
OpenPuya/PY32F002B_Firmware
8,776
Projects/PY32F002B-STK/Example_LL/TIM/TIM1_OC_Toggle/EIDE/startup_py32f002bxx.s
/** ****************************************************************************** * @file startup_py32f002bxx.s * @author MCD Application Team * @brief PY32F002Bxx devices vector table GCC toolchain. * This module performs: * - Set the initial SP * - Set the initial PC == Reset_Handler, * - Set the vector table entries with the exceptions ISR address * - Branches to main in the C library (which eventually * calls main()). * After Reset the Cortex-M0+ processor is in Thread mode, * priority is Privileged, and the Stack is set to Main. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. * All rights reserved.</center></h2> * * This software component is licensed by Puya under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ .syntax unified .cpu cortex-m0plus .fpu softvfp .thumb .global g_pfnVectors .global Default_Handler /* start address for the initialization values of the .data section. defined in linker script */ .word _sidata /* start address for the .data section. defined in linker script */ .word _sdata /* end address for the .data section. defined in linker script */ .word _edata /* start address for the .bss section. defined in linker script */ .word _sbss /* end address for the .bss section. defined in linker script */ .word _ebss /** * @brief 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. * @param None * @retval None */ .section .text.Reset_Handler .weak Reset_Handler .type Reset_Handler, %function Reset_Handler: ldr r0, =_estack mov sp, r0 /* set stack pointer */ /* Call the clock system initialization function.*/ bl SystemInit /* Copy the data segment initializers from flash to SRAM */ ldr r0, =_sdata ldr r1, =_edata ldr r2, =_sidata movs r3, #0 b LoopCopyDataInit CopyDataInit: ldr r4, [r2, r3] str r4, [r0, r3] adds r3, r3, #4 LoopCopyDataInit: adds r4, r0, r3 cmp r4, r1 bcc CopyDataInit /* Zero fill the bss segment. */ ldr r2, =_sbss ldr r4, =_ebss movs r3, #0 b LoopFillZerobss FillZerobss: str r3, [r2] adds r2, r2, #4 LoopFillZerobss: cmp r2, r4 bcc FillZerobss /* Call static constructors */ bl __libc_init_array /* Call the application s entry point.*/ bl main LoopForever: b LoopForever .size Reset_Handler, .-Reset_Handler /** * @brief This is the code that gets called when the processor receives an * unexpected interrupt. This simply enters an infinite loop, preserving * the system state for examination by a debugger. * * @param None * @retval None */ .section .text.Default_Handler,"ax",%progbits Default_Handler: Infinite_Loop: b Infinite_Loop .size Default_Handler, .-Default_Handler /****************************************************************************** * * The minimal vector table for a Cortex M0. Note that the proper constructs * must be placed on this to ensure that it ends up at physical address * 0x0000.0000. * ******************************************************************************/ .section .isr_vector,"a",%progbits .type g_pfnVectors, %object .size g_pfnVectors, .-g_pfnVectors g_pfnVectors: .word _estack .word Reset_Handler .word NMI_Handler .word HardFault_Handler .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word 0 .word SVC_Handler .word 0 .word 0 .word PendSV_Handler .word SysTick_Handler .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word FLASH_IRQHandler /* FLASH */ .word RCC_IRQHandler /* RCC */ .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word ADC_COMP_IRQHandler /* ADC and COMP1 */ .word TIM1_BRK_UP_TRG_COM_IRQHandler /* TIM1 Break, Update, Trigger and Commutation */ .word TIM1_CC_IRQHandler /* TIM1 Capture Compare */ .word 0 /* reserved */ .word 0 /* reserved */ .word LPTIM1_IRQHandler /* LPTIM1 */ .word 0 /* reserved */ .word TIM14_IRQHandler /* TIM14 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word I2C1_IRQHandler /* I2C1 */ .word 0 /* reserved */ .word SPI1_IRQHandler /* SPI1 */ .word 0 /* reserved */ .word USART1_IRQHandler /* USART1 */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ .word 0 /* reserved */ /******************************************************************************* * * Provide weak aliases for each Exception handler to the Default_Handler. * As they are weak aliases, any function with the same name will override * this definition. * *******************************************************************************/ .weak NMI_Handler .thumb_set NMI_Handler,Default_Handler .weak HardFault_Handler .thumb_set HardFault_Handler,Default_Handler .weak SVC_Handler .thumb_set SVC_Handler,Default_Handler .weak PendSV_Handler .thumb_set PendSV_Handler,Default_Handler .weak SysTick_Handler .thumb_set SysTick_Handler,Default_Handler .weak FLASH_IRQHandler .thumb_set FLASH_IRQHandler,Default_Handler .weak RCC_IRQHandler .thumb_set RCC_IRQHandler,Default_Handler .weak EXTI0_1_IRQHandler .thumb_set EXTI0_1_IRQHandler,Default_Handler .weak EXTI2_3_IRQHandler .thumb_set EXTI2_3_IRQHandler,Default_Handler .weak EXTI4_15_IRQHandler .thumb_set EXTI4_15_IRQHandler,Default_Handler .weak ADC_COMP_IRQHandler .thumb_set ADC_COMP_IRQHandler,Default_Handler .weak TIM1_BRK_UP_TRG_COM_IRQHandler .thumb_set TIM1_BRK_UP_TRG_COM_IRQHandler,Default_Handler .weak TIM1_CC_IRQHandler .thumb_set TIM1_CC_IRQHandler,Default_Handler .weak LPTIM1_IRQHandler .thumb_set LPTIM1_IRQHandler,Default_Handler .weak TIM14_IRQHandler .thumb_set TIM14_IRQHandler,Default_Handler .weak I2C1_IRQHandler .thumb_set I2C1_IRQHandler,Default_Handler .weak SPI1_IRQHandler .thumb_set SPI1_IRQHandler,Default_Handler .weak USART1_IRQHandler .thumb_set USART1_IRQHandler,Default_Handler
OpenPuya/PY32F002B_Firmware
8,946
Projects/PY32F002B-STK/Example_LL/TIM/TIM1_6Step_Init/MDK-ARM/startup_py32f002bxx.s
;****************************************************************************** ;* @file startup_py32f002bxx.s ;* @author MCU Application Team ;* @brief PY32F002Bxx 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 ;* - Branches to __main in the C library (which eventually ;* calls main()). ;* After Reset the CortexM0+ processor is in Thread mode, ;* priority is Privileged, and the Stack is set to Main. ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconductor Co. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by Puya under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* @attention ;* ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectronics. ;* All rights reserved.</center></h2> ;* ;* This software component is licensed by ST under BSD 3-Clause license, ;* the "License"; You may not use this file except in compliance with the ;* License. You may obtain a copy of the License at: ;* opensource.org/licenses/BSD-3-Clause ;* ;****************************************************************************** ;* <<< Use Configuration Wizard in Context Menu >>> ; Amount of memory (in bytes) allocated for Stack ; Tailor this value to your application needs ; <h> Stack Configuration ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size __initial_sp ; <h> Heap Configuration ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; </h> Heap_Size EQU 0x00000000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base Heap_Mem SPACE Heap_Size __heap_limit PRESERVE8 THUMB ; Vector Table Mapped to Address 0 at Reset AREA RESET, DATA, READONLY EXPORT __Vectors EXPORT __Vectors_End EXPORT __Vectors_Size __Vectors DCD __initial_sp ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD 0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD 0 ; Reserved DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler ; External Interrupts DCD 0 ; 0Reserved DCD 0 ; 1Reserved DCD 0 ; 2Reserved DCD FLASH_IRQHandler ; 3FLASH DCD RCC_IRQHandler ; 4RCC DCD EXTI0_1_IRQHandler ; 5EXTI Line 0 and 1 DCD EXTI2_3_IRQHandler ; 6EXTI Line 2 and 3 DCD EXTI4_15_IRQHandler ; 7EXTI Line 4 to 15 DCD 0 ; 8Reserved DCD 0 ; 9Reserved DCD 0 ; 10Reserved DCD 0 ; 11Reserved DCD ADC_COMP_IRQHandler ; 12ADC&COMP1 DCD TIM1_BRK_UP_TRG_COM_IRQHandler ; 13TIM1 Break, Update, Trigger and Commutation DCD TIM1_CC_IRQHandler ; 14TIM1 Capture Compare DCD 0 ; 15Reserved DCD 0 ; 16Reserved DCD LPTIM1_IRQHandler ; 17LPTIM1 DCD 0 ; 18Reserved DCD TIM14_IRQHandler ; 19TIM14 DCD 0 ; 20Reserved DCD 0 ; 21Reserved DCD 0 ; 22Reserved DCD I2C1_IRQHandler ; 23I2C1 DCD 0 ; 24Reserved DCD SPI1_IRQHandler ; 25SPI1 DCD 0 ; 26Reserved DCD USART1_IRQHandler ; 27USART1 DCD 0 ; 28Reserved DCD 0 ; 29Reserved DCD 0 ; 30Reserved DCD 0 ; 31Reserved __Vectors_End __Vectors_Size EQU __Vectors_End - __Vectors AREA |.text|, CODE, READONLY ; Reset Handler Reset_Handler PROC EXPORT Reset_Handler [WEAK] IMPORT SystemInit IMPORT __main LDR R0, =SystemInit BLX R0 LDR R0, =__main BX R0 ENDP ; Dummy Exception Handlers (infinite loops which can be modified) NMI_Handler PROC EXPORT NMI_Handler [WEAK] B . ENDP HardFault_Handler\ PROC EXPORT HardFault_Handler [WEAK] B . ENDP SVC_Handler PROC EXPORT SVC_Handler [WEAK] B . ENDP PendSV_Handler PROC EXPORT PendSV_Handler [WEAK] B . ENDP SysTick_Handler PROC EXPORT SysTick_Handler [WEAK] B . ENDP Default_Handler PROC EXPORT FLASH_IRQHandler [WEAK] EXPORT RCC_IRQHandler [WEAK] EXPORT EXTI0_1_IRQHandler [WEAK] EXPORT EXTI2_3_IRQHandler [WEAK] EXPORT EXTI4_15_IRQHandler [WEAK] EXPORT ADC_COMP_IRQHandler [WEAK] EXPORT TIM1_BRK_UP_TRG_COM_IRQHandler [WEAK] EXPORT TIM1_CC_IRQHandler [WEAK] EXPORT LPTIM1_IRQHandler [WEAK] EXPORT TIM14_IRQHandler [WEAK] EXPORT I2C1_IRQHandler [WEAK] EXPORT SPI1_IRQHandler [WEAK] EXPORT USART1_IRQHandler [WEAK] FLASH_IRQHandler RCC_IRQHandler EXTI0_1_IRQHandler EXTI2_3_IRQHandler EXTI4_15_IRQHandler ADC_COMP_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler TIM1_CC_IRQHandler LPTIM1_IRQHandler TIM14_IRQHandler I2C1_IRQHandler SPI1_IRQHandler USART1_IRQHandler B . ENDP ALIGN ; User Initial Stack & Heap IF :DEF:__MICROLIB EXPORT __initial_sp EXPORT __heap_base EXPORT __heap_limit ELSE IMPORT __use_two_region_memory EXPORT __user_initial_stackheap __user_initial_stackheap LDR R0, = Heap_Mem LDR R1, =(Stack_Mem + Stack_Size) LDR R2, = (Heap_Mem + Heap_Size) LDR R3, = Stack_Mem BX LR ALIGN ENDIF END ;************************ (C) COPYRIGHT Puya *****END OF FILE*******************