cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 + X-NUCLEO-SRC1M1 Not Detecting Sink Negotiation Message

mlu0708
Associate II

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.

mlu0708_5-1699287067579.png

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.

mlu0708_6-1699287132602.png

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.

mlu0708_0-1699286564202.png

mlu0708_1-1699286625168.png

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.

 

mlu0708_3-1699286893199.png

 

mlu0708_2-1699286879131.png

 

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

 

 

 

 

14 REPLIES 14
mlu0708
Associate II

Thank you all for the replies. A few questions:

  1. You seem to be pushing to use this STEVAL-2TPD01 board (and not the SRC1M1 that I am working with and asking about) which is over 3x more expensive than the SRC1M1. Is this because it is easier to configure/better to use the STEVAL-2TPD01 for high voltage USB-C power delivery? Or is it because it is simply impossible to delivery 20V with the Nucleo-SRC1M1, and this alternative is the only option?

  2. Are the data lines D+ and D- exposed on the USB-C line to some GPIO pin so that I can pass both power and data thru the cable? not sure if I see the connection when looking at the board schematic. This is a crucial design requirement for my project. 

Thank you!

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


* 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!

NBALL
ST Employee

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

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.

  1. Regarding using a GPIO pin to "force the voltage transition," are you saying use a GPIO pin to switch the voltage level going into CN3, i.e. using a transistor/relay to literally change the voltage going into my source board? If this is what you're suggesting, then I am confused how much the source board can actually benefit me at all besides having a USB-C cable. I was under the impression the SRC1M1 handles this switching automatically: I can always provide 20V to the board, and when I plug in different sink devices that require either 5V, 15V, or 20V, etc. the SRC board automatically sends that voltage level (with the appropriate voltage transitions you are mentioning).

  2. So I am checking the usbpd_dpm_user.c files and the usbpd_pwr_if.c files and the only method that seems related is USBPD_PWR_IF_SearchRequestedPDO() in usbpd_pwr_if.c. Are you saying that I would have to edit this method? Could you be more specific about what extra code I would have to add to what method to change the supply voltage from 5V to 20V when the sink requests it?

 

 

/**
  * @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 */
}