精品国产人成在线_亚洲高清无码在线观看_国产在线视频国产永久2021_国产AV综合第一页一个的一区免费影院黑人_最近中文字幕MV高清在线视频

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
會員中心
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示

基于IAR的Cortex-M/R內核程序啟動流程

技術讓夢想更偉大 ? 來源:CSDN ? 2023-02-14 16:57 ? 次閱讀

無論是 ARMCC 還是 IAR 都需要遵循內核的規定。區別主要在于初始化的個函數接口不同!

啟動流程

嵌入式應用程序的執行,分為三個階段:

初始化階段

執行階段

退出階段

初始化階段

在系統啟動期間,進入 main() 函數之前執行初始化序列。 初始化序列處理目標硬件和 C/C++ 運行環境所需的初始化。初始化是在應用程序(CPU 復位)啟動但是進入用戶的 main() 函數之前來執行的。初始化階段可以簡單地分為:

硬件初始化,通常至少初始化堆棧指針。??硬件初始化通常在系統啟動代碼 cstartup.s 中執行,如果需要,還可以通過用戶提供的額外的低級接口(__low_level_init)來執行用戶自己的代碼。 它可能包括重置/啟動其余硬件,設置 CPU 等,以準備軟件 C/C++ 系統初始化。

14c3d074-ac42-11ed-bfe3-dac502259ad0.jpg

當 CPU 復位時,程序將從系統啟動代碼中的程序入口標簽__iar_program_start處開始執行。

堆棧指針初始化為 CSTACK 塊的末尾

For Arm7/9/11, Cortex-A, and Cortex-R devices, exception stack pointers are initialized to the end of each corresponding section. 對于 Arm7/9/11、Cortex-A 和Cortex-R 器件,異常堆棧指針初始化為每個相應部分的末尾

The function __low_level_init is called if you defined it, giving the application a chance to perform early initializations.如果用戶定義了函數__low_level_init,則為應用程序提供執行早期初始化的機會。

C/C++ 軟件系統初始化??通常,此步操作確保在調用 main 函數之前,每個全局(靜態鏈接)的 C/C++ 符號都會收到其正確的初始化值。

14d368ae-ac42-11ed-bfe3-dac502259ad0.jpg

Static and global variables are initialized. That is, zero-initialized variables are cleared and the values of other initialized variables are copied from ROM to RAM memory. This step is skipped if low_level_init returns zero. 靜態和全局變量初始化。 也就是說,清零初始化為零的變量,并將其他初始化變量的值從 ROM 復制到 RAM 存儲器。

如果
low_level_init 返回零,則跳過此步驟。??In Standard C, all static variables—variables that are allocated at a fixed memory address—must be initialized by the runtime system to a known value at application startup. This value is either an explicit value assigned to the variable, or if no value is given, it is cleared to zero. In the compiler, there are exceptions to this rule, for example variables declared no_init, which are not initialized at all.在標準 C 中,所有靜態變量 - 在固定內存地址分配的變量 - 必須由運行時系統初始化為應用程序啟動時的已知值。

此值是分配給變量的顯式值,或者如果沒有給出值,則將其清零。

在編譯器中,此規則有例外,例如聲明為
no_init 的變量,它們根本沒有初始化。

The compiler generates a specific type of section for each type of variable initialization:編譯器為每種類型的變量初始化生成特定類型的節:

14e230c8-ac42-11ed-bfe3-dac502259ad0.png

Static C++ objects are constructed 構造靜態 C++ 對象

The main function is called, which starts the application. 調用主函數,啟動應用程序。

應用程序初始化覺就是用戶自己的程序部分。這完全取決于用戶的應用程序。 它可以包括設置 RTOS 內核并啟動 RTOS 驅動的應用程序的初始任務。 對于裸機應用程序,它可以包括設置各種中斷,初始化通信,初始化設備等。

對于基于 ROM/flash 的系統,常量和函數已經放在 ROM 中。 放置在 RAM 中的所有符號必須在調用 main 函數之前初始化。鏈接器已將可用RAM劃分為變量,堆棧,堆等的不同區域。

以下序列說明簡要概述了初始化的不同階段。

當應用程序啟動時,系統啟動代碼首先執行硬件初始化,例如初始化棧頂指針以指向預定義堆棧區域的末尾:

14f36d16-ac42-11ed-bfe3-dac502259ad0.jpg

然后,清除應該零初始化的存儲器,換句話說,用零填充:

1513b0da-ac42-11ed-bfe3-dac502259ad0.jpg

通常,這些數據指的是那些初始化為零的數據; 例如,變量聲明為int i = 0;

對于已經初始化的數據,例如,聲明的數據int i = 6;,初始化器從ROM復制到RAM:

1524b696-ac42-11ed-bfe3-dac502259ad0.jpg

最終,main()函數被調用:

1534c6bc-ac42-11ed-bfe3-dac502259ad0.jpg

執行階段

