UM2051 User manual Getting started with the STM32 Nucleo pack for USB Type-C™ and Power Delivery Introduction The STM32 Nucleo pack for USB Type-C™ and Power Delivery (P-NUCLEO-USB001) is a kit based on a NUCLEO-F072RB board and on a USB Type-C™ Power Delivery expansion board (MB1257). The expansion board features two DRP USB Type-C™ ports with a discrete Analog Front-End PHY for USB Type-C™ configuration and management. A complete and certified USB Power Delivery middleware stack, compliant with the USB Type-C™ 1.2 and the Power Delivery 2.0 specifications, running on the STM32F072 MCU, provides the means to control the two USB Type-C™ ports and allows the communication over CC lines using the Power Delivery communication protocol (for all the details refer to the USB Type-C™ Power Delivery on STM32F0 Series embedded software expansion for STM32Cube databrief (DB2957) at the www.st.com website).This document describes the hardware environment to build the system and to run an application based on the P-NUCLEO-USB001 pack. Figure 1. P-NUCLEO-USB001 June 2016 DocID029204 Rev 1 1/16 www.st.com 1 Contents UM2051 Contents 1 Getting started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.1 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.2 The P-NUCLEO-USB001 demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.3 Configuration setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.4 2 2/16 1.3.1 Standalone demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 1.3.2 Other demonstration with external hardware . . . . . . . . . . . . . . . . . . . . . 11 Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 DocID029204 Rev 1 UM2051 List of tables List of tables Table 1. Table 2. Table 3. Description of connectors, jumpers and LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Description of the CLI commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 DocID029204 Rev 1 3/16 3 List of figures UM2051 List of figures Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. 4/16 P-NUCLEO-USB001. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 P-NUCLEO-USB001 system architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 MB1257 USB-C Power Delivery expansion board and NUCLEO-F072RB assembled . . . . 8 MB1257 connectors, jumpers and LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Screenshot of the CLI and list of available commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 CLI when the cable is unplugged on PD port (PORT_0) . . . . . . . . . . . . . . . . . . . . . . . . . . 12 CLI when PD PORT_0 is plugged to the USB Type-C only PORT_1. . . . . . . . . . . . . . . . . 13 CLI when PD port (PORT_0) is connected to a Consumer . . . . . . . . . . . . . . . . . . . . . . . . 13 CLI when PD port (PORT_0) is connected to a Provider . . . . . . . . . . . . . . . . . . . . . . . . . . 14 CLI after a request to change the power profile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 DocID029204 Rev 1 UM2051 Getting started 1 Getting started 1.1 System architecture The STM32 Nucleo pack for USB Type-C™ and Power Delivery is composed of two main blocks (see Figure 2): Note: • A control block: the NUCLEO-F072RB board where the stack is running • A Type-C interface: the MB1257 expansion board A certified USB Type-C full-featured cable is provided in the kit. DocID029204 Rev 1 5/16 15 Getting started UM2051 Figure 2. P-NUCLEO-USB001 system architecture Expansion Board ST morpho connectors User LEDs CC AFE and VCONN Switch Port 0 CC AFE and VCONN Switch Port 1 Local Power Management Extension Connector Port 1 Extension Connector Port 0 VBUS Current/Voltage sensing Port 1 Type-C Receptacle Port 1 VBUS Current/Voltage sensing Port 0 Type-C Receptacle Port 0 VBUS Port 0 Switch and discharge VBUS Port 1 Switch and discharge Connector for VBUS Load Port 1 Connector for VBUS Load Port 0 Device D eDevice vice P Policy oPolicy lic y Manager Policy Engine Protocol Layer Physical Layer (4b5b, CRC, SOP, BMC) Nucleo-F072RB board 6/16 DocID029204 Rev 1 UM2051 1.2 Getting started The P-NUCLEO-USB001 demonstration The P-NUCLEO-USB001 is a complete hardware development platform to learn and develop solutions based on USB Type-C™ and USB Power Delivery technologies. The middleware stack (X-CUBE-USB-PD) offers a set of dedicated API and configuration templates to cover different topologies (Provider, Consumer, DRP,...) and customizations to easily develop USB-C and Power Delivery applications. For more details refer to the STM32 Nucleo pack for USB Type-C™ and Power Delivery with the Nucleo-F072RB board User manual (UM2050) at the www.st.com website. Thanks to the two Type-C ports available on the USB-C Power Delivery expansion board, the firmware example embedded in the STM32F072RBT6 MCU of the NUCLEO-F072RB board, provides a simple demonstration that the user can run without any additional material, showing the flexibility of Type-C with its reversible plug orientation, cable direction, and the role assumed by each port. User can build other demonstrations with external tools, using the same firmware embedded in the STM32F072RBT6 MCU of the NUCLEO-F072RB board. 1.3 Configuration setup To run the embedded demonstration, follow the hardware configuration steps shown below: 1. The MB1257 board must be stacked on a NUCLEO-F072RB board through the ST morpho connector. There is only one position allowed for this connection, the one where the stacked board MB1257 does not cover the two blue and black push-buttons on the NUCLEO-F072RB board (see the blue button B1 and black button B2 in the Figure 3). DocID029204 Rev 1 7/16 15 Getting started UM2051 Figure 3. MB1257 USB-C Power Delivery expansion board and NUCLEO-F072RB assembled 8/16 DocID029204 Rev 1 UM2051 Getting started The NUCLEO-F072RB board included in the pack, has a different configuration comparing to the default one. The main differences are listed below: – Solder bridges SB48, SB49, SB62, SB63 are closed – Solder bridges SB13, SB14, SB15, SB21 are open – 0 Ω resistors R34, R36 are removed 2. On NUCLEO-F072RB board, verify jumper settings: JP1 must be open; JP5 (PWR) must be closed on U5V and JP6 must be closed (IDD). 3. On the MB1257 expansion board, verify jumper settings: J500 must be closed, JP501 must be open. Refer to Figure 4. 4. Connect the NUCLEO-F072RB board to a PC with a USB Type-A to Mini-B cable (not provided) to power the system and to interact with the demonstration Figure 4. MB1257 connectors, jumpers and LEDs Table 1. Description of connectors, jumpers and LEDs Part reference Description CN7 ST morpho connector CN10 ST morpho connector CN2 I2C connector CN3 UART connector CN4 Power connector (on bottom side) CN11 VBUS Load PORT_0 CN12 VBUS Load PORT_1 JP100 Supply VBUS selection only for consumer role DocID029204 Rev 1 9/16 15 Getting started UM2051 Table 1. Description of connectors, jumpers and LEDs (continued) Part reference Description J500 VBUS source for PORT_0(1) JP501 VBUS source for PORT_1(1) D200 (Blue LED) Role indication for PORT_1 D201 (Green LED) VBUS indication for PORT_1 D202 (Orange LED) CC line indication for PORT_1 D203 (Blue LED) Role indication for PORT_0 D204 (Green LED) VBUS indication for PORT_0 D205 (Orange LED) CC line indication for PORT_0 D206 (Blue LED) 3.3V power 1. It is allowed to use the 5 V from NUCLEO-F072 as VBUS, when no external power supply is available and only for Provider role. It is used mainly for demonstration purpose. If an external power supply is connected the jumper must be left open. Note: The value of the integrated resistor Rp is 4.7 kΩ at 3.3 V to advertise current capability of 3 A at 5 V. User has to change it according to his power supply capabilities. For more details refer to STM32 Nucleo pack for USB Type-C™ and Power Delivery with the Nucleo-F072RB board User manual (UM2050) at the www.st.com website. 1.3.1 Standalone demonstration The PORT_0 is configured as DRP (Provider/Consumer), while PORT_1 offers only Type-C port management and it is configured as Consumer. PORT_0 will switch from one role to the other each four seconds. The role will be highlighted by the blue LED D203 blinking one or twice for Provider or Consumer role respectively. Once the two Type-C ports of the expansion board are connected together by the Type-C to Type-C cable, the demonstration shows the cable attachment/detachment operation and orientation mechanism by LEDs blinking. After the procedure described in Section 1.3: Configuration setup, the following actions must be accomplished to run the embedded demonstration: 10/16 1. Connect the two Type-C receptacles on the expansion board using the USB Type-C cable (provided). 2. Blue LED (D203) will blink once when the PORT_0 is working as Provider, while it will blink twice when the port is working as Consumer. Blue LED (D200) will blink twice because it is linked to PORT_1 that is configured as Consumer only. 3. The two orange LEDs (D205 and D202) will blink once or twice indicating the CC line used respectively for PORT_0 and PORT_1. Changing the cable insertion, the LEDs will blink according to the cable orientation. 4. Green LEDs (D201 and D204) will blink when the port, working as Provider, is supplying the Port Partner or, working as Consumer, is sinking power. DocID029204 Rev 1 UM2051 1.3.2 Getting started Other demonstration with external hardware When connecting the Type-C PORT_0 configured as DRP (Provider/Consumer) to an external Port Partner, the user can see the cable attachment/detachment, the orientation and role configuration. Take care that in case of Provider role the exposed power profiles are dummy roles. After execution of the procedure described in Section 1.3: Configuration setup, the following actions must be accomplished to run demonstration on PORT_0: 1.4 1. Connect CN3 of NUCLEO-F072RB with CN3 of MB1257 expansion board through the two female wires included in the package, respecting the numeration (1-1, 2-2). 2. Insert one plug of the included Type-C to Type-C cable on PORT_0 of the expansion board, that is configured as DRP (Provider/Consumer). 3. Connect the other plug of the USB Type-C Cable to an external Port Partner. 4. Blue LED D203 blinks once when the PORT_0 is working as Provider, while it blinks twice when it is working as Consumer. 5. Orange LED D205 blinks once or twice according to the selected CC line on PORT_0. 6. Green LED D204 blinks when the port, working as Provider, is supplying the Port Partner or when the port, working as Consumer, is sinking power. Whichever role has the port, this led turns on whenever an explicit contract has been negotiated. 7. In case of Provider role, after providing the 5 V on VBUS, it starts to advertise source capabilities related to four dummy profiles (5 V, 9 V, 15 V, 20 V). 8. The user can interact with the application by means of a serial communication tool as explained in Section 1.4. Command Line Interface The Command Line Interface (CLI) allows the user to get the status of the Power Delivery application running on PORT_0 and to act on it through a serial communication. When connecting through the two female wires included in the package, CN3 of NUCLEOF072RB board with CN3 of the MB1257 expansion board, respecting the numeration (1-1, 2-2), user can connect the NUCLEO-F072RB board to the PC using the virtual COM port with a standard serial terminal software. The configuration shall be: • Baudrate: 115200 • Data bit: 8n • Stop bit: 1 • Hardware Flow Control: None Through a set of commands, CLI allows the user to know the profiles available in the system and the status and to request a different profile (only when acting as Consumer). At the startup of the board a “welcome message” is shown in the terminal. By typing “help” user can get the list of the supported commands (see Table 2 and Figure 5). DocID029204 Rev 1 11/16 15 Getting started UM2051 Figure 5. Screenshot of the CLI and list of available commands Table 2. Description of the CLI commands Command Parameter Description help none To show the list of the available commands. welcome none To print out the welcome message and copyright information. profiles none To show the available power profiles. status none To retrieve information about the PD port and the status. request Profile number To change the power profile on PD port (in case of Consumer). When acting as Provider if the cable is unplugged the “profiles” command shows four dummy power profiles and the “status” indicates that it is working in dual-role mode (see Figure 6). Figure 6. CLI when the cable is unplugged on PD port (PORT_0) Connecting PD port (PORT_0) to USB-C port (PORT_1) and typing again the status command, the user can get information about cable orientation (CC1 or CC2) and contract 12/16 DocID029204 Rev 1 UM2051 Getting started status as shown in Figure 7 (in this configuration PORT_1 is only Type-C and not Power Delivery). Figure 7. CLI when PD PORT_0 is plugged to the USB Type-C only PORT_1 If a USB Type-C and Power Delivery consumer is plugged in PORT_0, the demonstration acts as Provider and sends the source capabilities according to the four “dummy” power profiles (5 V, 9 V, 15 V, 20 V at 3 A). The “status” command shows the dummy power profiles requested by the Consumer and the cable orientation, as shown in Figure 8. Figure 8. CLI when PD port (PORT_0) is connected to a Consumer If a USB Type-C and Power Delivery Provider is plugged in PORT_0, the demonstration will act as Consumer. The “profiles” command shows the list of the power profiles received from the Port Partner and the “status” command shows the requested power profile and the cable orientation (see Figure 9). DocID029204 Rev 1 13/16 15 Getting started UM2051 Figure 9. CLI when PD port (PORT_0) is connected to a Provider The “request” command changes the power profile according to the specified parameter and start again the negotiation between the Consumer and the Provider for the selected power, as shown in Figure 10. Figure 10. CLI after a request to change the power profile 14/16 DocID029204 Rev 1 UM2051 2 Revision history Revision history Table 3. Document revision history Date Revision 02-Jun-2016 1 Changes Initial release. DocID029204 Rev 1 15/16 15 UM2051 IMPORTANT NOTICE – PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries (“ST”) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST’s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers’ products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST for such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. © 2016 STMicroelectronics – All rights reserved 16/16 DocID029204 Rev 1