


ARM Macro Assembler    Page 1 


    1 00000000         ;*******************************************************
                       *********************** 
    2 00000000         ;* @file    startup_py32t020xx.s
    3 00000000         ;* @author  MCU Application Team
    4 00000000         ;* @brief   PY32T020xx devices vector table for MDK-ARM 
                       toolchain.
    5 00000000         ;*          This module performs:
    6 00000000         ;*          - Set the initial SP
    7 00000000         ;*          - Set the initial PC == Reset_Handler
    8 00000000         ;*          - Set the vector table entries with the exce
                       ptions ISR address
    9 00000000         ;*          - Branches to __main in the C library (which
                        eventually
   10 00000000         ;*            calls main()).
   11 00000000         ;*          After Reset the CortexM0+ processor is in Th
                       read mode,
   12 00000000         ;*          priority is Privileged, and the Stack is set
                        to Main.
   13 00000000         ;*******************************************************
                       ***********************
   14 00000000         ;* @attention
   15 00000000         ;*
   16 00000000         ;* <h2><center>&copy; Copyright (c) 2023 Puya Semiconduc
                       tor Co.
   17 00000000         ;* All rights reserved.</center></h2>
   18 00000000         ;*
   19 00000000         ;* This software component is licensed by Puya under BSD
                        3-Clause license,
   20 00000000         ;* the "License"; You may not use this file except in co
                       mpliance with the
   21 00000000         ;* License. You may obtain a copy of the License at:
   22 00000000         ;*                        opensource.org/licenses/BSD-3-
                       Clause
   23 00000000         ;*
   24 00000000         ;*******************************************************
                       ***********************
   25 00000000         ;* @attention
   26 00000000         ;*
   27 00000000         ;* <h2><center>&copy; Copyright (c) 2016 STMicroelectron
                       ics.
   28 00000000         ;* All rights reserved.</center></h2>
   29 00000000         ;*
   30 00000000         ;* This software component is licensed by ST under BSD 3
                       -Clause license,
   31 00000000         ;* the "License"; You may not use this file except in co
                       mpliance with the
   32 00000000         ;* License. You may obtain a copy of the License at:
   33 00000000         ;*                        opensource.org/licenses/BSD-3-
                       Clause
   34 00000000         ;*
   35 00000000         ;*******************************************************
                       ***********************
   36 00000000         ;* <<< Use Configuration Wizard in Context Menu >>>
   37 00000000         
   38 00000000         ; Amount of memory (in bytes) allocated for Stack
   39 00000000         ; Tailor this value to your application needs
   40 00000000         ; <h> Stack Configuration
   41 00000000         ;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
   42 00000000         ; </h>



ARM Macro Assembler    Page 2 


   43 00000000         
   44 00000000 00000200 
                       Stack_Size
                               EQU              0x00000200
   45 00000000         
   46 00000000                 AREA             STACK, NOINIT, READWRITE, ALIGN
=3
   47 00000000         Stack_Mem
                               SPACE            Stack_Size
   48 00000200         __initial_sp
   49 00000200         
   50 00000200         
   51 00000200         ; <h> Heap Configuration
   52 00000200         ;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
   53 00000200         ; </h>
   54 00000200         
   55 00000200 00000000 
                       Heap_Size
                               EQU              0x00000000
   56 00000200         
   57 00000200                 AREA             HEAP, NOINIT, READWRITE, ALIGN=