The software of an embedded application is typically implemented as a loop which is either interrupt-driven or uses polling for controlling external interaction or internal events. For an interrupt-driven system, the interrupts are typically initialized at the beginning of the main function.

嵌入式應用程序的軟件通常實現為循環,該循環可以是中斷驅動的,也可以使用輪詢來控制外部交互或內部事件。 對于中斷驅動的系統,中斷通常在主函數的開頭初始化。

In a system with real-time behavior and where responsiveness is critical, a multi-task system might be required. This means that your application software should be complemented with a real-time operating system. In this case, the RTOS and the different tasks must also be initialized at the beginning of the main function.

在具有實時行為且響應性至關重要的系統中,可能需要多任務系統。 這意味著您的應用程序軟件應該配備實時操作系統。 在這種情況下,還必須在main函數的開頭初始化RTOS和不同的任務。

退出階段

通常,嵌入式應用程序的執行永遠不會結束。 如果推出了,則必須定義正確的結束行為。

要以受控方式終止應用程序,請調用標準C庫函數之一 exit,_Exit,quick_exit 或 abort,或從main 返回。 如果從main 返回,則自動執行 exit 函數,這意味著調用靜態和全局變量的 C++ 析構函數(僅限C ++)并關閉所有打開的文件。

當然,如果程序邏輯不正確,應用程序可能會以不受控制的異常方式終止 - 系統崩潰。

154bed06-ac42-11ed-bfe3-dac502259ad0.jpg

應用程序可以通過兩種不同方式正常終止:

Return from the main function

Call the exit function.

因為 C 標準聲明這兩個方法應該是等價的,所以如果main()函數返回,系統啟動代碼會調用exit() 函數。傳遞給exit()函數的參數是main()的返回值。默認退出函數用C語言編寫。它調用一個小的匯編程序函數_exit,它將:

Call functions registered to be executed when the application ends. This includes C++ destructors for static and global variables, and functions registered with the standard function atexit. See also Setting up the atexit limit, page 110.

Close all open files

Call __exit

When __exit is reached, stop the system.

應用程序也可以通過調用 abort,_Exit 或 quick_exit 函數退出。中止函數只是調用__exit來暫停系統,并且不執行任何類型的清理。

The _Exit function is equivalent to the abort function, except for the fact that _Exit takes an argument for passing exit status information._Exit函數等同于 abort 函數,事實上,_Exit接受一個參數來傳遞退出狀態信息。

The quick_exit function is equivalent to the _Exit function, except that it calls each function passed to at_quick_exit before calling __exit. quick_exit函數等同于__Exit函數,只是它在調用__exit之前會刁艷紅每個傳遞給_quick_exit的函數。

如果您希望應用程序在退出時執行任何額外操作,例如重置系統(如果使用atexit是不夠的),您可以編寫自己的__exit(int)函數實現。

啟動相關函數

在基于 ARM 的啟動流程中,我們介紹了各啟動相關的函數全部位于 ARM 編譯套件的庫文件中。IAR 則直接提供了相關函數的源代碼,源碼使用匯編語言編寫!

處理啟動和終止的代碼位于源文件cstartup.s,cmain.s,cexit.s中,這些文件位于armsrclibarm 或 armsrclib humb目錄中(針對 Cortex-M的 thumb 指令)和位于armsrclib untime目錄中的low_level_init.c。其中,armsrclibarm下面的文件如下圖所示:

155f7df8-ac42-11ed-bfe3-dac502259ad0.png

關于 Thumb 指令的這里我們暫不說明

前面我們已經分析過,第一個需要調用的函數是__iar_program_start,該函數就位于cstartup.s這個文件中!

啟動示例分析

下面我們以STM32F373CB片子為例,看看其在 IAR 中調試時的匯編代碼。

直接進調試模式,注意:需要將 設置 -> 調試器 -> Run to main 去掉,如下圖:

15759a70-ac42-11ed-bfe3-dac502259ad0.png

然后 直接進入調試模式,首先看看終端向量表部分:

158b5e3c-ac42-11ed-bfe3-dac502259ad0.png

符合前面文章介紹的 Cortex-M/R內核的規定!接著我們看到的就是復位中斷的服務函數

  0x8003558: 0x04000401   DC32   0x4000401 (67109889)
  0x800355c: 0x08000c77   DC32   USER_DLT645ReqAddr
  0x8003560: 0x00000000   DC32   0x0 (0)
  0x8003564: 0x04a01101   DC32   0x4a01101 (77598977)
  0x8003568: 0x08000ca1   DC32   USER_DLT645ReqUpGrade
  0x800356c: 0x00000000   DC32   0x0 (0)
    LDR   R0, =SystemInit
