liveBook · Manning

ISB

As explained in Embedded Software with Rust

ISB is an Arm Instruction Synchronization Barrier that flushes the processor pipeline and causes subsequent instructions to be fetched under preceding configuration changes.

ISB (Instruction Synchronization Barrier) flushes the processor pipeline so subsequent instructions are fetched under preceding configuration changes. On Cortex-M, use it after changing settings that affect execution, such as CONTROL, privilege level, or MPU configuration. Without it, prefetched instructions could still reflect the old settings and cause faults. section 5.2.3 section 5.5.2

ISB is not a substitute for a memory barrier. DMB orders memory accesses, while DSB ensures outstanding memory operations complete before execution continues. Volatile reads and writes alone do not provide these guarantees or flush the instruction pipeline. section 5.2.3

unsafe {
    // MPU_CTRL register: 0xE000_ED94
    // Alternatively accessible via cortex_m::peripheral::MPU
    core::ptr::write_volatile(0xE000_ED94 as *mut u32, 0x0); // Disable MPU
    asm::dsb();

    // Configure MPU regions here...

    core::ptr::write_volatile(0xE000_ED94 as *mut u32, 0x1); // Enable MPU
    asm::dsb(); // Ensure enable write completes before ISB
    asm::isb(); // Flush pipeline: subsequent instructions use new MPU config
}

This MPU example uses DSB after the enable write to ensure it completes, then ISB so subsequent instructions use the new configuration. The region configuration is left as a placeholder. section 5.5.2

In Rust firmware, prefer cortex_m::asm::isb() for the barrier. Inline assembly with core::arch::asm! is an alternative when the available intrinsics are insufficient. System-register operations can require privilege and may fault at the wrong privilege level. section 5.2.3 section 5.6 section 5.5.3

How Embedded Software with Rust covers it

How deep it goes
Explains pipeline flushing, contrasts memory barriers, and demonstrates synchronization around MPU configuration.
Examples
Illustrates MPU enablement with DSB followed by ISB and discusses CONTROL changes during context switching.
What you can do after
Apply it via cortex-m::asm::isb() after execution-context changes, alongside other barriers where needed.
How it connects
Connects ISB to memory barriers, volatile access, MPU configuration, privilege levels, and context switching.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Embedded Software with Rust. The section links point to the parts of the book it draws on.