3
   58 00000000         __heap_base
   59 00000000         Heap_Mem
                               SPACE            Heap_Size
   60 00000000         __heap_limit
   61 00000000         
   62 00000000         
   63 00000000                 PRESERVE8
   64 00000000                 THUMB
   65 00000000         
   66 00000000         
   67 00000000         ; Vector Table Mapped to Address 0 at Reset
   68 00000000                 AREA             RESET, DATA, READONLY
   69 00000000                 EXPORT           __Vectors
   70 00000000                 EXPORT           __Vectors_End
   71 00000000                 EXPORT           __Vectors_Size
   72 00000000         
   73 00000000 00000000 
                       __Vectors
                               DCD              __initial_sp ; Top of Stack
   74 00000004 00000000        DCD              Reset_Handler ; Reset Handler
   75 00000008 00000000        DCD              NMI_Handler ; NMI Handler
   76 0000000C 00000000        DCD              HardFault_Handler ; Hard Fault 
                                                            Handler
   77 00000010 00000000        DCD              0           ; Reserved
   78 00000014 00000000        DCD              0           ; Reserved
   79 00000018 00000000        DCD              0           ; Reserved
   80 0000001C 00000000        DCD              0           ; Reserved
   81 00000020 00000000        DCD              0           ; Reserved
   82 00000024 00000000        DCD              0           ; Reserved
   83 00000028 00000000        DCD              0           ; Reserved
   84 0000002C 00000000        DCD              SVC_Handler ; SVCall Handler
   85 00000030 00000000        DCD              0           ; Reserved
   86 00000034 00000000        DCD              0           ; Reserved
   87 00000038 00000000        DCD              PendSV_Handler ; PendSV Handler
                                                            
   88 0000003C 00000000        DCD              SysTick_Handler 
                                                            ; SysTick Handler



ARM Macro Assembler    Page 3 


   89 00000040         
   90 00000040         ; External Interrupts
   91 00000040 00000000        DCD              0           ; 0Reserved
   92 00000044 00000000        DCD              0           ; 1Reserved
   93 00000048 00000000        DCD              RTC_IRQHandler ; 2RTC
   94 0000004C 00000000        DCD              FLASH_IRQHandler ; 3FLASH
   95 00000050 00000000        DCD              RCC_IRQHandler ; 4RCC
   96 00000054 00000000        DCD              EXTI0_1_IRQHandler ; 5EXTI Line
                                                             0 and 1
   97 00000058 00000000        DCD              EXTI2_3_IRQHandler ; 6EXTI Line
                                                             2 and 3
   98 0000005C 00000000        DCD              EXTI4_15_IRQHandler ; 7EXTI Lin
                                                            e 4 to 15
   99 00000060 00000000        DCD              TK_IRQHandler ; 8TK 
  100 00000064 00000000        DCD              0           ; 9Reserved
  101 00000068 00000000        DCD              0           ; 10Reserved
  102 0000006C 00000000        DCD              0           ; 11Reserved 
  103 00000070 00000000        DCD              ADC_COMP_IRQHandler 
                                                            ; 12ADC&COMP 
  104 00000074 00000000        DCD              TIM1_BRK_UP_TRG_COM_IRQHandler 
                                                            ; 13TIM1 Break, Upd
                                                            ate, Trigger and Co
                                                            mmutation
  105 00000078 00000000        DCD              TIM1_CC_IRQHandler ; 14TIM1 Cap
                                                            ture Compare
  106 0000007C 00000000        DCD              0           ; 15Reserved 
  107 00000080 00000000        DCD              0           ; 16Reserved
  108 00000084 00000000        DCD              0           ; 17Reserved
  109 00000088 00000000        DCD              0           ; 18Reserved 
  110 0000008C 00000000        DCD              TIM14_IRQHandler ; 19TIM14
  111 00000090 00000000        DCD              0           ; 20Reserved 
  112 00000094 00000000        DCD              0           ; 21Reserved
  113 00000098 00000000        DCD              0           ; 22Reserved
  114 0000009C 00000000        DCD              I2C1_IRQHandler ; 23I2C1
  115 000000A0 00000000        DCD              0           ; 24Reserved 
  116 000000A4 00000000        DCD              SPI1_IRQHandler ; 25SPI1
  117 000000A8 00000000        DCD              0           ; 26Reserved
  118 000000AC 00000000        DCD              0           ; 27Reserved
  119 000000B0 00000000        DCD              0           ; 28Reserved
  120 000000B4 00000000        DCD              UART3_IRQHandler ; 29UART3
  121 000000B8 00000000        DCD              UART2_IRQHandler ; 30UART2
  122 000000BC 00000000        DCD              UART1_IRQHandler ; 31UART1
  123 000000C0         __Vectors_End
  124 000000C0         
  125 000000C0 000000C0 
                       __Vectors_Size
                               EQU              __Vectors_End - __Vectors
  126 000000C0         
  127 000000C0                 AREA             |.text|, CODE, READONLY
  128 00000000         
  129 00000000         
  130 00000000         ; Reset Handler
  131 00000000         
  132 00000000         Reset_Handler
                               PROC
  133 00000000                 EXPORT           Reset_Handler             [WEAK
]
  134 00000000                 IMPORT           SystemInit
  135 00000000                 IMPORT           __main



