USB-PD default role initialize & change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-28 9:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-28 9: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-28 10:03 AM
My problem is:
- when I power my STM32, I don't know the power supply to STM32 is from Adapter or Vbus of Phone ( because ADC init and convert slow, when app task run I can know )
- If I want my Port is source, I must wait cable connect and change to source by PowerRoleSwap ( because default is Sink )
Can I change my port is source even no cable connect?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-28 10:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-30 2: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-07-30 2: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 !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-11 2: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).
