# A83 current commissioning boundary

This is an OFF-STATE commissioning candidate. TIM1 channels/MOE, six PWM GPIO and RUN stay off. Sampling is not operation of a motor, and this code is not an independent hardware overcurrent cutoff. No physical tests have occurred. FABRICATION_HOLD remains.

Prerequisites for a future qualified bench: A82 feedback assembly (R2=0R, R3=DNP, C14=100n), inspected power/current-limit/clamp setup and factory DFM; measured DRV_AVDD/VREF, MCU VDDA and actual clock; physical bridge-off and mechanically stationary/zero-current condition; qualified SPI mode/gain/NPOR traces and actual ADC/DMA trigger/settling waveforms. Gain, polarity, CSA current-induced correction, low-side valid aperture and independent cutoff require separate validation. The routine cannot detect a sensor stuck at a plausible zero from a zero-current record alone.

Only a reviewed bench harness may call drill_current_bench_begin(profile, now, true) after real DRV configuration and DMA stream acquisition. The boolean is an operator assertion, not firmware proof. Default main never calls begin, there is no SWD start latch, and writing state/DU_STREAM/DC_READY directly must not be treated as a physical test. Profiles supply measured ADC reference 2.8..3.6V and tied-AVDD reference 3.135..3.465V; the internal conversion still uses nominal 0.3V/A. A calibrated gain is not loaded in this version.

Convergence requires256 accepted pairs, each inside the candidate zero band around measured VREF/2 (+/-40mV), peak-to-peak <=16 ADC counts, no sequence gaps/duplicates and continued off interlocks. At a real20kHz nominal period the acquisition would take12.8ms; this period has not been measured. No pair may age>30us, no new pair for>100us fails, total zero collection>20ms fails. Dual/DMA service retains its stricter30us foreground guard. du_sample.armed_us is stream origin, not aperture time. A fresh TIM2 read prevents old caller timestamps rejecting later observed pairs.

80-byte drill_debug_current layout is in drill_current.h; Q8 zeros are ADC-code averages times256. flags1 means software zero convergence, flags2 nominal current values available, flags4 C reconstructed. None means physical calibration. sense_a/b are nominal low-side currents; C=-A-B is a reconstruction, not an independent check or validated FOC phase current. Exceeding the selected1..2000mA nominal threshold latches CQ_LIMIT and aborts ADC/DMA, driver/SPI and charge; it does not prove an actual2A trip, and default off-state interlocks preclude applying it to a running motor yet. Loss of guards, stale/missing samples and arithmetic-input validation also latch hard-off. There is no retry/reset API.

Read: epoch-before,80 bytes,epoch-after; accept only equal nonzero even epochs matching the block. If the running loop prevents a coherent live read, discard and retry; after failure the record stays latched. The104-byte A80 timing capture does not contain this current block. For a complete accepted service, require same valid timing-window context as well as current-state/fault/flags; a timing PASS alone cannot override CQ_FAILED. Do not pause the core to infer timing. Raw stream counters are not incremented for a pair that triggers current failure.

python3 decode_current.py current.bin --epoch-before N --epoch-after N checks layout and candidate consistency only. Decoder always leaves physical/source/gain/cutoff/third-phase/run permission false. MODEL_ONLY_current_A83_* files come from Unicorn; never label them MCU captures. File metadata, firmware SHA, board serial, instruments/calibration, measured references, reference-current sweeps, trace timestamps, raw waveforms and reviewer signoff must accompany future real evidence. Actual effective thresholds, stop time, IRQ/bus latency, continuous sampling, blocked-rotor/regeneration and original-product effects remain open.
