I believe the state management for Sink mode in my code is now “not completely wrong”, but it certainly has a lot of TODOs, and the USB-PD prescribed timers are all wrong.
I also know of an issue with at least one charger, where it appears in the FUSB RX FIFO a Source_Cap message with no objects appears. But my USB-PD tracer hardware does not see that message! I guess that means its either a problem with the FIFO being ran over or reading the message is broken somehow.
Mostly posting this so interested, and hopefully PD-knowledgable people, can take a look, and maybe we avoid work duplication.
A general observation: from the FUSB datasheet alone it is impossible to know what the host/device/drp software should actually do.
With the USB-PD spec at hand one can at least guess.
A lot of the USB-PD advice on the Internet also seems to be wrong and/or “too simple”. The popular hackaday articles assume a lot without really saying so - DRP is certainly not in scope there…
I downloaded and flashed the latest sysctl firmware from the main branch from source.mnt.re today, which I believe has this update.
I am happy to say my pocket now starts charging while powered up with different USB-C bricks, including the one shipped with the pocket from crowdsuppy