cancel
Showing results for 
Search instead for 
Did you mean: 

USB type C P-NUCLEO-USB002 board, Pass through charging

ShashiKumar
Associate II

Hi,

I am new to firmware development and using the P-NUCLEO-USB002 USB type C board for pass-through charging.

I have identified the few hardware settings for the pass-through charging and data communication between USB type C Port_0 and Port_1.

- connected mobile phone to Port_0 

- connected PD charger to Port_1 

- Power Connector CN4 Pins shorting done for Vbus1 and Vbus2 connection

- Removed the jumper connection of JP401 and JP400

Please suggest for below queries.

1) Can we use this pass-through for mobile charging between Port_0 and Port_1?

2) Is there any demo firmware for the Pass-through charging between Port_0 and Port_1? 

3) How to check the status of the PD connection or messages using UART/I2C? ( default firmware received with kit were modified with STSW_STUSB010_v1.3 example codes, But unable to get PD messages on UART. if STSW_STUSB010_v1.3 example codes do not support the UART/I2C debug then please provide the default firmware of the P-NUCLEO-USB002).

4) Can we control and make the decision based on PD messages of SPI/I2C communication between STUSB1602 and STM32F072 controller to control the GPIOs?

 

ShashiKumar_2-1697179408049.png

please find the attachment.

Please suggest.

Thanks & Regards

Shashikumar Rai

 

3 REPLIES 3
NBALL
ST Employee

Hello

To check PD messaging you can use our UCPD monitor https://www.st.com/en/development-tools/stm32cubemonucpd.html which uses UART to output the trace (take care to connect provided wires between CN2-TX of stusb1602 board and CN3-Rx of the nucleo)

As per the picture shared, port0 has source role and port1 has sink role.
You need to refer to schematic for power connection: seems that CN4 pinout you pointed out is not in line with schematic. To fit with your example, I do suggest to
* remove JP401 and JP400
* connect JP001and JP00 to position 1-2 (they are already correct on your picture)
* Then I suggest to connect CN12 (Vbus of port 1) to powconn1/3 of CN4 (pins 1 & 3) which will be the 'input supply' for port0 acting as a source.

About your last question about controlling GPIOs: you can add some GPIO settings based on 'usbpd_notify_xx' from usbpd_dpm_notification function.

Best regards

Nathalie

Hi NBALL, 

As suggested, I have done the same setup and facing the issue. please suggest. 

Without Jumper JP400 and JP401 device through the "Dual Role Port - Unplugged" message. 

I have attached the log of the testing setup, using demo firmware (MB1303_Demo_DRP_CLI.zip).

test details and commands added below, commands for the same are highlighted for your reference.

setup condition 1:  When JP401 and JP400 are Connected.

with setup condition 1, able to change the power profile of the charging adapter at port_1 and able to change the power role of swap of mobile phone from sink to source and vice versa.

Logs for setup condition 1:

*** [0] detached

*** [0] attached on CC2 (Source)

*** [0] selected cap #1

*** [0] selected cap #2

Command not recognised. Enter 'help' to view a list of available commands.

>status 0
*** [0] selected cap #1

Role: Source - Explicit contract CC2 Profile 1 5.00V
>status 1
Role: Sink - Explicit contract CC2 Profile 1 5.00V
>profiles 1
Sink role - Explicit contract
Received Source PDOs:
1) 5.00V 3.00A
2) 9.00V 2.22A
3) 12.00V 1.67A
Local Sink PDOs:
1) 5.00V 3.00A
>request 1 2
Requested 2 : 9.00V 2.22A
>
*** [1] selected cap #2

>request 1 1
Requested 1 : 5.00V 3.00A
>
*** [1] selected cap #1

>prswap 0

*** [0] PRS accepted

*** [0] PRS new role: Sink

*** [0] selected cap #1
Power role swap on Port 0
Current role: Source
New role: Sink
>prswap 0

*** [0] PRS accepted

*** [0] PS Ready received

*** [0] PRS new role: Source

*** [0] selected cap #1

*** [0] selected cap #2
Power role swap on Port 0
Current role: Sink
New role: Source

setup 2:  Removed JP401 and JP400

With setup condition 2, able to request/change the power profile of charging adapter at port_1 but not able to connect the port_0 with the mobile phone.

Logs for setup condition 2:

>status 0
Role: Dual Role Port - Unplugged
>prswap 0
Warning : power role swap not sent, missing explicit contract
>prswap 0
Warning : power role swap not sent, missing explicit contract
>prswap 0
Warning : power role swap not sent, missing explicit contract
>prswap 0
Warning : power role swap not sent, missing explicit contract
>status 0
Role: Dual Role Port - Unplugged
>

please suggest, how to use this board for the Pass-through charging application, with power role and data role swap.

Regards,

Shashikumar Rai

HI NBALL,

Please suggest on below query.

Waiting for your reply.

Thanks & Regards,

Shashi Rai