2023-11-06 08:18 AM
Hi,
I'm a researcher at MIT and I'm pretty new to the ST world, I'm working on a USB power delivery application for a robotics project where I would like to use an STM32 MCU + an X-NUCLEO-SRC1M1 to deliver 20V over USB-C (as well as data over D+ and D-) to a Sparkfun STUSB4500 USB-C Power Delivery Board (https://learn.sparkfun.com/tutorials/power-delivery-board---usb-c-qwiic-hookup-guide).
Issue:
After plugging in my STUSB4500 sink board, there is no negotiation completed. The source is able to send out it's power delivery capabilities, but no messages are received from the sink in the traces of STM32CubeMonitor.
OUT 471419 0 SOP PD3 s:010 H:0x27A1 (id:3, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11880
OUT 471421 0 SOP PD3 s:010 H:0x27A1 (id:3, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11881
PE 471423 0 PE_SRC_DISCOVERY 11882
PE 471573 0 PE_SRC_SEND_CAPABILITIES 11883
OUT 471575 0 SOP PD3 s:010 H:0x29A1 (id:4, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11884
OUT 471576 0 SOP PD3 s:010 H:0x29A1 (id:4, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11885
OUT 471578 0 SOP PD3 s:010 H:0x29A1 (id:4, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11886
PE 471580 0 PE_SRC_DISCOVERY 11887
PE 471730 0 PE_SRC_SEND_CAPABILITIES 11888
OUT 471732 0 SOP PD3 s:010 H:0x2BA1 (id:5, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11889
OUT 471733 0 SOP PD3 s:010 H:0x2BA1 (id:5, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11890
OUT 471735 0 SOP PD3 s:010 H:0x2BA1 (id:5, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11891
PE 471737 0 PE_SRC_DISCOVERY 11892
PE 471887 0 PE_SRC_SEND_CAPABILITIES 11893
OUT 471889 0 SOP PD3 s:010 H:0x2DA1 (id:6, DR:DFP, PR:SRC) SRC_CAPABILITIES DATA: 0A9001002C410600
Option:
[1] Fixed : 5V - 0.1A
[2] Fixed : 20V - 3A
11894
On the oscilloscope, the sink board gets a 20V spike that then decreases since the power delivery negotiation never finishes.
I do not think this is a sink issue as connecting the sink to a USB-C Dewalt charging power brick that delivers 65W can provide a sustained 20V after 5V. The negotiation seems to complete itself.
Hardware Setup:
I've connected a 20V supply to CN3 of the SRC1M1 board and validated 20V is going into the terminal. A USB-C power cable is connecting CN1 to the Sparkfun power delivery sink board. A Micro-USB cable connects the STM32 NUCLEO-G0B1RE MCU to my computer to view debug logs. I connected the oscilloscope probes to the output power terminals of the sink board.
Software Setup:
I've followed the USB PD wiki closely (https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Source) and made an STM32 project using the STM Cube IDE (https://github.com/michaellu2019/STM32G0_USBPD_Source) for the Nucleo G0B1RE board. I've downloaded the STM32 Cube Monitor to see debug logs. I have also tested uploading a completed binary (https://github.com/STMicroelectronics/x-cube-tcpp/blob/main/Projects/NUCLEO-G474RE/Applications/USB_PD/SRC1M1_Source/Binary/G4_SRC1M1_Source.bin) to my Nucleo-G474RE to cross check my software, but run into the same issue of no sink communication. The Sparkfun STUSB4500 board has been configured to receive 20V 3000mA, which is one of the listed PD options in the SRC1M1.
Please let me know if there is something I'm missing in my project setup, whether that be following the wiki to set up the G0 or if downloading the G4 binary is not sufficient to set up a project. Happy to set up a call to expedite the discussion.
Thanks,
Michael
2023-11-09 07:59 AM
Thank you all for the replies. A few questions:
Thank you!
2023-11-09 08:57 AM
Below board possibilities:
* NUCLEO + X-NUCLEO : MCU with PD-controller + HV interface + protection for a single type-C SOURCE port. A PD compatible source driven by MCU resources (I2C or GPIO) is needed. The solution is USB-PD 20V-5A compliant. STM32 data can be activated.
* STEVAL-2STPD01 : MCU + PD-controller + DC/DC + protection for dual dual type-C adapter. A 24V (60W for one port or 120W for two ports) DC source needs to be connected. Data are not available as this reference design is an adapter.
To match to your case, it seems that a specific HW development is required. DIY with flying wires is a good way to secure HW development. I would suggest : STEVAL-2TPD01 (single port used) plug on top of NUCLEO-G0B1RE because STM32G0B1RE embbeds USB-HOST interface + power delivery controller. Then pick USB D+/- directly from the type-C connector (R508 footprint) with flying wire to the MOSPHO connectors to be connected to the STM32.
It is not granted at all but it is one proposal to perform a POC (prof of concept) before moving to the final board. You need to check my assumption on NUCLEO + STEVAL pairing. To conclude, it is a low cost suggestion compared to a full HW project to develop your SW solution.
Best regards,
Mathieu
2023-11-09 09:08 AM - edited 2023-11-09 09:09 AM
* NUCLEO + X-NUCLEO : MCU with PD-controller + HV interface + protection for a single type-C SOURCE port. A PD compatible source driven by MCU resources (I2C or GPIO) is needed. The solution is USB-PD 20V-5A compliant. STM32 data can be activated.
Thank you for your help! Sounds like the STEVAL-2STPD01 does not allow for data delivery without a hacky solution, and the Nucleo-SRC1M1 can deliver up to 20V-5A and also has the D+/D- lines exposed for data delivery. Unless I am misunderstanding what "USB-PD 20V-5A" entails, would it be possible to provide pointers (beyond datasheets and quick start guides easily accessible on the product page) on the NUCLEO-SRC1M1 so that I can bypass the "security fault issue" and deliver 20V to my sink device?
Thanks!
2023-11-09 05:16 PM
Hello
What I was trying to suggest is to keep your current setup.
By comparing the files I pointed out you should see where SW asks HW to perform voltage transition.
Based on that, you can connect your own favorite power source (DCDC/LDO/...) to SRC connector and only use 1 GPIO that you set in your SW to force the voltage transition: this GPIO can be used as enabling 20V and disabling 5V which is all what you need.
What's important is to transition with proper timings and to always start with 5V.
Best regards
Nathalie
2023-11-17 05:51 PM - edited 2023-11-17 06:28 PM
Thank you, I apologize for the confusion @NBALL. I have been able to source 5V from the SRC1M1 when configuring the sink board to request 5V and when applying 5V to the SRC1M1 through CN3. Let's continue this discussion only about the SRC1M1 board.
/**
* @brief Find out SRC PDO pointed out by a position provided in a Request DO (from Sink).
* @param PortNum Port number
* @param RdoPosition RDO Position in list of provided PDO
* @param Pdo Pointer on PDO value pointed out by RDO position (u32 pointer)
* @retval Status of search
* USBPD_OK : Src PDO found for requested DO position (output Pdo parameter is set)
* USBPD_FAIL : Position is not compliant with current Src PDO for this port (no corresponding PDO value)
*/
USBPD_StatusTypeDef USBPD_PWR_IF_SearchRequestedPDO(uint8_t PortNum, uint32_t RdoPosition, uint32_t *Pdo)
{
/* USER CODE BEGIN USBPD_PWR_IF_SearchRequestedPDO */
if((RdoPosition == 0) || (RdoPosition > *PWR_Port_PDO_Storage[PortNum].SourcePDO.NumberOfPDO))
{
/* Invalid PDO index */
return USBPD_FAIL;
}
*Pdo = PWR_Port_PDO_Storage[PortNum].SourcePDO.ListOfPDO[RdoPosition - 1];
return USBPD_OK;
/* USER CODE END USBPD_PWR_IF_SearchRequestedPDO */
}