cancel
Showing results for 
Search instead for 
Did you mean: 

How to setup USB-C PD Source using NUCLEO-G491RE with X-NUCLEO-SRC1M1 Extension?

AChin.3
Associate II

Hello,

I am a newcomer to the ST world- I am working with VW of America and UTK on a senior design project.

I am attempting to setup a USB-C PD source application using a NUCLEO-G491RE Connected to a SRC1M1 extension board. I have tried directly loading the src1M1 example project in x-cube-tcpp (nucleo-g474re/applications/USB_PD/SRC1M1_Source) and following this guide on the wiki. For the wiki project, I applied the correct BSP and adjusted the .extsettings file to point to the correct BSP.

When monitoring stcubemonitor-UCPD, neither stack seems to be responding in the desired manner, and no contract is negotiated.

What further steps should I be taking to set up my USB-C application? I know this is a desired function from ST, so it should be pretty simple.

10 REPLIES 10
Nicolas P.
ST Employee

Hello @AChin.3​ 

Have you enabled the embedded debug tracer as described here ?

You can also compare the project available on github for NUCLEO-G474RE, it should be similar.

Does something live in the trace window on the right in STM32CubeMonitor-UCPD, following this wiki ?

If yes, can you share the content ?

Nicolas

AChin.3
Associate II

The following is the trace that occurs with my project which followed this wiki.

If I load the src1m1 project from x-cube-tcpp by selecting the ioc file in STM32CubeIDE, building it, and running it, I do not get anything in the trace.0693W00000YAOXKQA5.jpg

During the trace above I did connect a USB-C capable device.

PPAIL.1
ST Employee

Hello @AChin.3 (Community Member)​ 

Please can you try the binary supplied in x-cube-tcpp for scr1M1 on Nucleo-G4 and let us know if it works ?

Pascal

AChin.3
Associate II

When I load that program I do not see my device available on ucpd monitor and I do not see anything on any trace - and there is nothing happening when I plug in the device.

I did identify a potential issue. I connected a dc power supply to cn3, but I connected it to the ground side of the header for a few seconds. I do not believe my supply dissipated any power into the device, but hardware issues are a potential culprit.

Nicolas P.
ST Employee

Hello @AChin.3​ 

Just did the test with a Nucleo STM32G491, with binary from github. (Even if the binary is for a STM32G474...)

Here is what I get in the trace windows of STM32CubeMonitor-UCPD, on startup :

0	DEBUG	0	0	-- BSP_USBPD_PWR_Init --
1	DEBUG	678	0	-- BSP_USBPD_PWR_SetRole : SRC --
2	DEBUG	678	0	-- BSP_USBPD_PWR_SetPowerMode --
3	DEBUG	678	0	-- Low Power --
4	CAD	679	0	USBPD_CAD_STATE_DETACHED

And when I plug a STM32G0-Disco, I get :

