Complete the code to identify the type of fault from the Fault Status Register (FSR).
if (FSR & [1]) { // Handle memory management fault }
The memory management fault is indicated by bit 0 (0x01) in the Fault Status Register (FSR).
Complete the code to clear the Usage Fault Status Register (UFSR) after handling the fault.
UFSR = [1];Writing 0x00 clears the Usage Fault Status Register after the fault is handled.
Fix the error in the fault handler to correctly read the Fault Address Register (FAR).
uint32_t fault_address = [1];The Fault Address Register (FAR) is a memory-mapped register and should be read directly by its name.
Fill both blanks to check if a Bus Fault is caused by a precise data bus error and then clear the Bus Fault Status Register (BFSR).
if (BFSR & [1]) { // Handle precise data bus error } BFSR = [2];
Bit 1 (0x02) in BFSR indicates a precise data bus error. Writing 0x00 clears the BFSR.
Fill all three blanks to create a dictionary mapping fault types to their status bits and check if a Usage Fault occurred.
fault_bits = {
'MemoryManagement': [1],
'BusFault': [2],
'UsageFault': [3]
}
if (FSR & fault_bits['UsageFault']) {
// Handle usage fault
}Memory Management fault is bit 0 (0x01), Bus Fault is bit 1 (0x02), and Usage Fault is bit 4 (0x10) in the Fault Status Register (FSR).
