I saw “Charge mode” feature on a new VESC based controller:
https://endless-sphere.com/forums/viewtopic.php?f=31&t=99621
Basically it turns the controller into a boost converter and you could use any DC power source to charge you battery through motor phase wires.
This seems like a super cool feature to have.
Does it need specific hardware changes, or is it purely sw thing?