I created your seven-page weekly report with two actual PCB images. The full schematic image was too zoomed out to read, so I used a board overview and an enlarged MCU-routing view instead.
Before submitting, fill in your name, course, instructor and reporting dates. The report distinguishes recent progress from cumulative work and clearly states that hardware testing and the final 230 V, 1 hp capability have not yet been demonstrated. Word pagination may vary; the PDF is the checked edition.
Current status — 2026-10-24 R2 DISABLED / NON-ACTUATING
Focused independent-review fixes completed. DO NOT ENERGIZE. No circuit/layout changes, flashing, hardware validation or motor actuation. R2 supersedes/deprecates ALL earlier firmware exports below, which remain historical, not deleted. In particular do not use the earlier PC7 push-pull configuration. The disable invariant remains: START rejected under every qualification combination; PC9 and six raw PWM outputs actively low; TIM1 MOE/AOE/CCER/CR1 zero; no timer/PWM start path.
Completed fixes with exact source references
PC7 external reset contention fixed — src/main.c:9–24.inhibit now writes GPIOC BSRR 0x02000000 (PC9 only). PC7 is INPUT/high impedance, MODER[15:14]=00, PUPDR[15:14]=00, external R51 pulldown; no PC7 BSRR/ODR write, output-low call, internal pull or reset pulse. Verified source and final disassembly: two bic #49152 (0xC000) clears for PC7 mode/pulls; GPIOC output-low calls are only pins9 and8. This is compiled-code inspection, NOT target register readback. Live net rechecked: FAULT_RESET = J5:7/R51:P1/U1:PC7/U23:A, R51:P2 PGND.
Hardware latch explicitly unobservable — src/core.c:57–59, src/main.c:40–67, src/core.h:5–6. Telemetry adds hw_latch=unobservable fault_scope=software; existing state/faults are SOFTWARE status only. Live HW_FAULT = U21 Q/TP17; LATCH_OK = U21 /Q/U24 C; neither reaches MCU. PA6 is RAW ACTIVE_FAULT_N only. HW_FAULT_CLEAR flag means sampled raw input inactive, NOT hardware latch clear. Zero software faults/DISABLED never establishes physical latch clear or readiness to energize.
Software REARM semantics clarified, protocol unchanged — src/core.c:16–32. A single valid REARM frame itself refreshes diagnostic link and may clear software timeout faults if sampled raw fault is inactive. No mandatory preceding STATUS/other valid frame. REARM while DISABLED is rejected; REARM never reads/clears physical hardware latch, drives PC7 or starts output. drive_actuation_allowed remains constant false at line32.
Focused regression tests — tests/test.c:77–97. Added SET/START rejection in SOFTWARE FAULT while raw input is clear; REARM rejection while DISABLED; direct single-frame stale-link REARM recovery; ramp equality/endpoint saturation; telemetry exact-fit/truncated/one-byte/zero-byte capacity and negative-format-return handling. Negative formatter return is injected through HOST-ONLY --wrap=snprintf (tests/test.c:8–13), delegating other calls to real vsnprintf; target uses normal library. No fake target formatter/ADC/watchdog hook.
Stack/harness limitations documented. 4096-byte stack is merely reserved: no MPU/overflow guard, no measured high-water/headroom guarantee. TODO after approved bring-up: watermark/high-water under deepest call/interrupt/error paths, reviewed stack budget and guard strategy. No static estimate is presented as a measurement. PC8 STATUS_OUT still actively low; external harness drive capability UNKNOWN—do not connect an externally driven PC8 signal or assume compatible harness wiring.
Current pinmap and observation limits
Table
U1 physical pin
Port/net
R2 behavior
39
PC7 FAULT_RESET / J5:7
input/high impedance, no internal pull; R51 external pulldown; never MCU-driven or reset-pulsed
GPIO low output initialization still preloads BSRR before output mode. PC7 is excluded from that procedure. Reset-time conditions before code remain dependent on external inhibit/pulldowns and unmeasured. Known physical pin/AF/clock evidence from DS12288 Rev4 remains in the historical sources below and complete current README, not inferred from net labels.
Warning — polling latency: blocking STATUS TX is approximately 15–20 ms nominal at 115200 8N1 (not measured); main-loop PA6 sampling pauses and can miss short raw fault pulses. External hardware comparator/latch/gating path is intended to act independently; its end-to-end capture/latency remains unvalidated. Hardware latch feedback is absent, not simulated. Main/UART/SysTick/electrical behavior is NOT covered by register-free host tests. No actuation is permitted, so no software latency test is a motor safety qualification.
LLVM coverage over core/framer ONLY: 13/13 functions, 71/71 lines, 159/159 regions (100%), 107/108 branches (99.07%). No claim of complete branch, target-main, UART or SysTick coverage. Additional tests exercise actual telemetry negative-return branch; remaining defensive state guard branch is not presented as covered. Final compiler warnings 0, linker warnings 0, -Wall/-Wextra/-Werror. Negative HARDWARE_VALIDATED_UNLOCK=1 compile test rejected as intended. No ARM build/host assertion/sanitizer failures in R2. Packaging first failed due to missing new output parent directory; corrected mkdir(parents=True) and reran complete clean build/package verification successfully.
Source/disassembly invariant check (python3 verify-source.py, also called by verify.sh) passed: no PC7 output drive, PC9-only inhibit mask, eight known output-low pin calls, TIM1 disabled, actuation predicate false, unobservable latch telemetry. Clean packaged-source bash verify.sh also passed, including negative unlock and source/disassembly checks; BIN byte-identical. ZIP integrity and every SHA256 manifest entry verified.
R2 sizes, reproduction and flash reference
GNU Arm GCC 13.2.1, Clang 18.1.3, -Os Cortex-M4 Thumb soft ABI, existing pinned CMSIS. Source on vfd-firmware /root/work/vfd; pre-fix snapshot /root/work/vfd/backups/20261024-r1; clean reproduction /root/work/vfd-review-20261024-r2. make && make host-test; full evidence bash verify.sh. No new SDK download. Source ZIP includes verify-source.py, tests/wrapper, complete vendored headers/licenses, README/pinmap/protocol, linker/Makefile, source delta, logs/disassembly/checksums and artifacts.
Flash section allocation 7077 / 524288 bytes (1.350%), BIN span 7088 bytes including alignment. RAM including .data + .bss + 4096-byte reserved stack4192 / 98304 bytes (4.264%), no heap, separate 32 KiB CCM unused. Stack is not guarded or measured. Flash origin 0x08000000, no bootloader offset. HSI16 nominal16 MHz, no PLL/external crystal, AHB/APBs /1, USART3 BRR139 nominal115107.9 baud before oscillator tolerance, nominal1ms SysTick, all unchanged/unmeasured. BIN SHA256 768263bb2e25849e2f25a5da5bf9e3d3a280d70839fe18d5c61badb95830cc29.
Developer-reference command NOT EXECUTED, not permission to energize: openocd -f interface/stlink.cfg -f target/stm32g4x.cfg -c "program firmware.elf verify reset exit". Use root firmware.elf from new source ZIP (BIN address0x08000000). Hardware release, energy-free isolated approved programming fixture, identity/options verification and isolation/grounding review remain prerequisites.
Scope completion: all five focused firmware/doc/test fixes completed. Blocked: MCU Q7-off remains impossible with direct PRECHARGE_VALID→U25 INP topology; physical latch observation unavailable. Unattempted: hardware programming/energization/latency/stack-watermark/motor tests, hardware changes, active PWM/ADC/watchdog qualification. No second review round initiated. Overall hardware and operational firmware remain incomplete.
Historical 2026-10-24 R1 — DEPRECATED, superseded by R2 above
One bounded hardening pass completed. DO NOT ENERGIZE. No on-target validation, flashing, motor actuation, orders or schematic/layout/part/rule changes. This current section supersedes the dated baseline below. The 48 V nominal / 60 V maximum prototype remains subject to hardware/routing/release holds; requested 20 kHz is not generated or qualified.
Implementation delta and completion
Completed — source inventory and map check: reused vfd-firmware, inspected actual /root/work/vfd/src, tests, Makefile and prior document before editing. Preserved original working source/tests/README/Makefile/linker in /root/work/vfd/backups/20261017. Re-read live U1, U14, U23 and U25 nets; known pin/polarity assumptions remain unchanged. No new SDK/toolchain download.
Completed — parser/framing: shared register-free framer replaces target-only line handling; 31-character bounded parser, overflow/control/NUL/non-ASCII rejection, timeout/error discard through next LF, and CRLF compatibility extension while retaining LF commands. Commands unchanged: STATUS, STOP, REARM, START, SET integer mHz 0..60000. Nonfinite/fractional/signed/exponent/out-of-range values rejected. SET remains metadata only. A syntactically valid truncated numeric value cannot be recognized as corrupted without CRC/length/sequence; this limitation is explicit and cannot enable output.
Completed — faults and readiness: nine observed-positive flags default false: hardware-fault-clear, rail-ready, ADC-valid, ADC-calibrated, bus-ready, precharge-ready, link-fresh, hardware-qualified, timing-valid. Only PA6 hardware-clear and diagnostic link freshness have target observations; all other hooks absent/false, not command-settable. Raw externally supplied LINK_FRESH flags are ignored. START always rejected even with all flags true; actuation predicate is constant false. CHECK/READY remain unreachable placeholders, not implemented precharge sequencing.
Completed — stale link/time: nominal 1 ms SysTick scaffold (HSI16 / 16000) feeds shared unsigned-millisecond logic. Diagnostic NONOPERATING acceptance caps: total frame age 250 ms, link age 1000 ms from complete syntactically valid recognized command. These are not approved motor shutdown/fault timing. Errors/partial/malformed commands never refresh link; recognized but rejected START/REARM can refresh diagnostic freshness, never clear latch. Initial link-unknown observation latches a software fault. Recovery requires explicit REARM with inactive hardware fault and fresh command; returns DISABLED, zero target/ramp, never pulses PC7. STOP is accepted and idempotent even during active fault; never clears latch. STATUS available during fault. No auto restart. Wrap, rollback-fails-closed, expiry/no-resurrection and reset-default behavior tested. Poll must occur at least once per timeout; multiple full wraps/stalled SysTick cannot be inferred. No independent watchdog is implemented.
Completed — build/test/package: actual ARM and sanitizer host builds pass; clean packaged-source rebuild produces byte-identical BIN; ZIP integrity and all SHA256 manifest entries verified. No test assertion/sanitizer failures. Initial ARM compile error src/core.c:20 comparison is always false [-Werror=type-limits] fixed by unsigned enum range test; both builds rerun. Expected HARDWARE_VALIDATED_UNLOCK=1 compile rejection retested.
Blocked — Q7 inactive command: PRECHARGE_VALID remains U20 OUT3 → U25 INP and U14 A, no MCU pin. Firmware cannot force bypass off; no fake hook/control pin was added. GPIO gate=0/MOE=0 does not establish Q7 off. Requires separately approved physical isolation/test setup or reviewed hardware control, neither performed.
Unattempted / deliberately absent: physical programming, energization, UART/gate/timing measurements, motor tests, ADC/deadtime/break qualification, watchdog, rail/bus/precharge sensing, actual precharge sequencing, local controls and GUI HMI. Not complete operational motor firmware or overall design completion.
Seeded parser/byte generator starts 0x4742026; state-property generator starts 0xFA017. Tests cover malformed/nonfinite/range/overlong/truncated input, LF/CRLF resync, frame errors/timeouts, STOP idempotence, immutable START rejection, hardware-fault persistence/manual rearm, stale/lost communications, exact timeout boundaries, uint32 wrap and rollback, reset defaults, arithmetic and telemetry buffer bounds. LLVM coverage over register-free core/framer only: 13/13 functions, 71/71 lines, 98.74% regions and 96.30% branches; no target driver/interrupt/electrical coverage claim. Final compiler warnings 0, linker warnings 0 under -Wall -Wextra -Werror. Logs preserve the initial compile error and expected unlock rejection inside ZIP.
Current build / footprint / reproducibility
GNU Arm GCC 13.2.1, Clang 18.1.3, bare-metal GNU Make, -Os Cortex-M4 Thumb soft ABI, existing pinned CMSIS headers/startup. Editable source /root/work/vfd on vfd-firmware; independent clean review workspace /root/work/vfd-review-20261024. Commands make && make host-test; comprehensive repeatable evidence bash verify.sh including ASan/UBSan, coverage, memory, disassembly and blocked-unlock test. Historical generator scripts excluded from deliverable; do not use them to regenerate current source.
Flash section allocation 7029 / 524288 bytes (1.341%), +372 bytes from prior baseline; BIN span 7040 bytes includes alignment. RAM .data + .bss + reserved .stack4192 / 98304 bytes (4.264%), including 4096-byte stack, no heap; 32 KiB CCM unused. Stack reservation is not measured high-water usage. Flash origin 0x08000000, no bootloader offset. BIN SHA256 c9ab9b4529eb3b59553f0ac980ab52f8bc745b22e37bb4f27374201445c49c9e.
Current pinmap, disable and clock assumptions
Live map rechecked 2026-10-24: U1 PA8/PA9/PA10 raw highs, PA7/PB0/PB1 raw lows, PC9 MCU_GATE_CMD, PC7 FAULT_RESET, PC8 STATUS_OUT, PA6 ACTIVE_FAULT_N, PC10/PC11 UART TX/RX. SystemInit still preloads BSRR low before GPIO output mode, before BSS/constructors; TIM1 BDTR/MOE/AOE=0, CCER=0, CR1=0 repeatedly. No timer/PWM alternate function selected and no counter started; output register commands are not measured physical voltages. PC7 low does not clear U21 because U23 NAND requires PC7 and ACTIVE_FAULT_N high. Reset interval before code still relies on external inhibits/pulldowns, unmeasured. SWD PA13/PA14 preserved; USB_GND isolated from PGND. Full physical-pin/analog-alias table in ZIP README; no guessed ADC channel/AF.
Prior directly consulted DS12288 Rev4 evidence remains applicable: LQFP64 p51; table13 pp74–77 confirms available TIM1 outputs and PA6 BKIN AF6 (unused), USART3 PC10/PC11 AF7; memory pp19–20 and clock section3.11. Source PDF included in ZIP and linked in historical evidence below. Explicit HSI16 nominal16 MHz, no PLL/external crystal, AHB/APBs /1; USART3 BRR139, nominal115107.9 baud before oscillator tolerance. SysTick nominal1ms is unmeasured; blocking telemetry may overrun UART, whose error path discards a frame. This is not a qualified safety scheduler/watchdog. Zero ADC/deadtime/ramp calibration holds remain unchanged.
Current flash command — developer reference ONLY, NOT RUN
Extract source ZIP and use its root firmware.elf (or load BIN at 0x08000000). This command grants no permission to connect power. Bring-up release/isolated energy-free fixture, target identity/options, debugger target power disabled, bus/motor disconnected and approved grounding/isolation are prerequisites. No hardware flashing or on-target verification performed.
Buildable fail-disabled foundation only. DO NOT ENERGIZE. No on-target validation. Only dedicated firmware files/artifacts changed; no schematic/layout changes. Live U1 pin/net map, Project Specification (legacy HV context) and Board Bring-Up Plan were read before source creation. No prior firmware file was listed and no project computer existed.
Completed
Exact STM32G474RET6/LQFP64 CMSIS bare-metal GNU Make build, Cortex-M4 soft ABI, -Os. GNU Arm GCC 13.2.1; Clang 18.1.3 host tests.
Early SystemInit preloads PC9 MCU_GATE_CMD, PC7 FAULT_RESET, PC8 STATUS_OUT and all six PWM GPIOs low. PC7 low does not clear hardware latch. TIM1 BDTR/MOE/AOE, CCER and CR1 remain zero; no PWM AF is selected or counter started. These inhibits are repeatedly asserted. Reset interval still depends on hardware pulldowns/inhibit, not demonstrated waveforms.
USART3 PC10/PC11 AF7 scaffold at nominal 115200 8N1, HSI16 selected explicitly, no external oscillator or PLL. ASCII LF-only commands STATUS/STOP/REARM/START/SET integer mHz; START always rejected. Software rearm returns DISABLED and never pulses hardware latch reset. SET is metadata only.
Hardware unlock set to 1 was tested and deliberately fails compilation. No RUN/actuation implementation exists. CHECK/READY are reserved states only, not a functioning precharge sequencing algorithm.
Archive integrity check passed; startup disassembly inspected; ELF/BIN/MAP and host log exported. Initial build failures (SET/CMSIS enum collision; stack += syntax; missing _init/_sbrk) were fixed and final build/test rerun successfully. Internal source review caught PA6 reset analog mode and explicitly configured digital input before final rebuild.
Error: impossible with current schematic. PRECHARGE_VALID is U20 OUT3 → U25 INP and U14 A, with no MCU connection; U25 controls Q7. Firmware cannot force Q7 bypass off. It does not drive this net or invent a control pin. Approved physical isolation/test configuration or reviewed hardware control remains required. Gate command low and MOE=0 do NOT mean precharge bypass off. Do not power this board to test firmware.
Unattempted / not implemented
Physical flash, energization, SWD/serial measurements, ADC calibration/sampling, timer break routing/latency, deadtime, PWM generation, watchdog, target link timer, local controls, actual precharge state sequencing, motor trials and GUI HMI. Core accepts a link-valid argument, but main does not implement a link-loss timer; no on-target link shutdown claim. ADC/deadtime/ramp timing configuration has explicit zero/invalid holds, not approved values. V/Hz helper is dimensionless arithmetic only; motor voltage/base/boost and timing remain unqualified. Overall hardware and motor-control task remains incomplete.
Build evidence and memory
make && make host-test succeeds. Allocated flash sections including vector/exidx/data 6657 / 524288 bytes (1.270%); BIN load span 6668 bytes includes alignment. RAM data+BSS+4096-byte stack plus alignment 4192 / 98304 bytes (4.264%); separate 32 KiB CCM unused; heap disabled. Linker FLASH origin 0x08000000, no bootloader offset. Stack is reserved, not measured high-water usage. CMSIS device pinned 626ee412334a5ed2e5b320af5a8d77d69f03a558; CMSIS_5 pinned 55b19837f5703e418ca37894d5745b1dc05e4c91. Source ZIP includes vendored headers/licenses, startup, Makefile, linker, README pinmap/assumptions, size/build/unlock logs, disassembly, binaries and SHA256SUMS.
Pin/clock evidence
Live MCU map: raw highs PA8/PA9/PA10, lows PA7/PB0/PB1; MCU_GATE_CMD PC9; FAULT_RESET PC7; ACTIVE_FAULT_N PA6; UART TX/RX PC10/PC11; ADC-related PC0/PC1/PC2/PC3, PA1/PA2/PB11/PB13/PB14. Full physical-pin table in ZIP README. Device datasheet DS12288 Rev4 p51 and table13 pp74–77 confirm available TIM1 CH1/2/3 and CH1N/2N/3N AF6, PA6 TIM1_BKIN AF6, USART3 PC10/PC11 AF7; PWM/break AFs deliberately not enabled. Pages19–20 memory and section3.11 HSI16 nominal16MHz consulted directly by PDF extraction after bundled datasheet query retrieval was incomplete. Source PDF included in ZIP: 2304140030_STMicroelectronics-STM32G474RET6_C521608.pdf . HSI16 explicit SYSCLK; AHB/APBs /1; USART3 BRR139 yields nominal115107.9 baud, before oscillator tolerance. No guessed external crystal/AF/channel.
Flash command — NOT RUN
Only after release holds and approved energy-free/isolated programming fixture: openocd -f interface/stlink.cfg -f target/stm32g4x.cfg -c "program firmware.elf verify reset exit". Verify target identity/options first, debugger target power off, no motor/bus energy, preserve USB_GND/PGND isolation. Existing bring-up plan remains controlling. This is a future command, not authorization to connect power.
Batch completed for safe compile/tests/artifact delivery; Q7 disabled-control requirement failed specifically due to hardware topology. This is not production firmware or overall design completion.
Current status — 2026-10-24 R2 DISABLED / NON-ACTUATING
Completed fixes with exact source references
Current pinmap and observation limits
Final R2 build/test/disable evidence
R2 sizes, reproduction and flash reference
R2 current artifacts — earlier exports DEPRECATED
Historical 2026-10-24 R1 — DEPRECATED, superseded by R2 above
Implementation delta and completion
Actual verification evidence
Current build / footprint / reproducibility
Current pinmap, disable and clock assumptions
Current flash command — developer reference ONLY, NOT RUN