Abnormal interruption of ARM system

Publisher:幸福之星Latest update time:2016-06-20 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
In the ARM system, there are usually 3 ways to control the processor process

   1: During normal execution, the value of the program counter register PC increases by four bytes for each ARM instruction executed, and the value of the program counter register PC increases by two bytes for each Thumb instruction executed. The entire process is executed sequentially.  

   2: Through the jump instruction, the program can jump to the specified address label for execution, or jump to a specific subroutine for execution. The B instruction is used to perform the jump operation, and the BL instruction is used to save the corresponding return address of the subroutine while performing the jump operation. BX separates the lowest bit of the target address while performing the jump operation, and can switch the program to THumb state. BLX performs the above three operations

   3: When an abnormal interrupt occurs, the system will execute the current instruction and then jump to the corresponding abnormal interrupt handler for execution. After the abnormal interrupt handler is executed, the program returns to the next instruction where the interrupt occurred to continue execution. When entering the abnormal interrupt handler, the execution scene of the interrupted program must be saved. When exiting from the abnormal interrupt program, the execution scene of the interrupted program must be restored.

 

ARM processor's response to abnormal interrupt

  1 Save the current state of the processor, the interrupt mask bit, and each condition flag bit. This is achieved by saving the contents of the current program status register CPSR to the SPSR register corresponding to the exception interrupt to be confident.

  2 Set the corresponding bits of the current program status register, including the bits in the CPSR, so that the processor enters the corresponding execution mode, sets the bits in the CPSR, and the IRQ interrupt is executed, but when entering the FIQ, the FIQ interrupt is executed.

  3 Set the register to the return address

  4 Set the program counter PC to the interrupt vector address of the long exception interrupt, so as to jump to the corresponding exception interrupt for processing

Return from exception handling

  1 Restore the processor status of the interrupted program and transfer the contents of the SPSR_mode register to the CPSR

  2 Return to the next instruction of the instruction where the abnormal interrupt occurred, and write the content in IR_MODE to PC

  3 Reset and exception interrupt do not need to return, the different exception interrupts pointed to by the program counter PC are different

Reference address:Abnormal interruption of ARM system

Previous article:ARM processor power-on/reset operation
Next article:Exception handling process of ARM1176JZF-S/S3C6410 processor

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号