ARM Macro Assembler    Page 4 


  136 00000000 4804            LDR              R0, =SystemInit
  137 00000002 4780            BLX              R0
  138 00000004 4804            LDR              R0, =__main
  139 00000006 4700            BX               R0
  140 00000008                 ENDP
  141 00000008         
  142 00000008         
  143 00000008         ; Dummy Exception Handlers (infinite loops which can be 
                       modified)
  144 00000008         
  145 00000008         NMI_Handler
                               PROC
  146 00000008                 EXPORT           NMI_Handler               [WEAK
]
  147 00000008 E7FE            B                .
  148 0000000A                 ENDP
  150 0000000A         HardFault_Handler
                               PROC
  151 0000000A                 EXPORT           HardFault_Handler         [WEAK
]
  152 0000000A E7FE            B                .
  153 0000000C                 ENDP
  154 0000000C         SVC_Handler
                               PROC
  155 0000000C                 EXPORT           SVC_Handler               [WEAK
]
  156 0000000C E7FE            B                .
  157 0000000E                 ENDP
  158 0000000E         PendSV_Handler
                               PROC
  159 0000000E                 EXPORT           PendSV_Handler            [WEAK
]
  160 0000000E E7FE            B                .
  161 00000010                 ENDP
  162 00000010         SysTick_Handler
                               PROC
  163 00000010                 EXPORT           SysTick_Handler           [WEAK
]
  164 00000010 E7FE            B                .
  165 00000012                 ENDP
  166 00000012         
  167 00000012         Default_Handler
                               PROC
  168 00000012         
  169 00000012                 EXPORT           RTC_IRQHandler                 
[WEAK]
  170 00000012                 EXPORT           FLASH_IRQHandler               
[WEAK]
  171 00000012                 EXPORT           RCC_IRQHandler                 
[WEAK]
  172 00000012                 EXPORT           EXTI0_1_IRQHandler             
[WEAK]
  173 00000012                 EXPORT           EXTI2_3_IRQHandler             
[WEAK]
  174 00000012                 EXPORT           EXTI4_15_IRQHandler            
[WEAK]
  175 00000012                 EXPORT           TK_IRQHandler                  
[WEAK]
  176 00000012                 EXPORT           ADC_COMP_IRQHandler            



ARM Macro Assembler    Page 5 


[WEAK]
  177 00000012                 EXPORT           TIM1_BRK_UP_TRG_COM_IRQHandler 
[WEAK]
  178 00000012                 EXPORT           TIM1_CC_IRQHandler             
[WEAK]
  179 00000012                 EXPORT           TIM14_IRQHandler               
[WEAK]
  180 00000012                 EXPORT           I2C1_IRQHandler                
[WEAK]
  181 00000012                 EXPORT           SPI1_IRQHandler                
[WEAK]
  182 00000012                 EXPORT           UART3_IRQHandler               
[WEAK]
  183 00000012                 EXPORT           UART2_IRQHandler               
[WEAK]
  184 00000012                 EXPORT           UART1_IRQHandler               
