2018-11-02 11:51 PM
Hello there,
I am currently analyzing the STUSB1602 chip and the P-NUCLEO-USB002 eval kit. I have come across a topic I am not fully certain about. Its the SPI interface for the BMC communication. I cannot understand either it is necessary in all applications, or only if I want to exchange some specific data between devices over CC line? For example, if I intend to create a sink only device, so I have to connect the SPI lines and provide any data from the MCU? I would appreciate all help.
Solved! Go to Solution.
2018-11-12 01:59 AM
Hello Lukasz,
As far as I know about this laptop, it is powered by a 240W AC adapter (can you confirm?). This is far above the USB PD spec (100W max). So not sure it is able to be powered directly via type-C port. Same for the Dockin station. I assume it can run Thunderbolt or DP over USB-C, but power capabilities have to be checked. Some high-end laptop or smartphone may support 9V as a SOURCE, but most device support 5V.
In order to test a USB-C port for its power capabilities, you can use the P-NUCLEO-USB002 and associated Command Line Interface. It is able to report the power profiles (SOURCE and SINK) of the device it is attached to. This way, you can check if it matches the STREF-SCS001V1 profiles (5V/1.5A; 15V/1.5A; 20V/1A).
More expensive, the TotalPhase sniffer is a very useful tool for USB-C developpers:
https://www.totalphase.com/products/usb-power-delivery-analyzer/
Rgds,
Benoit
2018-11-12 02:21 AM
Hello Benoit, thank you for answer.
The Dell 7730 machine is a very complicated one. In terms of USB C it doesnt work 100% yet, I am in constant support with Dell. But no matter that, the docking station is able to charge the laptop. The PC consists of 2 USB C ports next to each other. The dedicated docking station for it is the TB18, which consist of this mutant 2x USB C plug:
I dont know this for sure (as it is not written anywhere, and talking to Dell support about such things is pointless, would probably need to talk to the core developer...), but it is designed like this probably because the 240 W you have mentioned is way above the spec of a single USB C cable. But- one can still charge the laptop using a signle USB C cabled docking station, like the one made for small dell latitudes. It simply takes longer to charge then. Another interesting thing is that when the STUSB4500 was connected to the docking station, it reported 5V only at one of the available USB C plugs. No voltage present on the other...
As for your notes- 9 V is not bad, but I really hoped for 15/20V available on the laptops end.
I do have the P-NUCLEO-USB002 kit but the default program there did not report anything on the COM port available through ST-LINK. Do you have any resource on that maybe?
Sorry for condensing so many questions here, but this USB C is still a mystery for me and I really need to understand what going on. The application I plan to use it for is not very "regular" so I need to know all of the ins and outs. Also, the not-standard USB C capabilities of the Dell 7730 doesn't help here. I have the possibility to test it on Dell Latitude 5580 as well though.
Looking forward to your thoughts.
2018-11-12 03:23 AM
There is a P-NUCLEO-STUSB002 Quick start manual on st.com: UM2205. Take care not to forget the TX/RX wires between the NUCLEO board (white) and the Expansion board (blue): cf §1.5.2.2.
I can also recommend the STEVAL-ISC004V1, which is a certified ready to use SOURCE supporting (5V/9V/12V/15V/20V). You can use it as a reference. There is also a GUI including a DASHBOARD running on NUCLEO, which reports to you the power profiles of the SINK you attach to this board.
See bellow MacBook power profile reported by the GUI. Similar test could help to understand your laptop requirements
2018-11-12 03:56 AM
Hello Benoit, thank you for answer. Ok so I took the P-NUCLEO-USB002 and connected the wires and jumpers like advised in the manual. Bellow is a picture:
I connected to the serial console, we are good at this point:
P-NUCLEO-USB00x Demo v1.0.4
Console v0.4
Type help for a list of commands.
STMicroelectronics
Copyright (c) 2017 - All Rights Reserved.
>
The manual proposes to connect both USB C connectors on the PCB together. I understand that they should negotiate which one will be the sink, and which one will be the source. But when I do that:
*** [1] attached on CC1 (Source)
*** [1] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [1] attached on CC1 (Source)
*** [1] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [1] attached on CC1 (Source)
*** [1] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [1] attached on CC1 (Source)
*** [1] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [1] attached on CC1 (Source)
*** [1] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [1] attached on CC1 (Source)
*** [1] detached
And this goes forever. For a test, I now connect the STREF-SCS001V1 to the USB C 0 port of the P-NUCLEO-USB002:
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
*** [0] attached on CC2 (Source)
*** [0] detached
Similar result... So Now I connect the USB C 0 of the P-NUCLEO-USB002 to my laptops hosts USB 2.0 socket (using USB C to USB A 2.0 male plug):
*** [0] attached on CC1 (Sink)
Seems to be working. Now I connect a mobile phone to the other connector of the P-NUCLEO-USB002 using USB C -> USB C cable:
*** [1] attached on CC2 (Source)
*** [1] detached
*** [1] attached on CC2 (Source)
*** [1] detached
*** [1] attached on CC2 (Sink)
*** [1] selected cap #1
Some weird activity but works eventually, the phone is charged.
The question is why doesn't the demo application from the manual work? I would appreciate your further help.
Also sorry for not noticing the uart setup for the P-NUCLEO-USB002 earlier.
2018-11-12 05:18 AM
Lukasz,
I'm not an expert of this board, but please note it is not very convenient for emulating Power Delivery SOURCE, as you need to provide appropriate voltage to make it work above 5V. It is good as a SINK for asking SOURCE profiles.
For above first 2 cases, it looks to go in error recovery, certainly because the 5V is not available on VBUS_SRC. Please check to connect jumpers JP400 and JP401 (which allow to power VBUS_SOURCE from the 5V from the NUCLEO mini-B. It should solves your issue. Then, you can test with your dockin and your laptop, and enter command p [port number 0 or 1]. see >help command
Benoit
2018-11-12 06:12 AM
Benoit, thank you for answer. I did not close the JP400 and JP401 because they were open in the manual. Also the phone was changed, so I thought that was not the case. But yes, after closing them both I was able to successfully connect the USBC 0 and USBC 1 connectors of P-NUCLEO-USB002 board together:
P-NUCLEO-USB00x Demo v1.0.4
Console v0.4
Type help for a list of commands.
STMicroelectronics
Copyright (c) 2017 - All Rights Reserved.
>
*** [0] attached on CC2 (Sink)
*** [1] attached on CC2 (Source)
*** [1] selected cap #1
*** [0] selected cap #1
So now I wanted to test the P-NUCLEO-USB002 -> STREF-SCS001V1 connection. The peripheral was correctly set to source. The thing is I keep getting the "selected cap X" message (I am not sure what does it mean exactly also):
*** [0] attached on CC2 (Source)
*** [0] selected cap #4
*** [0] selected cap #4
*** [0] selected cap #4
*** [0] selected cap #4
And goes on about every 3 seconds...
Do you know maybe what could be the case? Thank you very much for your help so far.
2018-11-12 06:57 AM
By default, the P-NUCLEO-USB002 virtually offers the bellow 4 profiles as a SOURCE,
And a single 5V profile as a SINK
That’s why when you connect both port of the P-NUCLEO together, they both connect at 5 (cap #1 => 5V/1.5A )
On the other side, STREF-SCS001V1 has the following SINK profiles:
So when you connect both card together, the SINK will request PDO4 from the SOURCE (20V – 2A) as it matches what it needs (PDO3 from STREF-SCS001V1). This is what the P-NUCLEO tells you: [0] selected cap #4 (Cap #4 being the PDO4 with 20V – 2.00A.)
The issue is: as the P-NUCLEO, by default, can’t supply the expected 20V, then both devices will Hard reset (open the VBUS switches), terminate the type-C and PD transaction, connect again, identify, negotiate again etc… etc.. in endless loop.
This is why you see the message every few seconds. The boards behave properly, as the High voltage from the SOURCE is missing.
If STREF-SCS001V1 is not able to negotiate more than 5V with your laptop or dockin,
It means those 2 devices can’t offer the 15V;1.5A or 20V / 1.0A requested by STUSB45.
You can use the P-NUCLEO-USB002 as a SINK to understand the profiles from the 2 devices. It should confirm that default profiles from STREF-SCS001V1 is not compatible with your devices.
In this case, there are several ways to reconfigure the SINK profiles in order to align with the SOURCE (either by software with an external MCU or by changing the non Volatile Memory default). I can explain later.
benoit
2018-11-12 06:58 AM
this picture missing
2018-11-12 07:12 AM
Thank you for answer Benoit,
this makes sense. As I dont have all my tools with me at home, I could only hook up 5V to the CN12 connector. When done like this, I see that the STREF-SCS001V1 stopped reseting, but the P-NUCLEO-USB002 did not recognize the STREF-SCS001V1 at all. I believe this is die to the fact that I connected 5V, not higher. On the other hand, when I connected P-NUCLEO-USB002 together, I could freely change the profiles for the sink and the source did no argue at all.
I also don't have my laptop and dock with me.
Could you only confirm either the external voltage provided (as 5V) is too low and this could be the case of the P-NUCLEO-USB002 not seeing the STREF-SCS001V1 at all?
Apart from this, I will test some more tomorrow at work, where I have more voltages to work with and the laptop + docking station. Thank you very much for help.
2018-11-12 07:33 AM
I'm not sure, but I think the P-NUCLEO-USB002 demo code is not checking VBUS voltage is in line with USB PD contract, either as SINK or SOURCE. While STREF-SCS001V1 will do all time long, in order to protect the powered application from a defective SOURCE (9V negotiated for instance but 15V supplied)