Every question on one page: open one, choose an answer, and see why at once. Signed in, your latest answer to each question counts, and you can answer again after 24 hours.
Curated: · Written: · Reviewed:
Reviewed 100Review pending 0
Answers to reviewed questions count toward this role and the overall leaderboard; your latest answer to each one is the one that counts.
MCQ-7An engineer's driver enables a peripheral with `CTRL |= 0x0000_0001;` (CTRL[0] = EN). The datasheet documents CTRL[0] as EN, marks CTRL[31:1] reserved with the note 'write as 0', and gives reset value 0x0000_0000. On the bench, CTRL reads 0x0000_0000 at hand-off, the driver's write leaves 0x0000_0001, and the peripheral runs at 8 MHz. On the production board, a factory self-test has left CTRL = 0x0000_0004; the same binary runs the peripheral at 2 MHz and leaves 0x0000_0005. Which change enables the peripheral at 8 MHz on both boards?⌄
MCQ-3A driver sets a GPIO output high by writing BSRR on an STM32F407 running at 80 MHz (12.5 ns per cycle). It then executes DSB, two NOPs, and reads IDR, which returns 0. The datasheet t_OP for this pin with the board's 22 pF load is about 40 ns. Which conclusion does the evidence support?⌄
MCQ-4An STM32F407 driver runs USART2 at 115200 8N1 with RXNEIE set. Its handler reads the data register first and checks the status register second:
```c
void USART2_IRQHandler(void) {
uint8_t b = USART2->DR; /* clears RXNE */
if (USART2->SR & USART_SR_ORE) { overruns++; }
}
```
On the bench the CPU sits at 100%, and a breakpoint in the handler is hit again immediately after each return. A dump taken inside the handler shows `USART2->SR == 0x0008`. Which change makes the handler run once per received byte?⌄
MCQ-5A change enables USART1 with `RCC->APB2ENR |= USART1EN` and writes `USART1->BRR = 0x02D9` on the next line to set 115,200 baud at 84 MHz APB2. The author's note says the two stores are ordered because both target APB2. Which review comment should be accepted?⌄
MCQ-93On an STM32F4 board, `usart_init()` runs before the APB1 clock is enabled: it writes `USART2->CR1 = USART_CR1_UE | USART_CR1_TE;` and `USART2->BRR = 0x0683;`, and only later does boot code execute `RCC->APB1ENR |= RCC_APB1ENR_USART2EN;`. After the full boot sequence, `USART2->CR1` reads back 0x0000, `USART2->BRR` reads back 0x0000, and PA2 never leaves idle. A junior engineer proposes inserting a 5 ms `delay_ms()` between the CR1 write and the clock-enable line. Which assessment is correct?⌄
MCQ-97An STM32F4 board boots on its 16 MHz HSI. Init writes USART1->BRR = 0x008B for 115200 baud, then enables the PLL so SYSCLK and APB2 run at 80 MHz (APB1 at 40 MHz), then prints a banner. The terminal shows garbage. Which change fixes the banner?⌄
MCQ-34A sensor board runs USART1 from a 16 MHz APB clock with 16× oversampling and talks to a peer fixed at 115,200 baud; the board's crystal and the peer's clock are each ±2%. The driver computes USARTDIV = round(f_PCLK/(16×baud)) and writes the integer result into BRR. On the bench the link drops about one frame in a thousand, and a logic analyzer measures the TX line at 111,111 baud. What is the correct remediation?⌄
MCQ-35An STM32F407 USART2 is set up for 9-bit multiprocessor mode (M=1, 115200 baud). The master sends an address frame by writing 0x42 to USART2->DR, then sends payload bytes. Two slaves sit in mute mode with WAKE=1, so a frame with the 9th bit set should wake them. A logic analyzer shows the address frame as 0b0_0100_0010, the 9th bit is 0, and neither slave wakes. Which change puts a 1 in the 9th bit of the address frame?⌄
MCQ-94An STM32-class board uses PB3 as UART TX at 115200 8N1: 8.68 µs per bit, 86.8 µs per 10-bit frame, and the console prints cleanly. A later firmware revision enables SWO/ITM tracing at 2 MHz during boot. After that revision the console is silent, but the UART's transmit-complete interrupt still fires every 86.8 µs and the TX FIFO drains normally. A scope on PB3 shows a clean 2 MHz square wave instead of UART framing. What is the correct diagnosis and fix?⌄
MCQ-96A team's STM32F407 SPI master clocks an external ADC at 8 MHz SCLK (125 ns per bit) in 32-byte frames. CS is driven by software and raised inside the TXE interrupt. On the bench, a scope shows CS going high 40 ns before the final SCLK falling edge, and about 12% of frames fail the ADC's CRC check. Which change fixes the failures?⌄
MCQ-100A board bring-up boots a mixed reel of 8,000 parts. The boot code enables prefetch, then dispatches a workaround:
```c
FLASH_ACR |= FLASH_ACR_PRFTEN; // prefetch on
uint32_t id = DBGMCU_IDCODE & 0xFFF; // REV_ID is bits [15:0]
if (id == 0x1000 || id == 0x3000) // revisions that must run with prefetch off
FLASH_ACR &= ~FLASH_ACR_PRFTEN;
```
The reel holds 1,200 parts reporting REV_ID 0x1000, 6,000 reporting 0x2001, and 800 reporting 0x3000. With prefetch on, the 0x1000 and 0x3000 parts hang 14 ms after reset at 18 mA; the 0x2001 parts run normally either way. How many of the 8,000 boards hang at boot?⌄
MCQ-9A board ships with two die revisions of the same MCU: the revision register reads 0x1001 on batch 1 and 0x2000 on batch 2. The errata sheet lists one recipe, for the 0x1001 die only: write it after the UART clock is enabled and before RX is enabled, and do not run it on 0x2000. Firmware writes the recipe once at boot, selected from the revision read at boot; the wake-from-STOP path re-initializes the UART, which resets its registers. Bench runs stream 10,000 bytes at 115,200 baud and count overruns:
| run | overruns (ORE) |
| --- | --- |
| batch 1, cold boot | 0 |
| batch 1, after STOP wake | 68, repeatable |
| batch 2, cold boot and after wake | 0 |
| batch 2, recipe forced on every init (sanity run) | 41 |
Which change ships?⌄
MCQ-17A sensor node runs an application compiled with -fno-exceptions and links a prebuilt static library compiled with exceptions enabled. The library's internal std::vector grows and its 256-byte allocation fails: the 96 KB heap has 95.9 KB in use. In the field the node stops reporting, draws 18 mA instead of the certified 120 µA STOP current, its status LED stays lit, the reset-cause register reads POR with the boot counter unchanged, and the fault status registers read 0. On this runtime abort() executes BKPT and then spins in a 4-instruction loop. Which explanation and fix fits this evidence?⌄
MCQ-31A 400 kHz Fast-mode I2C bus has 200 pF of bus capacitance and 3.3 V pull-ups. The driver's output-low spec is IOL = 3 mA at VOL = 0.4 V, and the Fast-mode rise-time limit is 300 ns (30% to 70% of VDD). Which pull-up value and resulting 30–70% rise time meets both limits?⌄
MCQ-32A 16-bit ADC on a 400 kHz I2C bus holds SCL low for up to 900 µs during each conversion. The MCU's I2C peripheral aborts a transaction when SCL stays low longer than its SCL-low timeout, currently 100 µs. On abort the master issues STOP while the ADC still holds SDA, and the bus stays stuck for 42 ms until a bit-bang recovery. The team wants the smallest timeout that clears the ADC's worst-case stretch with 20% margin for bus RC. What should the timeout be set to?⌄
MCQ-36A sensor on a new board is listed in its datasheet at I2C address 0x2A5, which the datasheet marks as 10-bit addressing. The driver's probe scans 7-bit addresses 0x08-0x77, gets a NACK at every one, and marks the sensor absent. A logic analyzer is then attached while the driver writes the sensor's config register. Which first two bytes on the wire show the driver is addressing the part correctly?⌄
MCQ-33A team brings up a W25Q128JV SPI flash (JEDEC ID 0xEF 0x40 0x18) on an STM32 SPI peripheral. The datasheet timing diagram shows SCLK idling high, MISO driven on SCLK falling edges, and MISO sampled on SCLK rising edges. The driver is configured with CPOL=0, CPHA=0. A logic-analyzer capture of the 0x9F JEDEC-ID command shows SCLK idling low and MISO changing on SCLK falling edges, and the read returns 0x77 0xA0 0x0C. What should the team do?⌄
MCQ-37A SPI NOR flash is read with command 0x3B (Fast Read Dual Output) at 48 MHz. The datasheet's dummy-cycle table lists 4 clocks for 0x3B at 48 MHz, but the driver programs the dummy-cycle field to 8. Every 256-byte page read fails CRC, and the returned buffer holds the page's bytes in order but offset by one position, with the last page byte never returned. Which explanation fits the evidence?⌄
MCQ-39A firmware driver polls a sensor over a 400 kHz I2C bus. The sensor's datasheet specifies a 1.5 ms maximum conversion time. The driver retries the sensor's address in a tight loop; a logic analyzer captures 750 address attempts in 1.5 ms, all NACKed, with SDA and SCL sitting high between attempts. The MCU is the only master on the bus, and a register read issued while the sensor is idle ACKs normally. What does the NACK indicate, and what should the driver do?⌄
MCQ-40A sensor streams continuously over SPI at 4 Mbps into an MCU whose SPI peripheral has a 32-byte RX FIFO. The driver drains the FIFO from a 1 kHz timer ISR and DMA is disabled. After about 200 ms the received frames are corrupt and the peripheral's overrun flag is set. Which change fixes the failure?⌄
MCQ-14An STM32F407 (Cortex-M4F) receives a 5-byte SPI frame, 1 header byte then a 4-byte big-endian payload, via HAL_SPI_Receive_DMA(&hspi1, (uint8_t *)&f, 5) into `typedef struct { uint8_t hdr; uint32_t payload; } frame_t;`. The CRC over f.payload fails on 100% of frames, but a logic analyzer shows the correct 5 bytes on the wire and the DMA-complete LED toggles each time. What explains the failure?⌄
MCQ-8A dual-core board runs a Cortex-M7 producer and a Cortex-M4 consumer over shared SRAM. The M7 writes an 8-byte payload to 0x3000_0000, then stores 1 to a flag word at 0x3000_0008. The M4 polls the flag and, on seeing 1, copies the payload and checks a CRC. At 1 kHz, 2.1% of messages fail CRC. A logic-analyzer capture of one failure shows the M4 read flag = 1 while the payload's first 4 bytes came from packet n and its last 4 bytes from packet n+1. Which change removes the failures?⌄
MCQ-95A GPS module streams 9-byte NMEA sentences every 200 ms into an STM32 UART at 115200 8N1. RX uses DMA in circular mode into a 256-byte buffer, and the firmware parses data only in the DMA transfer-complete (TC) interrupt. The navigation task must consume each sentence within 20 ms of its last byte. Which change meets that budget?⌄
MCQ-22A Cortex-M4 firmware calls NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_2), giving 2 preemption bits and 2 subpriority bits. The ADC ISR is assigned priority 0x40 and the DMA ISR priority 0x50. The DMA ISR runs for 40 µs. An ADC end-of-conversion interrupt asserts 3 µs after the DMA ISR starts. What is the ADC ISR's entry latency, measured from the interrupt assertion to its first instruction?⌄
MCQ-21A 72 MHz Cortex-M3 board receives 8N1 frames on USART2 at 115,200 baud. The RX interrupt is the only enabled interrupt; its handler copies each received byte into a 256-byte ring buffer and then runs a CRC over the 64-byte frame. Scoped GPIO high time around the handler is 140 µs. Frames arrive back-to-back at full line rate, and the overrun error flag sets on most bytes. Which change removes the byte loss?⌄
MCQ-2An STM32F407 (Cortex-M4) product has a bootloader at 0x0800_0000 and the application linked at 0x0800_4000. The bootloader validates the image and jumps to the application's reset handler; it never writes SCB->VTOR. The application enables USART1 (IRQ 37) and prints "up" from main, but a byte arriving on USART1 never reaches the application's handler: a debugger shows the CPU taking exception 37 and executing the bootloader's USART1 stub, the address stored in the vector at 0x0800_00D4, while the application's vector at 0x0800_40D4 is never used. What is the correct fix?⌄
MCQ-23A Cortex-M MCU at 72 MHz runs IRQ A for 38 µs. IRQ B has a 40 µs period and 12 µs of work. Tail-chaining starts B 0.08 µs after A returns. B's handler writes the PWM compare register, and the motor current spikes 2.4 A. Which conclusion and next step is correct?⌄
MCQ-27An 80 MHz Cortex-M4 has 4 implemented priority bits. Its ADC1 end-of-conversion ISR sits at priority field 0x20: ADC1 starts a conversion every 10 us, and the current loop requires the EOC result to be read within 4 us of the flag. That ISR touches nothing but the result register. The UART RX ISR at priority field 0x60 appends to a 32-byte ring buffer that the main loop also updates. That update, 5 us (400 cycles), is wrapped in CPSID i / CPSIE i. On the bench the scope shows the ADC ISR entered 5.2 us after EOC and the current loop output jittering. Which change should ship?⌄
MCQ-25An IMU's open-drain ALERT pin is active low and stays low until firmware reads its 6-byte status register over I2C. EXTI is configured falling-edge. At t=0 ALERT falls and stays low for 4.2 ms. The ISR starts at t=0.1 ms, reads the status register at t=0.2 ms (6 bytes at 400 kHz, about 150 µs), then calls printf, which takes 3.8 ms. A second IMU event occurs at t=1.0 ms while ALERT is still low. What happens to that second event?⌄
MCQ-29A firmware change moves a blocking 400 µs log write into the USART1 RX ISR on a Cortex-M4 board. USART1 runs at 115200 baud (86.8 µs per byte) at preemption priority 1, and the ISR clears RXNE as its last action. USART2 RX, also 115200, sits at preemption priority 5. A GPIO toggles at every ISR entry. During review the engineer predicts the logic-analyzer trace for a continuous 1-second flood on USART1 while 3 bytes arrive on USART2. Which prediction is correct?⌄
MCQ-24An STM32F407 board routes TIM1's break input (100 Hz) and TIM9's update event (20 kHz, driving a control loop that must keep running) to the shared TIM1_BRK_TIM9 vector. The handler reads TIM1_SR, clears BIF, and returns. On the bench the vector re-enters at 20 kHz, CPU sits at 100%, board current is 28 mA against a 6 mA idle budget, and the UART still prints one line per second. What does the evidence show?⌄
MCQ-28An STM32F4 motor board reads a 4,096 CPR encoder at 3,000 rpm: 204,800 edges/s, 4.88 µs apart. The 1.2 µs index pulse shares the EXTI9_5 handler with encoder channel A; the handler reads the pin, then writes PR to clear the pending bit, and takes 6 µs. After a run the commutation offset is off by exactly one mechanical turn and RMS current is 1.8 A instead of 0.4 A. What is the cause and the fix?⌄
MCQ-26A Cortex-M4F product resets in the field. Its 10 kHz timer ISR is compiled with -mfloat-abi=soft, but it calls a vendor DSP routine from a prebuilt object compiled with -mfloat-abi=hard -mfpu=fpv4-sp-d16. The vendor object is the only validated DSP implementation and must stay. Startup code leaves CPACR at 0x00000000. The fault status register reports a UsageFault with NOCP at 9,200 faults/s; RUN current is 22 mA against a 7 mA budget. The ISR's heartbeat pin still shows a 100 us pulse before each reset. Which change removes the NOCP resets and keeps the DSP routine's output correct?⌄
MCQ-10A current-loop ISR on a Cortex-M4F is marked `__attribute__((naked))` to save cycles; it does FP math and uses S16 as a scratch register. The control task it preempts also does FP math and keeps a live filter coefficient in S16. After the ISR returns, that coefficient comes back as a denormal and torque spikes 40% for one tick. What is the correct remediation?⌄
MCQ-30An STM32F407 runs FreeRTOS 10.5.1 with heap_4. configMAX_SYSCALL_INTERRUPT_PRIORITY is 5 and EXTI0 is configured at NVIC priority 4. A priority-3 task calls pvPortMalloc(64); EXTI0 fires and its handler calls pvPortMalloc(32). The LED toggled by EXTI0 keeps its 200 Hz cadence, and 900 ms later the first HardFault occurs inside vTaskSwitchContext. What is the correct diagnosis and fix?⌄
MCQ-42A FreeRTOS control task runs a 1 kHz loop (configTICK_RATE_HZ = 1000). Each iteration samples, computes and actuates in 400 µs, then calls vTaskDelay(1). A higher-priority CAN task preempts it for 700 µs once every 5 ms. A logic analyzer on the loop's GPIO shows the period is 1.000 ms on most iterations and 2.000 ms on the preempted one. What is the cause?⌄
MCQ-49A FreeRTOS build (configTICK_RATE_HZ = 1000) has a control task at priority 5 that runs 82 ms of computation and then calls vTaskDelay(1). A 1 ms periodic software timer performs a 400 µs SPI transfer in its callback, and the callback runs in the timer daemon task, configured at configTIMER_TASK_PRIORITY = 0. A GPIO toggled at the start of the callback measures about 12 Hz instead of the intended 1 kHz. The team raises configTIMER_TASK_PRIORITY to 6 and changes nothing else. What callback rate should the GPIO now show?⌄
MCQ-50A Cortex-M4 board runs FreeRTOS with configUSE_PREEMPTION = 1, configUSE_TIME_SLICING = 0 and configTICK_RATE_HZ = 1000. Logger (priority 3) computes for 3 ms per loop and never blocks. Sensor (priority 3) must drain a 16-byte UART RX queue every 1 ms and needs 200 µs of CPU to do it; the UART runs at 115200 8N1, so a byte arrives every 86.8 µs. In the field the queue overflows and the board resets, and GPIO toggles show Logger running continuously while Sensor is never scheduled. Which change fixes the overflow?⌄
MCQ-43On a FreeRTOS Cortex-M4 target, a UART TX driver is guarded by a semaphore created with xSemaphoreCreateCounting(2, 2). Two tasks call uart_send_frame(): the logger (priority 3) sends 0x41 0x42 0x43 0x44 and the CLI (priority 2) sends 0x31 0x32 0x33 0x34. Each task takes the semaphore, writes its four bytes with four blocking uart_putc() calls, then gives it back. A logic analyzer shows 0x41 0x31 0x42 0x32 0x43 0x33 0x44 0x34 on the wire, and the receiver reports 40% frame errors. What is the correct diagnosis and fix?⌄
MCQ-41A Cortex-M7 board runs an RTOS with three tasks: control (priority 8, 1 ms period), GUI (priority 4), and logger (priority 1). The logger takes the SPI bus through a binary semaphore and runs an 8 ms printf while holding it; the SPI transaction itself is 42 µs. When control next needs the bus it blocks, the GUI preempts the logger for 7.9 ms, control's start jitter reaches 8 ms, and the position error grows to 3.2 mm. Which change bounds control's worst-case wait for the bus?⌄
MCQ-46A Cortex-M4 board runs FreeRTOS with configTICK_RATE_HZ = 1000. A 20 kHz ADC ISR calls xQueueSendFromISR(adcQ, &sample, &woken) and then portYIELD_FROM_ISR(woken). The motor task blocks on xQueueReceive(adcQ, &sample, portMAX_DELAY) and must act on each sample within 100 µs. The task the ADC ISR preempts runs at priority 5; the motor task runs at priority 3. A GPIO toggled at the top of the motor task shows it runs in bursts of about 20 samples once per millisecond, and the control loop misses its deadline. The queue (depth 32) never overflows. What is the correct fix?⌄
MCQ-12A 115,200-baud USART delivers a 64-byte line every 6 ms. The peripheral has a 1-byte receive register and no DMA, so the ISR must move each byte out before the next arrives, and the consumer task can be blocked for tens of milliseconds behind a flash erase. The ISR calls pvPortMalloc for each line, and it can fire while a task is inside pvPortMalloc on the shared heap. Which change is defensible?⌄
MCQ-38An 8 MHz SPI bus on a Cortex-M4 FreeRTOS product is shared by a task that reads a 16-bit ADC word and a 10 kHz timer ISR that must read a 2-byte status register every tick. The timer ISR must return within 10 µs. The task takes a mutex, asserts CS, and clocks 16 bits; the ISR calls xSemaphoreTake() on the same mutex, asserts CS, and clocks 2 bytes. A logic capture shows CS toggling mid-frame and the ADC word 0x03E8 returning as 0x0311 in 12% of samples. The task holds the mutex 42 µs per read. What change fixes the torn reads while meeting the ISR deadline?⌄
MCQ-6A Cortex-M4 FreeRTOS task runs unprivileged with PRIVDEFENA = 0; the only enabled MPU regions are the task's stack, a guard, and flash. The task stack is 512 bytes at 0x20002000–0x20002200, SP starting at 0x20002200 and growing down. A 32-byte region at 0x20001FE0–0x20002000 is set to AP = no-access, XN. The measured high-water mark is 480 bytes. A new code path adds a function with a 96-byte stack frame. The MemManage handler logs MMFAR = 0x20001FC0. What does this fault show?⌄
MCQ-11A Cortex-M4F task runs on a 1,024-byte stack filled with 0xA5. After a console-only run that exercises the deepest application call tree, the deepest overwritten byte sits at offset 0x3C0, so 960 bytes were used and 64 remain. The field workload adds an EXTI handler preempted by a higher-priority timer ISR, both using FP. The ship rule requires remaining margin of at least one worst-case exception frame plus 25 percent of the stack. Which conclusion does the measurement support?⌄
MCQ-20A CRC32 helper recurses by splitting the buffer in half until the remaining chunk is at most 32 bytes. -fstack-usage reports 44 bytes per frame. The task stack is 1024 bytes, and the caller chain in that same task already holds 400 bytes when the helper is entered. The team must CRC a 1 MiB QSPI image. What is the peak stack use, and does it fit?⌄
MCQ-44A FreeRTOS task on a Cortex-M4 has a 256-byte stack fixed by the linker script, and RAM is full so it cannot grow. Its deepest call chain needs 336 bytes, so it writes 80 bytes past the bottom of its stack into the memory immediately below, which holds the TCB of the next task. The deep call returns before the next context switch, so the stack pointer is back inside the task's own region by the time the scheduler runs. The build ships with configCHECK_FOR_STACK_OVERFLOW = 1 and an empty vApplicationStackOverflowHook; field units HardFault in the idle task about 3.4 s after boot, 12 returns a week. Which change detects the overflow before the corrupted TCB is used?⌄
MCQ-13A Cortex-M4 at 48 MHz has 48,128 bytes of .bss, cleared at startup by a word-store loop of 12,032 stores that measures 1.1 ms. Reset-to-first-control-loop is 32 ms against a 20 ms budget. The board takes watchdog resets without a power cycle, and SRAM contents survive them. To reclaim boot time an engineer deletes the clear loop, arguing the C language already guarantees that static objects start at zero. The first boot after flashing looks correct in the lab. After any watchdog reset, filter_state -- an 8-byte IIR accumulator that the control loop reads before it first writes it -- comes up as 0xFFFFFFFF, the control output saturates, and the actuator draws 42 mA instead of 18 mA. Which review decision does this evidence support?⌄
MCQ-91A driver starts a 256-byte SPI DMA transfer at 8 MHz SCK from a function that returns 2 µs later; the buffer is a local array in that function. Every frame fails CRC at the receiver, and a logic analyzer shows the first 4 bytes correct and the remaining 252 bytes matching whatever the stack holds at that moment. What is the cause and the fix?⌄
MCQ-15A 1 kHz SysTick ISR increments a `uint32_t tick`. After a signed `int32_t` tick caused a wrap bug, a debounce routine that holds a relay for 200 ms is rewritten as:
```c
uint32_t start = tick;
while (tick < start + 200) { /* hold relay */ }
```
A bench test sets `tick` to 4,294,967,196 and calls the routine. The scope measures the relay hold. What does it show?⌄
MCQ-45A Cortex-M4 runs SysTick at 1 kHz and keeps a 32-bit tick counter. A tickless-idle change computes the wake tick and decides whether to enter STOP, and is meant to sleep the full 4 s:
```c
uint32_t now = tick_get(); // 0xFFFFF800
uint32_t idle = 4000; // 4 s at 1 kHz
uint32_t wake = now + idle; // 0x000007A0
if (wake > now) {
enter_stop_until(wake); // STOP until SysTick matches wake
}
```
On the bench the device never enters STOP: average current stays at 6.2 mA instead of 18 µA. Which diagnosis and fix is correct?⌄
MCQ-47A 1 Mbps classic CAN node receives standard 8-byte data frames back-to-back; each frame occupies about 120 µs on the wire including stuffing. The controller's RX FIFO is 3 frames deep, and the ISR drains it into a 4-slot software ring that a task empties. During a flash erase the task is blocked for up to 2.1 ms. Which conclusion about frame loss during that stall is correct?⌄
MCQ-48An STM32F407 idles in Sleep mode (SLEEPDEEP=0) between 1,024-byte SPI2 RX bursts at 4 Mbit/s. The idle task runs a power-down helper that clears DMA1EN in RCC_AHB1ENR, then executes WFI. The burst never completes and SPI2's OVR flag sets. Which change fixes the class of failure?⌄
MCQ-18An STM32F7 runs with the D-cache enabled (32-byte lines, write-back). A 1024-byte DMA receive buffer sits at a 32-byte-aligned address in cacheable SRAM. While processing the previous frame the CPU read the first 512 bytes of that buffer, so those lines are resident; nothing else touches the cache before the CRC. The DMA then writes a new 1024-byte frame into the same buffer. The transfer-complete handler computes a CRC over all 1024 bytes without invalidating the cache. What does the CRC read?⌄
MCQ-98A Cortex-M7 runs with the D-cache enabled in write-back mode. The CPU fills a 512-byte buffer in SRAM with a known pattern, then starts a DMA transfer that sends that buffer out over SPI. A logic analyzer on the SPI lines shows 512 bytes of 0x00, and the receiver's CRC fails. What is the correct remediation?⌄
MCQ-92A bootloader on silicon rev Y (IDCODE 0x2BA0_1417) copies a 393,228-byte image from QSPI flash into SRAM with a single DMA transfer, then CRCs the whole image. Erratum DMA-114: on rev Y, a DMA transfer whose byte count is not a multiple of 16 leaves the last 4 bytes in the FIFO, so the destination's final word keeps its previous value; rev X (IDCODE 0x2BA0_1418) is fixed. On rev Y the CRC fails on every cold boot, the last 4 bytes reading 0xFFFF_FFFF from erased SRAM, and passes on warm reboots. The DMA controller on this part has no FIFO-flush register. Which change is defensible?⌄
MCQ-72A Cortex-M4 board runs at 80 MHz. An ISR writes an 8-byte mailbox payload as two 32-bit stores, then sets a flag word; a task polls the flag and reads the payload. Field returns show 2.1% of 600,000 messages per 10-minute run are torn, and every torn read has the new first word with the stale second word. Halting the core at the flag store makes 600,000 messages clean. ETM is available. Which full-speed result would confirm this mechanism?⌄
MCQ-99Two Cortex-M cores share one 64-byte log record in SRAM, and each appends a record at 1 kHz with no lock. A 10-minute capture holds 1,200,000 writes, and 7.4% of the records contain bytes from both cores. HSEM take and release cost 12 cycles each, the 64-byte copy costs 64 cycles, and the core runs at 64 MHz. What should the driver do?⌄
MCQ-1An STM32F407 (512 KiB flash) firmware build finishes with no errors. The linker script declares FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1M, copied from a 1 MiB part. The map reports .text 480,256 B, .rodata 32,768 B, .data 16,384 B (LMA in flash), .bss 8,192 B. The programmer writes the .bin and reports "verified OK". On reset the device HardFaults with the faulting PC at 0x08080200. What is the correct diagnosis and fix?⌄
MCQ-16A Cortex-M4 firmware with 256 KB of flash builds clean with `-ffunction-sections -fdata-sections -Wl,--gc-sections`. After the startup file's vector table was moved into its own `.isr_vector` section, the board no longer reaches `main`: the debugger halts in `HardFault_Handler` right after reset. The map file shows `.isr_vector` at 0x08000000 with size 0x0, and `.text` starting at 0x08000000. The team must keep `--gc-sections` on to fit the part. Which change fixes the class of failure?⌄
MCQ-19A Cortex-M4 board runs firmware that writes 0xA5A5A5A5 into a 4-byte `__noinit` variable at 0x2000_7FF0, reads it back as 0xA5A5A5A5, then trips the IWDG. VDD stays within spec throughout. The linker script places `.noinit` between `_sbss` and `_ebss`, and the vendor startup code zeroes SRAM from `_sbss` to `_ebss` before `main()`. The bootloader's scratch window is 0x2000_0000–0x2000_3FFF. After the IWDG reset (RCC_CSR.IWDGRSTF = 1), the debugger reads 0x00000000 at 0x2000_7FF0 before `main()` runs. Which change makes the breadcrumb survive the reset?⌄
MCQ-73A Cortex-M4 board runs firmware built from commit 7f2c1a. The debugger has yesterday's ELF from commit 3d90e4 loaded. A breakpoint set on HAL_Delay at 0x08004A10 hits at once, but the disassembly there is `LDR r3, [pc, #0]`, not the delay loop the source pane shows. A CRC32 over the ELF's .text load segment is 0x4E11B2D8; a CRC32 over the same flash region read back through the probe is 0x9A3C1F07. What does this evidence establish?⌄
MCQ-79A Cortex-M4 board stores the faulting PC in a file-scope `uint32_t g_fault_pc` from the HardFault handler, then spins until the 2 s IWDG resets the part. The application prints g_fault_pc over UART at the start of main(). Field logs show 0x00000000 in all 37 resets. Halting in the HardFault handler with a debugger shows g_fault_pc holding the correct faulting address, 0x08004A2C. Which change makes the UART print that address after the watchdog reset?⌄
MCQ-74A shipped sensor node runs on a Cortex-M4. A 20 kHz timer ISR samples at a 50 us period; a separate logging task writes 80-byte telemetry records with SEGGER RTT into a 1 KB up-buffer whose mode is SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL. Boot emits a burst of 64 records and logging then continues at 40 records/s. Bench boards with a probe attached and the PC-side RTT reader running are clean for hours. Boards shipped without a probe reset repeatedly within a second of starting to log: the reset-cause register reads watchdog, no fault is logged, the logging task's stack is intact, and a scope shows the sampling ISR holding its 50 us period right up to the reset. The watchdog window is 200 ms, and nothing in the timing-critical path calls RTT. Why do the field boards reset?⌄
MCQ-75An STM32F4 (Cortex-M4, 168 MHz) receives USART1 RX at 2 Mbaud, 8N1, into a 32-byte DMA circular buffer. The half-transfer ISR drains 16 bytes and increments an overrun counter each time it detects an overrun. Two bench runs of the same binary: (1) SWD debugger attached, a DWT data watchpoint armed on buffer[0] with halt-on-match. The counter reads 0 over 10 s; (2) debugger detached, an ISR-entry GPIO pin captured on a logic analyzer. The counter reads 400 over 10 s and the GPIO pulse is 120 µs wide. What do the two runs establish?⌄
MCQ-78Firmware on a Cortex-M7 streams logs over SWO. The debug probe's SWO receiver is fixed at 2 Mbit/s, 8N1, and cannot be changed. The logger calls ITM_SendChar once per byte to write a 64-byte ASCII line, 2,000 lines/s. The ITM overflow flag is set and roughly a fifth of the lines never reach the host. What is the cause and the right fix?⌄
MCQ-61A 3.3 V sensor node runs a 200 Hz control loop. Each 5 ms period does 200 µs of work in RUN at 12 mA, then holds STOP at 8 µA for the remaining 4.8 ms. Each STOP→RUN wake costs 40 µJ. A current trace of one period is captured. What does it show, and what should the review conclude?⌄
MCQ-64A coin-cell sensor node must average under 12.6 µA to reach its 2-year target from a 220 mAh cell. With the debugger disconnected, the board draws 0.96 mA in STOP 2, against a 1.1 µA datasheet figure. The firmware leaves all 24 unused GPIOs in their reset state (floating input); a floating input on this part draws about 40 µA of shoot-through. An engineer reconfigures 20 of the 24 unused pins as analog inputs and leaves the other 4 floating. What STOP 2 current should the board now draw?⌄
MCQ-68An ultra-low-power Cortex-M4 node sits in STOP 2 between wakes, waking every 60 s for a 20 ms radio burst that averages 12 mA. The part's datasheet gives STOP 2 as 1.6 µA with no RAM retained, plus 0.9 µA for every 16 KB bank kept retained at 3.3 V, 25 C. The linker script puts all 128 KB of .bss in the retained region; the state that must survive STOP is 96 bytes of counters and calibration. The product ships on a 250 mAh coin cell with a three-year life target. What should the team do about the retained region?⌄
MCQ-67A battery-powered STM32F103 board sleeps in STOP between radio polls. The sleep budget is 15 µA. With the SWD probe attached, the board draws 180 µA after WFI; with SWD disconnected it draws 80 µA. The firmware calls PWR_EnterSTOPMode(PWR_Regulator_ON, PWR_STOPEntry_WFI). What should the engineer do next?⌄
MCQ-63A battery-powered STM32L4 sensor wakes every 30 s, takes a reading, then enters STOP. IWDG is enabled with prescaler 256 and reload 1000, clocked by LSI 32 kHz, giving an 8 s timeout. Field units reset every ~8 s; the reset-cause register reads IWDG. Average current is 301 µA against an 8 µA target. The safety case requires the watchdog to remain active in STOP and to reset the MCU within 10 s of a hang. The 30 s STOP interval must stay. What is the correct next action?⌄
MCQ-62A battery product must wake from STOP on a 4 µs GPIO pulse from a sensor. Bench: 6 lost wakes per 1,000 pulses, a second board wired to PE2 never wakes, and STOP current is 8 µA. Which policy is correct?⌄
MCQ-65An STM32L476 board runs FreeRTOS with a 1 kHz SysTick derived from HCLK (80 MHz). A task polls a button, calls vTaskDelay(10), then executes WFI, entering STOP2. The button is not wired to an EXTI wake line. The RTC wakeup timer is clocked from ck_spre at 1 Hz and loaded with WUT = 8; its ISR reconstructs the RTOS tick from the RTC. With SWD detached, a button press is answered after 8 s and the board draws 1.5 µA; with SWD attached, the same press is answered after 10 ms. Which explanation fits these measurements?⌄
MCQ-66A 3.3 V STM32L4 product returns 36 of 2,000 field units with a reset and a config slot whose CRC fails on the next boot. On the bench, a MOSFET sags Vdd to 2.4 V for 80 µs while the firmware is inside a 40 µs flash word program; the word reads back 0x0000FFFF instead of 0x00000000. PVD is disabled and the datasheet requires Vdd ≥ 2.7 V during program. Which remediation does this evidence support?⌄
MCQ-69A battery-powered sensor node runs an STM32L4 in STOP2 and wakes on a button wired to PA0. The button bounces for 4 ms with 9 edges, each holding its level for at least 300 µs. The wake pin passes through a digital glitch filter clocked from the 32.768 kHz LSE; it accepts an edge only after 4 consecutive equal samples (122 µs). There is no software lockout. Bench measurement: each STOP2 exit and re-entry costs 200 µs at 1.0 mA. The button is pressed 1,000 times/day. What does the button cost per day as configured?⌄
MCQ-70A coin-cell bridge node has a 30 µA average budget. The firmware fills a 512 B buffer (256 half-words) with 0xA5, starts ADC1 in continuous 12-bit conversion feeding DMA1 channel 1 in circular mode at 200 kS/s, then idles. Idling with plain WFI (core asleep, clocks running), the transfer-complete interrupt fires every 1.28 ms and the buffer holds real samples, at 410 µA measured. Changing only the idle path to the part's deepest stop mode, the identical code draws 2.1 µA and after 500 ms the buffer is still all 0xA5. What is the fix?⌄
MCQ-77A Cortex-M4 board runs a newlib-based image. On the bench, with an ST-Link attached, the boot banner prints 80 ms after reset and the board settles into STOP at 120 µA. In the field, 8,000 units came back in one week; a returned board draws 18 mA continuously from reset and prints nothing. The binary is identical. What should the review conclude?⌄
MCQ-59An 80 MHz Cortex-M7 runs a 20 kHz PWM current-control ISR: a 50 µs period fixed by the motor's current-ripple spec. The ISR's code and constant tables execute in place from encrypted QSPI flash. Bench data: each QSPI line fill stalls the core 12 µs, the ISR takes three line fills per invocation, and its arithmetic takes 20 µs once the operands are in registers. The motor whines and the phase current spikes every few PWM periods. What worst-case ISR time and placement does the safety case have to carry?⌄
MCQ-60A bootloader parses a 256-byte header. TLV records are 1-byte type, 2-byte little-endian length, then value. The parser uses this code:
```c
uint16_t off = 0;
while (off + 3 <= hdr_len) {
uint8_t type = hdr[off];
uint16_t len = hdr[off+1] | (hdr[off+2] << 8);
off += 3;
uint16_t end = off + len;
if (end > hdr_len) {
return ERR_BAD_TLV;
}
memcpy(dst, &hdr[off], len);
off = end;
}
```
`hdr_len` is 256. `dst` is a 256-byte stack buffer. The header contains a TLV at offset 236: type 0x01, length bytes 0xF0 0xFF. What happens when the parser processes this TLV?⌄
MCQ-84A board taped out with AES-128-CTR image encryption and no authentication. The bootloader decrypts a 384 KB image, checks a 4-byte big-endian magic at plaintext offset 0x00, reads a 4-byte big-endian entry point at plaintext offset 0x10, and jumps. The entry point bytes at 0x10 through 0x13 are 08 01 00 00, giving 0x08010000. An attacker with flash-write access but no key flips the bit with mask 0x80 in the ciphertext byte at offset 0x12. What does the bootloader do?⌄
MCQ-85A fleet of 5,000 devices uses an MCU TRNG to generate a 256-bit boot key. Firmware runs NIST SP 800-90B startup health tests (Repetition Count and Adaptive Proportion over 1,024 consecutive 32-bit samples) then sets TRNG_READY. On one unit, the TRNG data register returns 0xFFFFFFFF for all 1,024 samples; TRNG_READY is set because the FIFO is full, and the boot key becomes 32 copies of 0xFF. The change under review leaves this path as is. What should the review require?⌄
MCQ-53A bootloader for a 900-device fleet runs this sequence on every boot: (1) read the version field from the image header; (2) compare it to the OTP monotonic counter, if version < OTP, refuse; if version == OTP, continue; if version > OTP, burn OTP = version, then continue; (3) verify the ECDSA P-256 signature over the image, and refuse if it fails; (4) boot. OTP is currently 8 and the newest signed release is v9. An attacker with no signing key crafts an image whose header says version 12 and whose signature bytes are random. Which finding should the review record?⌄
MCQ-51A fleet of 4,000 devices boots one application slot. The boot path checks a CRC-32 in the image header and jumps; CRC-32 over the 384 KiB image takes 18 ms at 48 MHz, and total boot is 45 ms against an 80 ms budget. An attacker edits the image sent on the field-update channel, recomputes the header CRC, and the device boots the edited image. Bench: SHA-256 over the image is 26 ms, ECDSA P-256 verify over a digest is 16 ms, and the public key is in OTP, which cannot be rewritten after production. Which fix rejects the edited image and fits the budget?⌄
MCQ-52A fleet of 500 units runs MCUboot in swap-using-scratch mode with slot A (v1.4, confirmed) and slot B (v1.5). The bootloader boots B with image_ok = 0. In main(), the app calls boot_set_confirmed() as its first statement, then runs a 250 ms sensor self-test; if the self-test fails it calls NVIC_SystemReset(). On 12 units the sensor NACKs its first I2C read for 400 ms after power-up, so the self-test fails and the app resets. All 12 units boot-loop on B and never return to A. Which change makes those 12 units fall back to A?⌄
MCQ-54A bootloader updates slot B while slot A runs the current image. Both slots are 40 KB. The update sequence is: (1) write a 16-byte metadata record (1 ms) setting the active slot to B, (2) erase slot B sector by sector from offset 0 (4 KB per sector, 22 ms each, 220 ms total), (3) program slot B (600 ms), (4) verify slot B's CRC (40 ms), (5) reset into B. On every boot the bootloader reads the record and jumps to the slot it names; it does not re-verify that slot's CRC. A unit loses power 80 ms into step 2; the metadata record is intact. On the next boot, what does the device do?⌄
MCQ-55A product ships with a 384 KiB application slot A, a blank 384 KiB slot B (all 0xFF), and a 28 KiB recovery image stored in the last 28 KiB of slot A. At reset the bootloader CRC32s A (9 ms), then B; if both fail it jumps to recovery, which enumerates a signed updater over UART at 115,200 8N1. A field update erases slot A and writes a new 384 KiB image into it in place. After a power loss during that write, 3,200 units returned with both A and B failing CRC and the bootloader stuck in its error-LED loop: recovery never ran. Which diagnosis and fix is correct?⌄
MCQ-56A boot ROM verifies the image in the active slot against the key digests burned in OTP, and refuses any image whose signing key has its revoke fuse burned. Across 500 units, slot A holds an image signed with key 0 and the boot pointer is on A; slot B is erased. Production burns key 1's digest into OTP slot 1, burns key 0's revoke fuse, then writes the key-1 image into slot B and flips the pointer. 180 units come back dead, each reporting a signature-verification failure on slot A. The requirement is that no shipped unit will boot a key-0 image. Which sequence meets that requirement without bricking units?⌄
MCQ-58A bootloader keeps a CONFIRMED bit and a 3-bit trial counter in one metadata slot. On reset it boots the app directly if CONFIRMED is set; otherwise it increments the counter, and at 3 it copies the golden image over the app slot, clears the counter, and boots golden. The app calls boot_confirm(), which sets CONFIRMED and clears the counter, only after its 2 s power-on self-test. The factory fixture programs the app over SWD in 1.1 s and then sets CONFIRMED with NRST held, so the image never executes. A batch of 2,000 units ships with an app image that hangs in sensor_init() before boot_confirm(). What happens on those units' first field power-up?⌄
MCQ-57A dual-slot bootloader runs on a flash MCU whose program granularity is 4 bytes. Each 384 KiB slot ends with a 16-byte trailer stored as four 4-byte words in this order: length, CRC-32, magic 0x504C4F54, sequence. During a field update, power failed after the length word of the target slot was programmed but before its CRC word. The target trailer now reads length=0x0000C000, CRC=0xFFFFFFFF, magic=0x504C4F54, sequence=0x00000001. The old slot's trailer is valid. Which bootloader decision is correct?⌄
MCQ-87An embedded door controller accepts a 64-byte signed unlock frame over UART at 115200 8N1 (about 5.6 ms per frame). The firmware keeps its 4-byte anti-replay counter in flash, accepts any frame whose counter is greater than the stored value, executes the unlock, then writes the incremented counter. The unlock drives a motor that stalls and browns out the supply, so the controller reboots before the counter write completes. A captured frame carries counter 7. Which change closes the replay window?⌄
MCQ-88A fleet gateway enrolls a device by verifying an attestation quote: an ECDSA-P256 signature over the device UID and the PCR[0..7] digest, checked against the vendor root and a fleet-wide golden digest. Over 3 hours the log shows 800 successful enrollments, all carrying the same 64-byte signature and the same UID, from 12 source IPs. Which change stops this?⌄
MCQ-86A TF-M build on an STM32L5 provisions a 32-byte device-unique AES key during a factory step that must finish inside a 20 ms window before the fixture cuts power. On this profile, ITS is an 8 KB region stored unencrypted with no atomicity guarantee across a multi-word write, and PS is an encrypted, authenticated, rollback-protected store whose 32-byte write takes 12 ms. A raw write to 0x0807F000 takes 0.4 ms; in 40 of 40 brownout tests at 16 bytes it left 16 valid bytes followed by 0xFF. Which action is correct?⌄
MCQ-89In a hypothetical 50,000-unit production run, a team ships units with a UART bootloader. The factory test command 0xFE dumps 384 KB of flash in 33 s at 115,200 baud. The parser checks a 1-bit OTP factory-done bit first; blowing it takes 40 ms. The production build still contains the 0xFE handler because a compile-time flag was left on. The fixture used 0xFE because it was faster than SWD. Before the next production run, what should the team do?⌄
MCQ-90A Cortex-M0+ product runs AES-128 in software at 12 µs per block inside a 50 µs control loop. A 1 Ω shunt on the 3.3 V rail, sampled at 1 MS/s and triggered on the AES-done GPIO, recovers the full key from 10,000 traces in about 100 s. The team adds random delays of 0–8 µs before each block; the same attack still recovers the key from 10,000 traces. Which change actually closes the finding?⌄
MCQ-71A team builds an STM32F407 board. The factory fixture loads per-unit calibration over SWD, and the production script then sets RDP level 1 before the units ship with the SWD pads still exposed. The firmware holds a 32-byte AES session key in SRAM while the radio is active. A reviewer attaches a $25 ST-Link to a shipped unit's SWD pads, halts the core, and reads the key out of SRAM. Which change closes the hole without breaking the fixture?⌄
MCQ-76A contract manufacturer builds 5,000 boards around an STM32L4. Station 1 flashes the image over SWD and then immediately sets RDP level 1. Station 2 soaks each board at 85 °C for 4 h and writes the calibration constants that the soak produces, over SWD, then reads them back to verify. On the first 40 boards, station 2 cannot complete its calibration step over SWD. The line supervisor proposes regressing those 40 boards to RDP level 0 and re-running station 2. Which statement about the recovery and the fix is correct?⌄
MCQ-82A fielded STM32L4 board keeps its AES keys in SRAM and ships with RDP level 1 committed in the option bytes, which read back as 0xBB on both banks. A teardown rig power-cycles the board, attaches SWD, and in 3 s reads 96 KB of SRAM containing the keys; every flash read returns 0x00. What does this show, and what is the fix?⌄
MCQ-83A fleet of 20,000 shipped boards derives its MAC as 02:00:00:00:00:00 | (UID & 0xFFFFFF), keeping only the low 24 bits of the 96-bit silicon UID. The backend keys devices on MAC alone. Before the next build, the team wants the expected number of duplicate MAC pairs in the field. Which figure is right?⌄
MCQ-80A board remuxes its SWD pins to GPIO 50 ms after reset to drive a status LED. The ICT fixture attaches its debug probe 80 ms after reset, and every unit fails ICT because the probe can no longer attach. Field units also need SWD for returns analysis. Which change addresses the class of failure?⌄
MCQ-81A team ships 12,000 units of a Cortex-M board. The debug unlock password is a single 64-bit constant at 0x08002200 in .rodata. `strings` on the ELF returns nothing, but a byte-pattern scan of the .bin finds the constant in 2 s. The provisioning station can write OTP in 40 ms per unit. Which plan actually removes the exposure?⌄