2021-07-28 09:52 AM
2021-07-28 09:56 AM
Hello @H V N D ,
I'm not sure to fully understand.
If you have DRP, and nothing is connected, your port Role has to toggle.
You have a DRP, and in case you are connected as a source, you want to switch to sink role ?
In this case you have to request a power role swap.
Sequence is indicated on our wiki.
Is that what you are looking for ?
Nicolas
2021-07-28 10:03 AM
My problem is:
Can I change my port is source even no cable connect?
2021-07-28 10:08 AM
2021-07-30 02:13 AM
You can change role when you are not yet attached; that's the purpose of role toggling when you are DRP (dual role power) capable.
And when you are attached, you can request a role change by sending a message, like mentioned in previous message on the wiki.
Using the UCPD in our microcontrollers, the role toggling has to be done by the application : it is not automatically done by hardware.
2021-07-30 02:17 AM
Can you precise your question ?
Is your device DRP capable ? Or source only ?
The variable DPM_Param[portnum].PE_PowerRole (structure USBPD_ParamsTypeDef), defined in the file usbpd_def.h, contains the current role information. So you can base you application on this information.
Can you share a .cpd file, generated thanks to STM32CubeMonitor-UCPD ?
This will show dynamic execution, and confirm the role toggling. Very useful !
2024-12-11 02:14 PM
I have a similar situation. At certain times my device is not capable of providing a charge so it should be SNK only. When it can provide a charge it should be DRP toggling. But this driver doesn't allow that. You must pick a mode and stick with it.
1. You are always a SNK.
2. You are always a SRC.
3. You are always DRP (toggling).