[WEAK]
  185 00000012         
  186 00000012         RTC_IRQHandler
  187 00000012         FLASH_IRQHandler
  188 00000012         RCC_IRQHandler
  189 00000012         EXTI0_1_IRQHandler
  190 00000012         EXTI2_3_IRQHandler
  191 00000012         EXTI4_15_IRQHandler
  192 00000012         TK_IRQHandler
  193 00000012         ADC_COMP_IRQHandler
  194 00000012         TIM1_BRK_UP_TRG_COM_IRQHandler
  195 00000012         TIM1_CC_IRQHandler
  196 00000012         TIM14_IRQHandler
  197 00000012         I2C1_IRQHandler
  198 00000012         SPI1_IRQHandler
  199 00000012         UART3_IRQHandler
  200 00000012         UART2_IRQHandler
  201 00000012         UART1_IRQHandler
  202 00000012 E7FE            B                .
  203 00000014                 ENDP
  204 00000014         
  205 00000014                 ALIGN
  206 00000014         
  207 00000014         ; User Initial Stack & Heap
  208 00000014         
  209 00000014                 IF               :DEF:__MICROLIB
  210 00000014         
  211 00000014                 EXPORT           __initial_sp
  212 00000014                 EXPORT           __heap_base
  213 00000014                 EXPORT           __heap_limit
  214 00000014         
  215 00000014                 ELSE
  230                          ENDIF
  231 00000014         
  232 00000014                 END
              00000000 
              00000000 
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M0+ --apcs=inter
work --depend=.\output\startup_py32t020xx.d -o.\output\startup_py32t020xx.o -I.
\RTE\_PY32T020 -ID:\keill\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -ID:\kei
ll\Arm\Packs\Puya\PY32T0xx_DFP\0.0.6\Drivers\CMSIS\Device\PY\PY32T0xx\Include -
-predefine="__EVAL SETA 1" --predefine="__MICROLIB SETA 1" --predefine="__UVISI
ON_VERSION SETA 528" --predefine="_RTE_ SETA 1" --predefine="PY32T020x6 SETA 1"



ARM Macro Assembler    Page 6 


 --list=.\output\startup_py32t020xx.lst startup_py32t020xx.s



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

STACK 00000000

Symbol: STACK
   Definitions
      At line 46 in file startup_py32t020xx.s
   Uses
      None
Comment: STACK unused
Stack_Mem 00000000

Symbol: Stack_Mem
   Definitions
      At line 47 in file startup_py32t020xx.s
   Uses
      None
Comment: Stack_Mem unused
__initial_sp 00000200

Symbol: __initial_sp
   Definitions
      At line 48 in file startup_py32t020xx.s
   Uses
      At line 73 in file startup_py32t020xx.s
      At line 211 in file startup_py32t020xx.s

3 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

HEAP 00000000

Symbol: HEAP
   Definitions
      At line 57 in file startup_py32t020xx.s
   Uses
      None
Comment: HEAP unused
Heap_Mem 00000000

Symbol: Heap_Mem
   Definitions
      At line 59 in file startup_py32t020xx.s
   Uses
      None
Comment: Heap_Mem unused
__heap_base 00000000

Symbol: __heap_base
   Definitions
      At line 58 in file startup_py32t020xx.s
   Uses
      At line 212 in file startup_py32t020xx.s
Comment: __heap_base used once
__heap_limit 00000000

Symbol: __heap_limit
   Definitions
      At line 60 in file startup_py32t020xx.s
   Uses
      At line 213 in file startup_py32t020xx.s
Comment: __heap_limit used once
4 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

RESET 00000000

Symbol: RESET
   Definitions
      At line 68 in file startup_py32t020xx.s
   Uses
      None
Comment: RESET unused
__Vectors 00000000

Symbol: __Vectors
   Definitions
      At line 73 in file startup_py32t020xx.s
   Uses
      At line 69 in file startup_py32t020xx.s
      At line 125 in file startup_py32t020xx.s

