[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-690263-105":59,"doc-detail-690263-en":130,"doc-similar-690263":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","arm-stm32f476-interrupts-arm-and-stm32l4xx-operating-modes-interrupt-handling","ARM STM32F476 Interrupts - ARM and STM32L4xx Operating Modes & Interrupt Handling","","ARM and STM32L4xx interrupt handling overview covering Cortex-M4 operating modes, processor privilege levels, stack-based exception entry/exit, and the NVIC vectoring model. Describes exception states (inactive, pending, active, and active-and-pending), how peripheral or software requests set pending state, and how handlers can preempt. Provides a step-by-step interrupt process with SP/IPSR/PC changes, LR interrupt return code, and resume via BX LR, then summarizes CPU and peripheral exceptions, priorities, and a partial STM32L4 vector table with handler entry addresses.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/arm-stm32f476-interrupts-arm-and-stm32l4xx-operating-modes-interrupt-handling/690263/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/arm-stm32f476-interrupts-arm-and-stm32l4xx-operating-modes-interrupt-handling/690263.png","ImageObject",300,407,{"name":92,"@type":93},"Stanley","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-22","2026-11-08",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What are the main Cortex-M4 processor operating modes and how do they affect stack usage?","Question",{"text":112,"@type":113},"Thread mode runs user tasks, while Handler mode services interrupts and exceptions. The processor uses PSP in thread mode and MSP in handler/O/S mode, with the selected stack pointer controlled via the CONTROL register.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do exception states change from pending to active during interrupt handling?",{"text":117,"@type":113},"Exceptions can be inactive, pending, or active. A peripheral/software request can set an exception to pending, and when the processor begins servicing it the state becomes active; preemption can result in active and pending states.",{"name":119,"@type":110,"acceptedAnswer":120},"How does the CPU perform interrupt entry and return on Cortex-M4?",{"text":121,"@type":113},"On interrupt detection, the CPU suspends the main program, finishes the current instruction, saves CPU state on the stack, sets LR to 0xFFFFFFF9, updates IPSR with the interrupt number, and loads PC from the vector table ISR address. After the ISR, execution returns by executing BX LR, restoring saved state including PC.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},690263,1794159922,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":19,"preview_urls":145},2336477405376,"https://ap-avatar.wpscdn.com/davatar_29158cc5080c5b710cf443261637dec0","|  |\n| --- |\n| \u003Cbr>\u003Cbr>ARM and STM32L4xx Operating Modes & Interrupt Handling\u003Cbr>|\n| ARM Cortex-M4 User Guide (Interrupts, exceptions, NVIC) STM32L4xx Microcontrollers Technical Reference Manual\u003Cbr>\u003Cbr>1 |\n\n\n| Cortex-M structure |\n| --- |\n| \u003Cbr>\u003Cbr>Nested Vectored\u003Cbr>Interrupt Controller\u003Cbr>2 CMSIS = Cortex Microcontroller Software Interface Standard |\n\nCortex CPU core registers  \n• Two processor modes:  \n• Thread mode for User tasks  \n• Handler mode for O/S tasks and exceptions  \n• Stack-based exception model  \n• Vector table contains addresses  \nProcess SP (handler or thread mode – select in CONTROL reg. )  \nMain SP (selected at reset – always used in handler mode)  \nConvention:  \nPSP in thread mode,  \nMSP in O/S & handler mode  \n3  \n\n| Cortex-M4 processor operating modes |  |\n| --- | --- |\n| \u003Cbr>4 | • Thread mode – normal processing\u003Cbr>• Handler mode – interrupt/exception processing\u003Cbr>• Privilege levels = User and Privileged\u003Cbr>• Supports basic “security” & memory access protection\u003Cbr>• Supervisor/operating system usually privileged |\n\nException states  \n􀁹 Each exception is in one of the following states:  \n􀁹 Inactive: The exception is not active and not pending.  \n􀁹 Pending: The exception is waiting to be serviced by the processor.  \n􀁹 Active: The exception is being serviced by the processor but has not completed.  \n􀁹 Active and pending-The exception is being serviced by the processor and there is a pending exception from the same source .  \n􀁹 An interrupt request from a peripheral or from software can change the state of the corresponding interrupt to pending.  \n􀁹 An exception handler can interrupt (preempt) the execution of another exception handler. In this case both exceptions are in the active state.  \n5  \n\n| Cortex-M Interrupt Process\u003Cbr>(much of this is transparent when using C)\u003Cbr>1. Interrupt signal detected by CPU\u003Cbr>2. Suspend main program execution\u003Cbr>􀁹 finish current instruction\u003Cbr>􀁹 save CPU state (push registers onto stack) \u003Cbr>􀁹 set LR to 0xFFFFFFF9 (indicates interrupt return)\u003Cbr>􀁹 set IPSR to interrupt number\u003Cbr>􀁹 load PC with ISR address from vector table\u003Cbr>3. Execute interrupt service routine (ISR)\u003Cbr>􀁹 save other registers to be used 1\u003Cbr>􀁹 clear the “flag” that requested the interrupt\u003Cbr>􀁹 perform the requested service\u003Cbr>􀁹 communicate with other routines via global variables\u003Cbr>􀁹 restore any registers saved by the ISR 1\u003Cbr>4. Return to and resume main program by executing BX LR\u003Cbr>􀁹 saved state is restored from the stack, including PC\u003Cbr>\u003Cbr>Pre-IRQ top of stack\u003Cbr>\u003Cbr>IRQ top of stack\u003Cbr>|  |\n| --- | --- |\n| \u003Cbr>6 | 1 C compiler takes care of saving/restoring registers |\n\n\n| Cortex-M CPU and peripheral exceptions |  |  |\n| --- | --- | --- |\n| \u003Cbr>Priority 1 IRQ\\#2 Notes Reset -3 Power-up or warm reset NMI -2 -14 Non-maskable interrupt from peripheral or software HardFault -1 -13 Error during exception processing or no other handler MemManage Config -12 Memory protection fault (MPU-detected) BusFault Config -11 AHB data/prefetch aborts UsageFault Config -10 Instruction execution fault-undefined instruction, illegal unaligned access SVCcall Config -5 System service call (SVC) instruction DebugMonitor Config Break points/watch points/etc. PendSV Config -2 Interrupt-driven request for system service SysTick Config -1 System tick timer reaches 0 IRQ0 Config 0 Signaled by peripheral or by software request IRQ1 (etc.) Config 1 Signaled by peripheral or by software request\u003Cbr>  CPU Exceptions   |  |  |\n| \u003Cbr>7 | Vendor peripheral interrupts IRQ0 .. IRQ90 | 1 Lowest priority \\# = highest priority 2 IRQ\\# used in CMSIS function calls |\n\n\n| Vector table |\n| --- |\n| \u003Cbr>8\u003Cbr>• 32-bit vector(handler address) loaded into PC, while saving CPU context.\u003Cbr>• Reset vector includes initial stack pointer\u003Cbr>• Peripherals use positive IRQ \\#s\u003Cbr>• CPU exceptions use negative IRQ \\#s\u003Cbr>• IRQ \\# used in CMSIS function calls\u003Cbr>• Cortex-M4 allows up to\u003Cbr>240 IRQs\u003Cbr>• IRQ priorities user-programmable\u003Cbr>• NMI & HardFau","cbCaijBmpFz7cvjm","https://ap.wps.com/l/cbCaijBmpFz7cvjm","pdf",849104,38,"English","# Cortex-M4 operating modes\n## Processor modes and stack selection\n## Exception states\n# Interrupt processing flow\n## Entry and state save\n## ISR execution and return\n# Exceptions and NVIC\n## CPU and peripheral exceptions\n## Priorities and vector table","[{\"question\":\"What are the main Cortex-M4 processor operating modes and how do they affect stack usage?\",\"answer\":\"Thread mode runs user tasks, while Handler mode services interrupts and exceptions. The processor uses PSP in thread mode and MSP in handler/O/S mode, with the selected stack pointer controlled via the CONTROL register.\"},{\"question\":\"How do exception states change from pending to active during interrupt handling?\",\"answer\":\"Exceptions can be inactive, pending, or active. A peripheral/software request can set an exception to pending, and when the processor begins servicing it the state becomes active; preemption can result in active and pending states.\"},{\"question\":\"How does the CPU perform interrupt entry and return on Cortex-M4?\",\"answer\":\"On interrupt detection, the CPU suspends the main program, finishes the current instruction, saves CPU state on the stack, sets LR to 0xFFFFFFF9, updates IPSR with the interrupt number, and loads PC from the vector table ISR address. After the ISR, execution returns by executing BX LR, restoring saved state including PC.\"}]","ARM STM32F476 Interrupts - ARM and STM32L4xx Operating Modes & Interrupt Handling | PDF",96,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/4f26d4f2523f9336f2f67776d214c953.webp",983,737,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/0e22b45bc94ebef632238d7162fa5813.webp",982,736,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/190ff058d446c00b371de0b7cf121cc6.webp",981,735,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/5e9db72b6982725e8d7ed1c5f995849a.webp",980,734,{"list":163,"token":66},[164,170,176,183,189,195,201,207,213,219],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":81,"category_name":30,"create_tm":169},691722,"XMC4000 System XMC - Key feature and Cortex-M4 architecture highlights","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002682702/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=rtvxtwJnwsLIVHfXZoroo%2Fv4%2Bg0%3D","xmc4000-system-xmc-key-feature-and-cortex-m4-architecture-highlights",1794175897,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":24,"category_name":30,"create_tm":175},700258,"TRAVEO™ T2G Body Entry CPU Subsystem (CPUSS) - Customer training workshop - Q4 2021","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012022041/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=2Re3G2OiSKJNrrYMUm7OOG%2BCja8%3D","traveo-t2g-body-entry-cpu-subsystem-cpuss-customer-training-workshop-q4-2021",1794517773,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":181,"category_name":30,"create_tm":182},399898,"MEC152x - Operating Conditions - Low Power Modes - Security Features","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229919443415/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=XltH2erjvnBvNf5OH4FzZtdTopM%3D","mec152x-operating-conditions-low-power-modes-security-features",13,1790504944,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":19,"category_name":30,"create_tm":188},690248,"CY9B310T Series - 32-bit ARM Cortex-M3 FM3 Microcontroller","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002604216/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=x0ZxUedn%2BZhaSttMge8f%2FVuRlIo%3D","cy9b310t-series-32-bit-arm-cortex-m3-fm3-microcontroller",1794159481,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":81,"category_name":30,"create_tm":194},690255,"Arm Cortex-M4 Processor Datasheet - Overview, Features & Components","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002605369/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=UeLRSSIaB4xQEF12wcdlcLzx8FE%3D","arm-cortex-m4-processor-datasheet-overview-features-components",1794159717,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":34,"category_name":30,"create_tm":200},691949,"STM32 Cortex-M4 MCUs and MPUs programming manual - PM0214 - Instruction set and core peripherals","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002055940/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=k6RrXIRfEcdOi%2BsRam%2FoMaAYyI4%3D","stm32-cortex-m4-mcus-and-mpus-programming-manual-pm0214-instruction-set-and-core-peripherals",1794177218,{"doc_id":202,"doc_title":203,"file_type":137,"home_preview_img_url":204,"slug":205,"view_count":19,"category_name":30,"create_tm":206},691643,"XMC1300 AB-Step Microcontroller Series for Industrial Applications - Reference Manual - V1.3 - Revision History 2016-08","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002681047/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=GDafkcl6OZdSJPl3fd9%2BtgMNZ0g%3D","xmc1300-ab-step-microcontroller-series-for-industrial-applications-reference-manual-v13-revision-history-2016-08",1794175524,{"doc_id":208,"doc_title":209,"file_type":137,"home_preview_img_url":210,"slug":211,"view_count":24,"category_name":30,"create_tm":212},700099,"System 68000 VMESYS68K - CPU-Board - SYS68K/CPU-1B/C","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011561075/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=JojQdbT86IhuFp6EGV4GYxlvOHs%3D","system-68000-vmesys68k-cpu-board-sys68kcpu-1bc",1794515698,{"doc_id":214,"doc_title":215,"file_type":137,"home_preview_img_url":216,"slug":217,"view_count":34,"category_name":30,"create_tm":218},654044,"X_CAN 2 - User Manual - Features and Functional Description","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229974004272/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=yeUNeSjMq7Ir3qp5QBakfUmQlwo%3D","x_can-2-user-manual-features-and-functional-description",1792906055,{"doc_id":220,"doc_title":221,"file_type":137,"home_preview_img_url":222,"slug":223,"view_count":24,"category_name":30,"create_tm":224},691821,"Arm Cortex-M33 Processor Datasheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002052502/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796109239&Signature=frp7dlLS%2B2jE%2BApzVHbvelS2dN8%3D","arm-cortex-m33-processor-datasheet",1794176262]