An intrinsic exposes a low-level operation through a function that maps directly to a machine instruction. On Cortex-M, `cortex-m::asm` provides calls for common instructions, making hardware intent clear without inline assembly. These calls can affect processor state, timing, or memory ordering, so use them with care. section 5.5.2
Common uses include:
- Pause at a precise instruction boundary with `bkpt()` to inspect machine state under a debugger. section 5.5.2
- Use `dmb()` to order memory accesses, or `dsb()` to wait for preceding memory operations to complete. section 5.5.2
- Use `wfi()` or `wfe()` to suspend the core, and `sev()` to send an event to a core waiting in `wfe()`. section 5.5.2
use cortex_m::asm;
// Most cortex_m::asm functions are unsafe as they
// directly affect processor state.
unsafe {
asm::nop(); // No-op: useful for timing padding
asm::wfi(); // Wait for interrupt: suspend core until interrupt pending
asm::isb(); // Instruction Synchronisation Barrier
asm::dsb(); // Data Synchronisation Barrier
asm::dmb(); // Data Memory Barrier
asm::udf(); // Trigger UsageFault: used as a hard assert
asm::bkpt(); // Breakpoint: halts core under a connected debugger
asm::wfe(); // Wait for event: suspend core until event or interrupt
asm::sev(); // Send event: wake a core waiting in wfe()
}
See the `cortex_m::asm` listing for these calls and additional instructions, including `nop()`, `isb()`, and `udf()`. section 5.5.2
Changing MPU configuration
After writing the MPU control register, the example uses `dsb()` to ensure the write completes and `isb()` so subsequent instructions use the new configuration. section 5.5.2