__Vectors_End 000000C0

Symbol: __Vectors_End
   Definitions
      At line 123 in file startup_py32t020xx.s
   Uses
      At line 70 in file startup_py32t020xx.s
      At line 125 in file startup_py32t020xx.s

3 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

.text 00000000

Symbol: .text
   Definitions
      At line 127 in file startup_py32t020xx.s
   Uses
      None
Comment: .text unused
ADC_COMP_IRQHandler 00000012

Symbol: ADC_COMP_IRQHandler
   Definitions
      At line 193 in file startup_py32t020xx.s
   Uses
      At line 103 in file startup_py32t020xx.s
      At line 176 in file startup_py32t020xx.s

Default_Handler 00000012

Symbol: Default_Handler
   Definitions
      At line 167 in file startup_py32t020xx.s
   Uses
      None
Comment: Default_Handler unused
EXTI0_1_IRQHandler 00000012

Symbol: EXTI0_1_IRQHandler
   Definitions
      At line 189 in file startup_py32t020xx.s
   Uses
      At line 96 in file startup_py32t020xx.s
      At line 172 in file startup_py32t020xx.s

EXTI2_3_IRQHandler 00000012

Symbol: EXTI2_3_IRQHandler
   Definitions
      At line 190 in file startup_py32t020xx.s
   Uses
      At line 97 in file startup_py32t020xx.s
      At line 173 in file startup_py32t020xx.s

EXTI4_15_IRQHandler 00000012

Symbol: EXTI4_15_IRQHandler
   Definitions
      At line 191 in file startup_py32t020xx.s
   Uses
      At line 98 in file startup_py32t020xx.s
      At line 174 in file startup_py32t020xx.s

FLASH_IRQHandler 00000012

Symbol: FLASH_IRQHandler
   Definitions
      At line 187 in file startup_py32t020xx.s
   Uses
      At line 94 in file startup_py32t020xx.s



ARM Macro Assembler    Page 2 Alphabetic symbol ordering
Relocatable symbols

      At line 170 in file startup_py32t020xx.s

HardFault_Handler 0000000A

Symbol: HardFault_Handler
   Definitions
      At line 150 in file startup_py32t020xx.s
   Uses
      At line 76 in file startup_py32t020xx.s
      At line 151 in file startup_py32t020xx.s

I2C1_IRQHandler 00000012

Symbol: I2C1_IRQHandler
   Definitions
      At line 197 in file startup_py32t020xx.s
   Uses
      At line 114 in file startup_py32t020xx.s
      At line 180 in file startup_py32t020xx.s

NMI_Handler 00000008

Symbol: NMI_Handler
   Definitions
      At line 145 in file startup_py32t020xx.s
   Uses
      At line 75 in file startup_py32t020xx.s
      At line 146 in file startup_py32t020xx.s

PendSV_Handler 0000000E

Symbol: PendSV_Handler
   Definitions
      At line 158 in file startup_py32t020xx.s
   Uses
      At line 87 in file startup_py32t020xx.s
      At line 159 in file startup_py32t020xx.s

RCC_IRQHandler 00000012

Symbol: RCC_IRQHandler
   Definitions
      At line 188 in file startup_py32t020xx.s
   Uses
      At line 95 in file startup_py32t020xx.s
      At line 171 in file startup_py32t020xx.s

RTC_IRQHandler 00000012

Symbol: RTC_IRQHandler
   Definitions
      At line 186 in file startup_py32t020xx.s
   Uses
      At line 93 in file startup_py32t020xx.s
      At line 169 in file startup_py32t020xx.s

Reset_Handler 00000000

Symbol: Reset_Handler



ARM Macro Assembler    Page 3 Alphabetic symbol ordering
Relocatable symbols

   Definitions
      At line 132 in file startup_py32t020xx.s
   Uses
      At line 74 in file startup_py32t020xx.s
      At line 133 in file startup_py32t020xx.s