11	DEBUG	6895	0	-- BSP_USBPD_PWR_VBUSInit --
12	DEBUG	6895	0	-- BSP_USBPD_PWR_SetPowerMode --
13	DEBUG	6895	0	-- Normal --
14	CAD	6895	0	USBPD_CAD_STATE_ATTACHED_WAIT
15	CAD	7016	0	USBPD_CAD_STATE_ATTACHED
16	NOTIF	7016	0	USBSTACK_START
17	DEBUG	7016	0	ADVICE: USBPD_DPM_Notification:104
18	EVENT	7016	0	EVENT_ATTACHED
19	DEBUG	7016	0	VBUS ON
20	DEBUG	7016	0	-- BSP_USBPD_PWR_VBUSOn --
21	DEBUG	7016	0	-- GDP/GDC setting : SRC --
22	PE	7016	0	PE_SRC_STARTUP
23	NOTIF	7016	0	POWER_STATE_CHANGE
24	DEBUG	7016	0	ADVICE: USBPD_DPM_Notification:90
25	PE	7016	0	PE_SRC_SEND_CAPABILITIES
26	OUT	7018	0	SOP	 PD3	s:006	    H:0x11A1    	(id:0, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	Option: 	 [1] Fixed : 5V - 1.5A / 
27	OUT	7019	0	SOP	 PD3	s:006	    H:0x11A1    	(id:0, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	Option: 	 [1] Fixed : 5V - 1.5A / 
28	OUT	7021	0	SOP	 PD3	s:006	    H:0x11A1    	(id:0, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	Option: 	 [1] Fixed : 5V - 1.5A / 
29	PE	7022	0	PE_SRC_DISCOVERY
30	PE	7172	0	PE_SRC_SEND_CAPABILITIES
31	OUT	7174	0	SOP	 PD3	s:006	    H:0x13A1    	(id:1, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	Option: 	 [1] Fixed : 5V - 1.5A / 
32	IN	7175	0	SOP	s:002	    H:0x0201     (id:1, DR:UFP, PR:SNK) 	GOODCRC
33	NOTIF	7175	0	SRCCAP_SENT
34	DEBUG	7175	0	ADVICE: USBPD_DPM_Notification:15
35	PE	7175	0	PE_SRC_WAIT_REQUEST
36	IN	7177	0	SOP	 PD3	REQUEST	s:006	    H:0x1082    	(id:0, DR:UFP, PR:SNK)  DATA: 96580211 / ObjectPosition:1 / GiveBack:0 / CapabilityMismatch:0 / USBCommunicationCapable:0 / NoUSBSuspend:1 / UnchunkedExtendedMessagesSupported:0
37	OUT	7177	0	SOP	s:002	    H:0x0161     (id:0, DR:DFP, PR:SRC) 	GOODCRC
38	PE	7177	0	PE_SRC_NEGOTIATE_CAPABILITY
39	OUT	7177	0	SOP	 PD3	ACCEPT	s:002	    H:0x05A3     (id:2, DR:DFP, PR:SRC) 
40	IN	7179	0	SOP	s:002	    H:0x0401     (id:2, DR:UFP, PR:SNK) 	GOODCRC
41	PE	7179	0	PE_SRC_TRANSITION_SUPPLY
42	NOTIF	7209	0	POWER_STATE_CHANGE
43	DEBUG	7209	0	ADVICE: USBPD_DPM_Notification:90
44	PE	7209	0	PE_SRC_TRANSITION_SUPPLY_EXIT
45	OUT	7211	0	SOP	 PD3	PS_RDY	s:002	    H:0x07A6     (id:3, DR:DFP, PR:SRC) 
46	IN	7212	0	SOP	s:002	    H:0x0601     (id:3, DR:UFP, PR:SNK) 	GOODCRC
47	NOTIF	7212	0	POWER_STATE_CHANGE
48	DEBUG	7212	0	ADVICE: USBPD_DPM_Notification:90
49	NOTIF	7212	0	POWER_EXPLICIT_CONTRACT

You should check for the messages : DEBUG -- BSP_USBPD

Because they are linked to the nucleo-src1m1 shield, and the BSP that controls the TCPP02 which enables the VBUS.

AChin.3
Associate II

Hello,

I have figured out why my software was not behaving and am now getting good communication between the board and my UCPD monitor/device. However, I am still not charging my device even though I have powered the CN3 header. I have supplied 20V and the D7 LED is on. I have attached my trace. That cycle of src_capablities continues infinitely.

DEBUG	439693	0	-- BSP_USBPD_PWR_VBUSInit --	0	
DEBUG	439693	0	-- BSP_USBPD_PWR_SetPowerMode --	1	
DEBUG	439693	0	-- Normal --	2	
CAD	439693	0	USBPD_CAD_STATE_ATTACHED_WAIT	3	
CAD	439815	0	USBPD_CAD_STATE_ATTACHED	4	
NOTIF	439815	0	USBSTACK_START	5	
DEBUG	439815	0	ADVICE: USBPD_DPM_Notification:104	6	
EVENT	439815	0	EVENT_ATTACHED	7	
DEBUG	439815	0	VBUS ON	8	
DEBUG	439815	0	-- BSP_USBPD_PWR_VBUSOn --	9	
DEBUG	439815	0	-- GDP/GDC setting : SRC --	10	
PE	439815	0	PE_SRC_STARTUP	11	
NOTIF	439815	0	POWER_STATE_CHANGE	12	
DEBUG	439816	0	ADVICE: USBPD_DPM_Notification:90	13	
PE	439816	0	PE_SRC_SEND_CAPABILITIES	14	
OUT	439818	0	SOP	 PD3	s:006	    H:0x11A1    	(id:0, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	15	
OUT	439819	0	SOP	 PD3	s:006	    H:0x11A1    	(id:0, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	16	
OUT	439821	0	SOP	 PD3	s:006	    H:0x11A1    	(id:0, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	17	
PE	439822	0	PE_SRC_DISCOVERY	18	
PE	439972	0	PE_SRC_SEND_CAPABILITIES	19	
OUT	439974	0	SOP	 PD3	s:006	    H:0x13A1    	(id:1, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	20	
OUT	439975	0	SOP	 PD3	s:006	    H:0x13A1    	(id:1, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	21	
OUT	439977	0	SOP	 PD3	s:006	    H:0x13A1    	(id:1, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	22	
PE	439978	0	PE_SRC_DISCOVERY	23	
PE	440128	0	PE_SRC_SEND_CAPABILITIES	24	
OUT	440130	0	SOP	 PD3	s:006	    H:0x15A1    	(id:2, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	25	
OUT	440131	0	SOP	 PD3	s:006	    H:0x15A1    	(id:2, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	26	
OUT	440133	0	SOP	 PD3	s:006	    H:0x15A1    	(id:2, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	27	
PE	440134	0	PE_SRC_DISCOVERY	28	
PE	440284	0	PE_SRC_SEND_CAPABILITIES	29	
OUT	440286	0	SOP	 PD3	s:006	    H:0x17A1    	(id:3, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	
Option: 	
 [1] Fixed : 5V - 1.5A
	30	
OUT	440287	0	SOP	 PD3	s:006	    H:0x17A1    	(id:3, DR:DFP, PR:SRC) 	SRC_CAPABILITIES	DATA: 96900100	

Hello @AChin.3​ 

In the trace you shared above, I see no "incoming" messages.

Are you sure your sink device is PD capable ? What is the model ?

But still we some messages that VBUS is on. Have you measured the VBUS voltage on the connector ?

Regards,

Nicolas

I have tried a google pixel 6 and a Samsung galaxy s8 as my sink devices. If I use the same cable and device on a different USB charger, it works just fine and charges with USB PD. I have been using a DC power supply, so I am sure the voltage going into cn3 is 20V.