学习STM32F769DK-OTA例程之APP中断向量表重映射

2019-04-17

【小记】

  APP的IAR工程中的中断向量表偏移是在系统库中的 __iar_program_start 处实现的

  启动代码 stm32f769xx.s

 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 2 ;;
 3 ;; Default interrupt handlers.
 4 ;;
 5         THUMB
 6         PUBWEAK Reset_Handler
 7         SECTION .text:CODE:NOROOT:REORDER(2)
 8 Reset_Handler
 9 
10         LDR     R0, =SystemInit
11         BLX     R0
12         LDR     R0, =__iar_program_start
13         BX      R0
14 
15         PUBWEAK NMI_Handler
16         SECTION .text:CODE:NOROOT:REORDER(1)

  经调试看到 __iar_program_start 的反汇编

 1 Reset_Handler:
 2     0x80385d0: 0x4801         LDR.N     R0, [PC, #0x4]          ; SystemInit
 3         BLX     R0
 4     0x80385d2: 0x4780         BLX       R0
 5         LDR     R0, =__iar_program_start
 6     0x80385d4: 0x4801         LDR.N     R0, [PC, #0x4]          ; __iar_program_start
 7         BX      R0
 8     0x80385d6: 0x4700         BX        R0
 9         SECTION .text:CODE:NOROOT:REORDER(1)
10     0x80385d8: 0x0802586d     DC32      SystemInit
11         SECTION .text:CODE:NOROOT:REORDER(1)
12     0x80385dc: 0x080385f9     DC32      __iar_program_start
13     0x80385e0: 0x70636573     DC32      0x70636573 (1885562227)
14     0x80385e4: 0x72363532     DC32      0x72363532 (1916155186)
15     0x80385e8: 0x00000031     DC32      0x31 (49)
16     0x80385ec: 0x72617453     DC32      0x72617453 (1918989395)
17     0x80385f0: 0x00000074     DC32      0x74 (116)
18     0x80385f4: 0x00544f49     DC32      0x544f49 (5525321)
19 __iar_program_start:
20     0x80385f8: 0xf3af 0x8000  NOP.W
21     0x80385fc: 0xf7ff 0xff90  BL        __iar_init_vfp          ; 0x8038520
22     0x8038600: 0xf7ff 0xffb0  BL        ?main                   ; 0x8038564
23 APBPrescTable:
24     0x8038604: 0x00000000     DC32      0x0 (0)
25     0x8038608: 0x04030201     DC32      0x4030201 (67305985)
26     0x803860c: 0x002e0000     DC32      0x2e0000 (3014656)
27     0x8038610: 0x0043         DC16      67                      ; 'C.'
28         B WWDG_IRQHandler
 1 __iar_init_vfp:
 2     0x8038520: 0xf64e 0x5188  MOVW      R1, #60808              ; 0xed88
 3     0x8038524: 0xf2ce 0x0100  MOVT      R1, #57344              ; 0xe000
 4     0x8038528: 0x6808         LDR       R0, [R1]
 5     0x803852a: 0xf440 0x0070  ORR.W     R0, R0, #15728640       ; 0xf00000
 6     0x803852e: 0x6008         STR       R0, [R1]
 7     0x8038530: 0xf3bf 0x8f4f  DSB
 8     0x8038534: 0xf3bf 0x8f6f  ISB
 9     0x8038538: 0xf04f 0x7000  MOV.W     R0, #33554432           ; 0x2000000
10     0x803853c: 0xeee1 0x0a10  VMSR      FPSCR, R0
11     0x8038540: 0x4770         BX        LR
12     0x8038542: 0x0000         MOVS      R0, R0
13 Region$$Table$$Base:
14     0x8038544: 0xfffdb3e7     DC32      0xfffdb3e7 (-150553)
15     0x8038548: 0x000220dc     DC32      0x220dc (139484)
16     0x803854c: 0x20000204     DC32      xStart
17     0x8038550: 0x00000000     DC32      0x0 (0)
18     0x8038554: 0xfffdb2b7     DC32      0xfffdb2b7 (-150857)
19     0x8038558: 0x00000262     DC32      0x262 (610)
20     0x803855c: 0x000001a2     DC32      0x1a2 (418)
21     0x8038560: 0x20000000     DC32      global_hooks
22 ?main:
23 Region$$Table$$Limit:
24 __cmain:
25     0x8038564: 0xf000 0xf80d  BL        __low_level_init        ; 0x8038582
26     0x8038568: 0x2800         CMP       R0, #0
27     0x803856a: 0xd001         BEQ.N     _call_main              ; 0x8038570
28     0x803856c: 0xf7ff 0xffb2  BL        __iar_data_init3        ; 0x80384d4

 

posted @ 2019-04-17 15:59  壹点灵异  阅读(973)  评论(0编辑  收藏  举报