SPI1_IRQHandler 00000012

Symbol: SPI1_IRQHandler
   Definitions
      At line 198 in file startup_py32t020xx.s
   Uses
      At line 116 in file startup_py32t020xx.s
      At line 181 in file startup_py32t020xx.s

SVC_Handler 0000000C

Symbol: SVC_Handler
   Definitions
      At line 154 in file startup_py32t020xx.s
   Uses
      At line 84 in file startup_py32t020xx.s
      At line 155 in file startup_py32t020xx.s

SysTick_Handler 00000010

Symbol: SysTick_Handler
   Definitions
      At line 162 in file startup_py32t020xx.s
   Uses
      At line 88 in file startup_py32t020xx.s
      At line 163 in file startup_py32t020xx.s

TIM14_IRQHandler 00000012

Symbol: TIM14_IRQHandler
   Definitions
      At line 196 in file startup_py32t020xx.s
   Uses
      At line 110 in file startup_py32t020xx.s
      At line 179 in file startup_py32t020xx.s

TIM1_BRK_UP_TRG_COM_IRQHandler 00000012

Symbol: TIM1_BRK_UP_TRG_COM_IRQHandler
   Definitions
      At line 194 in file startup_py32t020xx.s
   Uses
      At line 104 in file startup_py32t020xx.s
      At line 177 in file startup_py32t020xx.s

TIM1_CC_IRQHandler 00000012

Symbol: TIM1_CC_IRQHandler
   Definitions
      At line 195 in file startup_py32t020xx.s
   Uses
      At line 105 in file startup_py32t020xx.s
      At line 178 in file startup_py32t020xx.s



ARM Macro Assembler    Page 4 Alphabetic symbol ordering
Relocatable symbols


TK_IRQHandler 00000012

Symbol: TK_IRQHandler
   Definitions
      At line 192 in file startup_py32t020xx.s
   Uses
      At line 99 in file startup_py32t020xx.s
      At line 175 in file startup_py32t020xx.s

UART1_IRQHandler 00000012

Symbol: UART1_IRQHandler
   Definitions
      At line 201 in file startup_py32t020xx.s
   Uses
      At line 122 in file startup_py32t020xx.s
      At line 184 in file startup_py32t020xx.s

UART2_IRQHandler 00000012

Symbol: UART2_IRQHandler
   Definitions
      At line 200 in file startup_py32t020xx.s
   Uses
      At line 121 in file startup_py32t020xx.s
      At line 183 in file startup_py32t020xx.s

UART3_IRQHandler 00000012

Symbol: UART3_IRQHandler
   Definitions
      At line 199 in file startup_py32t020xx.s
   Uses
      At line 120 in file startup_py32t020xx.s
      At line 182 in file startup_py32t020xx.s

24 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Absolute symbols

Heap_Size 00000000

Symbol: Heap_Size
   Definitions
      At line 55 in file startup_py32t020xx.s
   Uses
      At line 59 in file startup_py32t020xx.s
Comment: Heap_Size used once
Stack_Size 00000200

Symbol: Stack_Size
   Definitions
      At line 44 in file startup_py32t020xx.s
   Uses
      At line 47 in file startup_py32t020xx.s
Comment: Stack_Size used once
__Vectors_Size 000000C0

Symbol: __Vectors_Size
   Definitions
      At line 125 in file startup_py32t020xx.s
   Uses
      At line 71 in file startup_py32t020xx.s
Comment: __Vectors_Size used once
3 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
External symbols

SystemInit 00000000

Symbol: SystemInit
   Definitions
      At line 134 in file startup_py32t020xx.s
   Uses
      At line 136 in file startup_py32t020xx.s
Comment: SystemInit used once
__main 00000000

Symbol: __main
   Definitions
      At line 135 in file startup_py32t020xx.s
   Uses
      At line 138 in file startup_py32t020xx.s
Comment: __main used once
2 symbols
376 symbols in table
