MustafaMulla29/rp2040-bldc-motor-controller-new

A USB‑C PD–powered RP2040 BLDC motor controller PCB with 3.3 V logic, MCT8329A sensorless commutation, three MOSFET half-bridges, protected power switching, USB data, controls, and motor connectors.

Version
0.3.82
License
unset
Stars
0

firmware/verify_pd_boot.py

"""After complete power removal, verify NVM-loaded profiles WITHOUT RAM writes."""
from machine import Pin, I2C
from pd_nvm import NVM
from pd_profile import nvm_is_9v, verify_runtime

Pin(2, Pin.OUT, value=0)
Pin(3, Pin.OUT, value=0)
bus = I2C(1, sda=Pin(22), scl=Pin(23), freq=100_000)
verify_runtime(bus)
if not nvm_is_9v(NVM(bus).read()):
    raise OSError("Stored PD profile is not provisioned")
print("PASS: cold-start profiles are 5 V / 0.5 A and 9 V / 2 A; PDO3 inactive and also 9 V.")
print("Next: use a PD analyzer to check attach, reset and reconnect with a 5/9/15/20 V source.")