Reset_Handler:
  0x8003570: 0x4801     LDR.N   R0, [PC, #0x4]      ; SystemInit
    BLX   R0
  0x8003572: 0x4780     BLX    R0      ; 這里跳轉到 SystemInit 這是ST提供的
    LDR   R0, =__iar_program_start
  0x8003574: 0x4801     LDR.N   R0, [PC, #0x4]      ; __iar_program_start
    BX   R0
  0x8003576: 0x4700     BX    R0      ; 這里跳轉到 __iar_program_start
    SECTION .text:CODE:REORDER(1)
  0x8003578: 0x08003195   DC32   SystemInit
    SECTION .text:CODE:REORDER(1)
  0x800357c: 0x08003581   DC32   __iar_program_start
__iar_program_start:
  0x8003580: 0xf3af 0x8000 NOP.W
  0x8003584: 0xf3af 0x8000 NOP.W
  0x8003588: 0xf7ff 0xffc2 BL    ?main          ; 0x8003510 重點就在這個函數,
  0x800358c: 0x11111111   DC32   0x11111111 (286331153)
  0x8003590: 0x00001111   DC32   0x1111 (4369)
  0x8003594: 0x90      DC8    144           ; '.'
  0x8003595: 0x00      DC8    0            ; '.'
  0x8003596: 0x00      DC8    0            ; '.'
  0x8003597: 0x00      DC8    0            ; '.'
    B NMI_Handler
  0x8003598: 0xf7ff 0xbf6a B.W    NMI_Handler       ; 0x8003470
   ; 后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!

從上面的匯編代碼可以看出,__iar_program_start 跳轉到了一個叫做?main的符號處,代碼如下:

  0x80034c8: 0xb510     PUSH    {R4, LR}
  0x80034ca: 0x4907     LDR.N   R1, [PC, #0x1c]     ; 0x8 (8)
  0x80034cc: 0x4479     ADD    R1, R1, PC
  0x80034ce: 0x3118     ADDS   R1, R1, #24       ; 0x18
  0x80034d0: 0x4c06     LDR.N   R4, [PC, #0x18]     ; 0x24 (36)
  0x80034d2: 0x447c     ADD    R4, R4, PC
  0x80034d4: 0x3416     ADDS   R4, R4, #22       ; 0x16
  0x80034d6: 0xe004     B.N    0x80034e2
  0x80034d8: 0x680a     LDR    R2, [R1]
  0x80034da: 0x1d08     ADDS   R0, R1, #4
  0x80034dc: 0x4411     ADD    R1, R1, R2
  0x80034de: 0x4788     BLX    R1
  0x80034e0: 0x4601     MOV    R1, R0
  0x80034e2: 0x42a1     CMP    R1, R4
  0x80034e4: 0xd1f8     BNE.N   0x80034d8
  0x80034e6: 0xbd10     POP    {R4, PC}
  0x80034e8: 0x00000008   DC32   0x8 (8)
  0x80034ec: 0x00000024   DC32   0x24 (36)
Region$$Table$$Base:
  0x80034f0: 0xffffdc57   DC32   0xffffdc57 (-9129)
  0x80034f4: 0x0000085c   DC32   0x85c (2140)
  0x80034f8: 0x20000588   DC32   Uart1Info
  0x80034fc: 0x00000000   DC32   0x0 (0)
  0x8003500: 0xffffdadf   DC32   0xffffdadf (-9505)
  0x8003504: 0x000001b8   DC32   0x1b8 (440)
  0x8003508: 0x0000010c   DC32   0x10c (268)
  0x800350c: 0x20000000   DC32   UpGradeCtrl
?main:
Region$$Table$$Limit:
__cmain:
  0x8003510: 0xf000 0xf80d BL    __low_level_init     ; 0x800352e
  0x8003514: 0x2800     CMP    R0, #0
  0x8003516: 0xd001     BEQ.N   _call_main        ; 0x800351c
  0x8003518: 0xf7ff 0xffd6 BL    __iar_data_init3     ; 0x80034c8
_call_main:
  0x800351c: 0xf3af 0x8000 NOP.W
  0x8003520: 0x2000     MOVS   R0, #0
  0x8003522: 0xf3af 0x8000 NOP.W
  0x8003526: 0xf7ff 0xff2b BL    main           ; 0x8003380
_main:
  0x800352a: 0xf000 0xf802 BL    exit           ; 0x8003532
__low_level_init:
  0x800352e: 0x2001     MOVS   R0, #1
  0x8003530: 0x4770     BX    LR
exit:
  0x8003532: 0xf000 0xb801 B.W    _exit          ; 0x8003538
  0x8003536: 0x0000     MOVS   R0, R0
_exit:
  0x8003538: 0x4607     MOV    R7, R0
  0x800353a: 0x4638     MOV    R0, R7
  0x800353c: 0xf000 0xf802 BL    __exit          ; 0x8003544
  0x8003540: 0xe7fb     B.N    0x800353a
  0x8003542: 0x0000     MOVS   R0, R0
__exit:
  0x8003544: 0xb580     PUSH    {R7, LR}
  0x8003546: 0xf3af 0x8000 NOP.W
  0x800354a: 0x4a02     LDR.N   R2, [PC, #0x8]      ; 0x20026 (131110)
  0x800354c: 0x0011     MOVS   R1, R2
  0x800354e: 0x2018     MOVS   R0, #24         ; 0x18
  0x8003550: 0xbeab     BKPT   #0xab
  0x8003552: 0xe7fb     B.N    0x800354c
  0x8003554: 0x00020026   DC32   0x20026 (131110)
; 后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!后面的省略!

里面有詳細的函數調用關系!

啟動文件

目前,多數 MCU 廠商都提供一個啟動文件。當然,編程者也可以自己編寫啟動文件,具體編寫要求ARM的網站上都有相關文檔進行說明。

下面分析一下 STM32 啟動文件startup_stm32f37x.s,具體看里面的注釋。

;/******************** (C) COPYRIGHT 2012 STMicroelectronics ********************
;* File Name      : startup_stm32f37x.s
;* Author       : MCD Application Team
;* Version       : V1.0.0
;* Date        : 20-September-2012
;* Description     : STM32F37x 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.
;*            After Reset the Cortex-M4 processor is in Thread mode,
;*            priority is Privileged, and the Stack is set to Main.
;*******************************************************************************
;  @attention
; 
;  Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
;  You may not use this file except in compliance with the License.
;  You may obtain a copy of the License at:
; 
;     http://www.st.com/software_license_agreement_liberty_v2
; 
;  Unless required by applicable law or agreed to in writing, software 
;  distributed under the License is distributed on an "AS IS" BASIS, 
;  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;  See the License for the specific language governing permissions and
;  limitations under the License.
; 
;*******************************************************************************
;
;
; 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 CSTACKNOROOT(3)

    SECTION .intvecNOROOT(2)

    EXTERN  __iar_program_start
    EXTERN  SystemInit
    PUBLIC  __vector_table

    DATA
__vector_table
    DCD   sfe(CSTACK)
    DCD   Reset_Handler       ; Reset Handler

    DCD   NMI_Handler        ; NMI Handler
    DCD   HardFault_Handler     ; Hard Fault Handler
    DCD   MemManage_Handler     ; MPU Fault Handler
    DCD   BusFault_Handler      ; Bus Fault Handler
    DCD   UsageFault_Handler     ; Usage Fault Handler
    DCD   0             ; Reserved
    DCD   0             ; Reserved
    DCD   0             ; Reserved
    DCD   0             ; Reserved
    DCD   SVC_Handler        ; SVCall Handler
    DCD   DebugMon_Handler      ; Debug Monitor Handler
    DCD   0             ; Reserved
    DCD   PendSV_Handler       ; PendSV Handler
    DCD   SysTick_Handler      ; SysTick Handler

    ; External Interrupts
    DCD   WWDG_IRQHandler          ; Window WatchDog                    
    DCD   PVD_IRQHandler           ; PVD through EXTI Line detection            
    DCD   TAMPER_STAMP_IRQHandler      ; Tamper and TimeStamps through the EXTI line      
    DCD   RTC_WKUP_IRQHandler        ; RTC Wakeup through the EXTI line            
    DCD   FLASH_IRQHandler          ; FLASH                      
    DCD   RCC_IRQHandler           ; RCC                       
    DCD   EXTI0_IRQHandler          ; EXTI Line0                       
    DCD   EXTI1_IRQHandler          ; EXTI Line1                       
    DCD   EXTI2_TS_IRQHandler        ; EXTI Line2 and Touch Sense controller                       
    DCD   EXTI3_IRQHandler          ; EXTI Line3                       
    DCD   EXTI4_IRQHandler          ; EXTI Line4                       
    DCD   DMA1_Channel1_IRQHandler      ; DMA1 Channel 1                  
    DCD   DMA1_Channel2_IRQHandler      ; DMA1 Channel 2                 
    DCD   DMA1_Channel3_IRQHandler      ; DMA1 Channel 3                  
    DCD   DMA1_Channel4_IRQHandler      ; DMA1 Channel 4                  
    DCD   DMA1_Channel5_IRQHandler      ; DMA1 Channel 5                  
    DCD   DMA1_Channel6_IRQHandler      ; DMA1 Channel 6                  
    DCD   DMA1_Channel7_IRQHandler      ; DMA1 Channel 7                  
    DCD   ADC1_IRQHandler          ; ADC1              
    DCD   CAN1_TX_IRQHandler         ; CAN1 TX                        
    DCD   CAN1_RX0_IRQHandler        ; CAN1 RX0                        
    DCD   CAN1_RX1_IRQHandler        ; CAN1 RX1                        
    DCD   CAN1_SCE_IRQHandler        ; CAN1 SCE                        
    DCD   EXTI9_5_IRQHandler         ; External Line[9:5]s                  
    DCD   TIM15_IRQHandler          ; TIM15          
    DCD   TIM16_IRQHandler          ; TIM16         
    DCD   TIM17_IRQHandler          ; TIM17
    DCD   TIM18_DAC2_IRQHandler       ; TIM18 and DAC2                  
    DCD   TIM2_IRQHandler          ; TIM2                      
    DCD   TIM3_IRQHandler          ; TIM3                      
    DCD   TIM4_IRQHandler          ; TIM4                      
    DCD   I2C1_EV_IRQHandler         ; I2C1 Event                       
    DCD   I2C1_ER_IRQHandler         ; I2C1 Error                       
    DCD   I2C2_EV_IRQHandler         ; I2C2 Event                       
    DCD   I2C2_ER_IRQHandler         ; I2C2 Error                        
    DCD   SPI1_IRQHandler          ; SPI1                      
    DCD   SPI2_IRQHandler          ; SPI2                      
    DCD   USART1_IRQHandler         ; USART1                     
    DCD   USART2_IRQHandler         ; USART2                     
    DCD   USART3_IRQHandler         ; USART3                     
    DCD   EXTI15_10_IRQHandler        ; External Line[15:10]s                 
    DCD   RTC_Alarm_IRQHandler        ; RTC Alarm (A and B) through EXTI Line         
    DCD   CEC_IRQHandler           ; CEC            
    DCD   TIM12_IRQHandler          ; TIM12         
    DCD   TIM13_IRQHandler          ; TIM13         
    DCD   TIM14_IRQHandler          ; TIM14
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   TIM5_IRQHandler          ; TIM5                  
    DCD   SPI3_IRQHandler          ; SPI3  
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved                    
    DCD   TIM6_DAC1_IRQHandler        ; TIM6 and DAC1 Channel1 & channel2                      
    DCD   TIM7_IRQHandler          ; TIM7                       
    DCD   DMA2_Channel1_IRQHandler      ; DMA2 Channel 1                      
    DCD   DMA2_Channel2_IRQHandler      ; DMA2 Channel 2 
    DCD   DMA2_Channel3_IRQHandler      ; DMA2 Channel 3 
    DCD   DMA2_Channel4_IRQHandler      ; DMA2 Channel 4 
    DCD   DMA2_Channel5_IRQHandler      ; DMA2 Channel 5 
    DCD   SDADC1_IRQHandler         ; SDADC1                      
    DCD   SDADC2_IRQHandler         ; SDADC2                      
    DCD   SDADC3_IRQHandler         ; SDADC3                     
    DCD   COMP_IRQHandler          ; COMP  
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved
    DCD   0                 ; Reserved        
    DCD   USB_HP_IRQHandler         ; USB High Priority          
    DCD   USB_LP_IRQHandler         ; USB Low Priority                  
    DCD   USBWakeUp_IRQHandler        ; USB Wakeup  
    DCD   0                 ; Reserved                
    DCD   TIM19_IRQHandler          ; TIM19
    DCD   0                 ; Reserved   
    DCD   0                 ; Reserved
    DCD   FPU_IRQHandler           ; FPU   

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Default interrupt handlers.
;;
    THUMB
    PUBWEAK Reset_Handler
    SECTION .textREORDER(2)
Reset_Handler

    LDR   R0, =SystemInit
    BLX   R0
    LDR   R0, =__iar_program_start
    BX    R0

    PUBWEAK NMI_Handler
    SECTION .textREORDER(1)
NMI_Handler
    B NMI_Handler

    PUBWEAK HardFault_Handler
    SECTION .textREORDER(1)
HardFault_Handler
    B HardFault_Handler

    PUBWEAK MemManage_Handler
    SECTION .textREORDER(1)
MemManage_Handler
    B MemManage_Handler

    PUBWEAK BusFault_Handler
    SECTION .textREORDER(1)
BusFault_Handler
    B BusFault_Handler

    PUBWEAK UsageFault_Handler
    SECTION .textREORDER(1)
UsageFault_Handler
    B UsageFault_Handler

    PUBWEAK SVC_Handler
    SECTION .textREORDER(1)
SVC_Handler
    B SVC_Handler

    PUBWEAK DebugMon_Handler
    SECTION .textREORDER(1)
DebugMon_Handler
    B DebugMon_Handler

    PUBWEAK PendSV_Handler
    SECTION .textREORDER(1)
PendSV_Handler
    B PendSV_Handler

    PUBWEAK SysTick_Handler
    SECTION .textREORDER(1)
SysTick_Handler
    B SysTick_Handler

    PUBWEAK WWDG_IRQHandler
    SECTION .textREORDER(1)
WWDG_IRQHandler 
    B WWDG_IRQHandler

    PUBWEAK PVD_IRQHandler
    SECTION .textREORDER(1)
PVD_IRQHandler 
    B PVD_IRQHandler

    PUBWEAK TAMPER_STAMP_IRQHandler
    SECTION .textREORDER(1)  
TAMPER_STAMP_IRQHandler 
    B TAMPER_STAMP_IRQHandler

    PUBWEAK RTC_WKUP_IRQHandler
    SECTION .textREORDER(1) 
RTC_WKUP_IRQHandler 
    B RTC_WKUP_IRQHandler

    PUBWEAK FLASH_IRQHandler
    SECTION .textREORDER(1)
FLASH_IRQHandler 
    B FLASH_IRQHandler

    PUBWEAK RCC_IRQHandler
    SECTION .textREORDER(1)
RCC_IRQHandler 
    B RCC_IRQHandler

    PUBWEAK EXTI0_IRQHandler
    SECTION .textREORDER(1)
EXTI0_IRQHandler 
    B EXTI0_IRQHandler

    PUBWEAK EXTI1_IRQHandler
    SECTION .textREORDER(1)
EXTI1_IRQHandler 
    B EXTI1_IRQHandler

    PUBWEAK EXTI2_TS_IRQHandler
    SECTION .textREORDER(1)
EXTI2_TS_IRQHandler 
    B EXTI2_TS_IRQHandler

    PUBWEAK EXTI3_IRQHandler
    SECTION .textREORDER(1)
EXTI3_IRQHandler
    B EXTI3_IRQHandler

    PUBWEAK EXTI4_IRQHandler
    SECTION .textREORDER(1)  
EXTI4_IRQHandler 
    B EXTI4_IRQHandler

    PUBWEAK DMA1_Channel1_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel1_IRQHandler 
    B DMA1_Channel1_IRQHandler

    PUBWEAK DMA1_Channel2_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel2_IRQHandler 
    B DMA1_Channel2_IRQHandler

    PUBWEAK DMA1_Channel3_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel3_IRQHandler 
    B DMA1_Channel3_IRQHandler

    PUBWEAK DMA1_Channel4_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel4_IRQHandler 
    B DMA1_Channel4_IRQHandler

    PUBWEAK DMA1_Channel5_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel5_IRQHandler 
    B DMA1_Channel5_IRQHandler

    PUBWEAK DMA1_Channel6_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel6_IRQHandler 
    B DMA1_Channel6_IRQHandler

    PUBWEAK DMA1_Channel7_IRQHandler
    SECTION .textREORDER(1)  
DMA1_Channel7_IRQHandler 
    B DMA1_Channel7_IRQHandler

    PUBWEAK ADC1_IRQHandler
    SECTION .textREORDER(1)
ADC1_IRQHandler 
    B ADC1_IRQHandler

    PUBWEAK CAN1_TX_IRQHandler
    SECTION .textREORDER(1) 
CAN1_TX_IRQHandler 
    B CAN1_TX_IRQHandler

    PUBWEAK CAN1_RX0_IRQHandler
    SECTION .textREORDER(1) 
CAN1_RX0_IRQHandler 
    B CAN1_RX0_IRQHandler

    PUBWEAK CAN1_RX1_IRQHandler
    SECTION .textREORDER(1) 
CAN1_RX1_IRQHandler 
    B CAN1_RX1_IRQHandler

    PUBWEAK CAN1_SCE_IRQHandler
    SECTION .textREORDER(1) 
CAN1_SCE_IRQHandler 
    B CAN1_SCE_IRQHandler

    PUBWEAK EXTI9_5_IRQHandler
    SECTION .textREORDER(1) 
EXTI9_5_IRQHandler 
    B EXTI9_5_IRQHandler

    PUBWEAK TIM15_IRQHandler
    SECTION .textREORDER(1)  
TIM15_IRQHandler 
    B TIM15_IRQHandler

    PUBWEAK TIM16_IRQHandler
    SECTION .textREORDER(1)  
TIM16_IRQHandler 
    B TIM16_IRQHandler

    PUBWEAK TIM17_IRQHandler
    SECTION .textREORDER(1)  
TIM17_IRQHandler 
    B TIM17_IRQHandler
    
    PUBWEAK TIM18_DAC2_IRQHandler
    SECTION .textREORDER(1)  
TIM18_DAC2_IRQHandler 
    B TIM18_DAC2_IRQHandler

    PUBWEAK TIM2_IRQHandler
    SECTION .textREORDER(1)
TIM2_IRQHandler 
    B TIM2_IRQHandler

    PUBWEAK TIM3_IRQHandler
    SECTION .textREORDER(1)
TIM3_IRQHandler 
    B TIM3_IRQHandler

    PUBWEAK TIM4_IRQHandler
    SECTION .textREORDER(1)
TIM4_IRQHandler 
    B TIM4_IRQHandler

    PUBWEAK I2C1_EV_IRQHandler
    SECTION .textREORDER(1) 
I2C1_EV_IRQHandler 
    B I2C1_EV_IRQHandler

    PUBWEAK I2C1_ER_IRQHandler
    SECTION .textREORDER(1) 
I2C1_ER_IRQHandler 
    B I2C1_ER_IRQHandler

    PUBWEAK I2C2_EV_IRQHandler
    SECTION .textREORDER(1) 
I2C2_EV_IRQHandler 
    B I2C2_EV_IRQHandler

    PUBWEAK I2C2_ER_IRQHandler
    SECTION .textREORDER(1) 
I2C2_ER_IRQHandler 
    B I2C2_ER_IRQHandler

    PUBWEAK SPI1_IRQHandler
    SECTION .textREORDER(1)
SPI1_IRQHandler 
    B SPI1_IRQHandler

    PUBWEAK SPI2_IRQHandler
    SECTION .textREORDER(1)
SPI2_IRQHandler 
    B SPI2_IRQHandler

    PUBWEAK USART1_IRQHandler
    SECTION .textREORDER(1)
USART1_IRQHandler 
    B USART1_IRQHandler

    PUBWEAK USART2_IRQHandler
    SECTION .textREORDER(1)
USART2_IRQHandler 
    B USART2_IRQHandler

    PUBWEAK USART3_IRQHandler
    SECTION .textREORDER(1)
USART3_IRQHandler 
    B USART3_IRQHandler

    PUBWEAK EXTI15_10_IRQHandler
    SECTION .textREORDER(1)  
EXTI15_10_IRQHandler 
    B EXTI15_10_IRQHandler

    PUBWEAK RTC_Alarm_IRQHandler
    SECTION .textREORDER(1)  
RTC_Alarm_IRQHandler 
    B RTC_Alarm_IRQHandler

    PUBWEAK CEC_IRQHandler
    SECTION .textREORDER(1)  
CEC_IRQHandler 
    B CEC_IRQHandler
   
    PUBWEAK TIM12_IRQHandler
    SECTION .textREORDER(1)  
TIM12_IRQHandler 
    B TIM12_IRQHandler

    PUBWEAK TIM13_IRQHandler
    SECTION .textREORDER(1)  
TIM13_IRQHandler 
    B TIM13_IRQHandler

    PUBWEAK TIM14_IRQHandler
    SECTION .textREORDER(1)  
TIM14_IRQHandler 
    B TIM14_IRQHandler

    PUBWEAK TIM5_IRQHandler
    SECTION .textREORDER(1) 
TIM5_IRQHandler 
    B TIM5_IRQHandler

    PUBWEAK SPI3_IRQHandler
    SECTION .textREORDER(1)
SPI3_IRQHandler 
    B SPI3_IRQHandler

    PUBWEAK TIM6_DAC1_IRQHandler
    SECTION .textREORDER(1)  
TIM6_DAC1_IRQHandler 
    B TIM6_DAC1_IRQHandler

    PUBWEAK TIM7_IRQHandler
    SECTION .textREORDER(1)  
TIM7_IRQHandler 
    B TIM7_IRQHandler

    PUBWEAK DMA2_Channel1_IRQHandler
    SECTION .textREORDER(1)  
DMA2_Channel1_IRQHandler 
    B DMA2_Channel1_IRQHandler

    PUBWEAK DMA2_Channel2_IRQHandler
    SECTION .textREORDER(1)  
DMA2_Channel2_IRQHandler 
    B DMA2_Channel2_IRQHandler

    PUBWEAK DMA2_Channel3_IRQHandler
    SECTION .textREORDER(1)  
DMA2_Channel3_IRQHandler 
    B DMA2_Channel3_IRQHandler

    PUBWEAK DMA2_Channel4_IRQHandler
    SECTION .textREORDER(1)  
DMA2_Channel4_IRQHandler 
    B DMA2_Channel4_IRQHandler

    PUBWEAK DMA2_Channel5_IRQHandler
    SECTION .textREORDER(1)  
DMA2_Channel5_IRQHandler 
    B DMA2_Channel5_IRQHandler

    PUBWEAK SDADC1_IRQHandler
    SECTION .textREORDER(1)
SDADC1_IRQHandler 
    B SDADC1_IRQHandler

    PUBWEAK SDADC2_IRQHandler
    SECTION .textREORDER(1) 
SDADC2_IRQHandler 
    B SDADC2_IRQHandler

    PUBWEAK SDADC3_IRQHandler
    SECTION .textREORDER(1) 
SDADC3_IRQHandler 
    B SDADC3_IRQHandler

    PUBWEAK COMP_IRQHandler
    SECTION .textREORDER(1) 
COMP_IRQHandler 
    B COMP_IRQHandler

    PUBWEAK USB_HP_IRQHandler
    SECTION .textREORDER(1)
USB_HP_IRQHandler 
    B USB_HP_IRQHandler

    PUBWEAK USB_LP_IRQHandler
    SECTION .textREORDER(1)
USB_LP_IRQHandler 
    B USB_LP_IRQHandler

    PUBWEAK USBWakeUp_IRQHandler
    SECTION .textREORDER(1)
USBWakeUp_IRQHandler 
    B USBWakeUp_IRQHandler

    PUBWEAK TIM19_IRQHandler
    SECTION .textREORDER(1) 
TIM19_IRQHandler 
    B TIM19_IRQHandler

    PUBWEAK FPU_IRQHandler
    SECTION .textREORDER(1) 
FPU_IRQHandler 
    B FPU_IRQHandler
    
    END
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****





審核編輯:劉清

聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。 舉報投訴
  • 存儲器
    +關注

    關注

    38

    文章

    7453

    瀏覽量

    163608
  • RAM
    RAM
    +關注

    關注

    8

    文章

    1367

    瀏覽量

    114533
  • IAR
    IAR
    +關注

    關注

    5

    文章

    345

    瀏覽量

    36625
  • Cortex-M
    +關注

    關注

    2

    文章

    227

    瀏覽量

    29728
  • Cortex-R
    +關注

    關注

    0

    文章

    5

    瀏覽量

    5974

原文標題:Cortex-M/R 內核啟動過程 / 程序啟動流程(基于IAR)

文章出處:【微信號:技術讓夢想更偉大,微信公眾號:技術讓夢想更偉大】歡迎添加關注!文章轉載請注明出處。

收藏 人收藏

    評論

    相關推薦

    Cortex-M內核使用FreeRTOS特別注意事項

    本文來自CSDN博客FreeRTOS基礎篇,本篇主要分享Cortex-M內核使用FreeRTOS特別注意事項。
    發表于 09-19 15:01 ?711次閱讀
    <b class='flag-5'>Cortex-M</b><b class='flag-5'>內核</b>使用FreeRTOS特別注意事項

    ARM 之 Cortex-M/R 內核啟動過程 / 程序啟動流程(基于IAR)【轉】

    表部分:符合前面文章介紹的 Cortex-M/R內核的規定!接著我們看到的就是復位中斷的服務函數 0x8003558: 0x04000401DC320x4000401 (67109889
    發表于 05-17 19:31

    IAR系統啟動流程及修改方法

    版本的_low_level_init程序。 對于Cortex M內核,系統啟動代碼是保存在arm\src\lib文件夾下的cstartup_
    發表于 08-06 13:57

    Cortex-M內核的GCC編譯器

    下載ARM官方對應Cortex-M內核的GCC編譯器
    發表于 08-24 06:44

    請問cortex-M4與cortex-A7內核啟動流程是怎樣的?

    請問cortex-M4與cortex-A7內核啟動流程是怎樣的?
    發表于 11-30 07:22

    ARM Cortex-M內核的相關資料推薦

      大家好,我是痞子衡,是正經搞技術的痞子。今天痞子衡給大家介紹的是ARM Cortex-M功能模塊,不過側重點是三款安全特性處理器。  ARM Cortex-M處理器家族發展至今(2020),已有
    發表于 12-27 07:21

    如何使用Ozone分析Cortex-M故障?

    的軟件錯誤。本文將介紹如何使用Ozone的調試功能,深入了解這些類型的錯誤。分析故障工作流程我們首先在一個示例的基礎上演示Ozone 的分析故障工作流程。示例應用程序可以生成不同類型的 Cor
    發表于 09-23 11:26

    關于STM32和Cortex-M內核系列介紹(1)

    Cortex-M內核系列和STM32-講座
    的頭像 發表于 07-05 01:07 ?8005次閱讀

    關于STM32與Cortex-M內核系列的介紹(2)

    Cortex-M內核系列和STM32-講座3
    的頭像 發表于 07-05 00:45 ?4502次閱讀

    Cortex-M內核的MPU內存保護單元

    講講Cortex-M內核的MPU內存保護單元
    的頭像 發表于 03-04 11:17 ?3623次閱讀
    <b class='flag-5'>Cortex-M</b><b class='flag-5'>內核</b>的MPU內存保護單元

    cortex-M4與cortex-A7內核啟動流程分析

    本文簡要介紹了ARM的cortex-M4以及A7內核的bootloader啟動流程,大同小異。
    發表于 12-01 11:51 ?15次下載
    <b class='flag-5'>cortex-M</b>4與<b class='flag-5'>cortex</b>-A7<b class='flag-5'>內核</b><b class='flag-5'>啟動</b><b class='flag-5'>流程</b>分析

    分析ARM Cortex-M內核復位啟動過程

    ARM Cortex-M內核的復位啟動過程也被稱為復位序列(Reset sequence),下面就來簡要總結分析下這一過程。
    的頭像 發表于 03-20 09:58 ?2269次閱讀

    基于32位Arm Cortex-M內核N32系列MCU應用

    國民技術N32系列MCU產品基于32位Arm Cortex-M內核,內置嵌入式高速閃存、低功耗電源管理,集成數?;旌想娐?,并內置硬件密碼算法加速引擎以及安全單元。
    發表于 03-28 11:35 ?846次閱讀

    Cortex-M 內核中斷/異常系統、中斷優先級/嵌套 詳解

    Cortex-M 內核中斷/異常系統、中斷優先級/嵌套 詳解
    的頭像 發表于 09-27 15:29 ?2016次閱讀
    <b class='flag-5'>Cortex-M</b> <b class='flag-5'>內核</b>中斷/異常系統、中斷優先級/嵌套 詳解

    瑞薩Cortex-M內核RA MCU的RT-Thread BSP制作教程發布

    瑞薩Cortex-M內核RA MCU的RT-Thread BSP制作教程發布
    的頭像 發表于 09-18 10:58 ?685次閱讀
    瑞薩<b class='flag-5'>Cortex-M</b><b class='flag-5'>內核</b>RA MCU的RT-Thread BSP制作教程發布