ST STM32G071B-DISCO User Manual Download Page 25

UM2546 Rev 1

25/30

UM2546

Software description

29

Figure 31. Full STM32CubeMonitor USB Type-C PD tool example

For more details see 

STM32CubeMonitor-UCPD software tool for USB Type-C™ Power 

Delivery port management 

user manual

 

(UM2468).

5.2.5 

Dynamic memory use

The demonstration is currently using:

CSTACK = 0x300

HEAP      = 0x800

5.3 Middlewares

5.3.1 USB 

PD

In this application the USBPD stack used is delivered as a library.

All information regarding this library may be found in the 

STM32Cube USBPD stack 

user 

manual (UM2552)

.

5.3.2 FreeRTOS

FreeRTOS: FreeRTOS open source solution.

More details may be found at: https://freertos.org

Summary of Contents for STM32G071B-DISCO

Page 1: ...ery kit may be executed in two different modes depending on the position of the switch standalone sink mode or spy mode The spy mode does not use the USBPD stack In this mode the protocol information...

Page 2: ...l description 12 2 1 Demo startup 12 2 1 1 Normal processing 12 2 2 UCPD demonstration 12 2 2 1 Mode selection 12 2 2 2 LED indications 12 3 Hardware settings 14 3 1 STM32G071B DISCO board 14 4 Softwa...

Page 3: ...UM2546 Rev 1 3 30 UM2546 Contents 3 5 2 5 Dynamic memory use 25 5 3 Middlewares 25 5 3 1 USB PD 25 5 3 2 FreeRTOS 25 6 Footprint 26 7 Acronyms 27 8 Table of references 28 Revision history 29...

Page 4: ...e 2 STM32G071RBT demonstration interrupts usage 10 Table 3 LED assignation 13 Table 4 Main application functions description 16 Table 5 Main applications functions description 17 Table 6 Code example...

Page 5: ...ation pull down 18 Figure 13 Menu sequence in spy mode 19 Figure 14 Menu sequence in standalone sink mode 20 Figure 15 Welcome screen 20 Figure 16 Attach screen 20 Figure 17 PD capability screen 20 Fi...

Page 6: ...ehensive G0 functional coverage 1 1 Demonstration package Figure 2 shows the demonstration folder organization Figure 2 Demonstration folder organization The demonstration sources are located in the P...

Page 7: ...WARM IAR embedded workbench MDK ARM Keil Microcontroller Development Kit SW4STM32 System workbench for STM32 1 2 Demonstration architecture overview The top level software architecture of the STM32G07...

Page 8: ...disconnection detection and Type C power contract negotiation 1 2 2 HAL level HAL level layer consists in the stm32g0xx HAL drivers together with the STM32G071B DISCO board support package BSP 1 2 3 M...

Page 9: ...sed by the UCPD demonstration 06Y 9 0LFUR 86 FRQQHFWRU PEHGGHG 67 1 9 670 0LFURFRQWUROOHU SLQ 86 5 H WHQVLRQ FRQQHFWRU SLQ 3 2 FRQQHFWRU SLQ 3 2 FRQQHFWRU XUUHQW 3RZHU 0RQLWRU XUUHQW 3RZHU 0RQLWRU XUU...

Page 10: ...O pins connected to the joystick are used to interact with the UCPD demonstration e g menu navigation One GPIO pin is used to detect the door position Several GPIOs are used to drive some indication L...

Page 11: ...errupt mode rising edge EXTI line 1 Joystick LEFT interrupt mode rising edge EXTI line 13 Tamper interrupt mode rising edge DMA1 Channel1 DAC ADC conversions completion ADC1_COMP ADC analog watchdogs...

Page 12: ...STM32G071B DISCO is powered from the micro USB after a board reset at demo startup the welcome screen is displayed 2 2 UCPD demonstration 2 2 1 Mode selection Depending on the position of the switch t...

Page 13: ...Table 3 LED assignation Reference Color Name Function LD1 Green POWER 5V 5V present onto the board LD4 Orange SINK mode Attached to a power source LD5 Orange SOURCE mode Attached to a device as sourc...

Page 14: ...f using the VBUS when connected to a type C Source For detailed information on the hardware part please check STM32G0 Discovery kit for USB Type C and Power Delivery user manual UM2401 3 1 STM32G071B...

Page 15: ...thods 4 2 1 Using Binary file To program demonstration s binary image into the internal Flash memory the user may exercise STM32G071B DISCO_USBPD_Analyzer hex file thanks to ST Link Utility or STM32Cu...

Page 16: ...ializing all the HW SW Table below provides a description of all the actions performed by the different functions in main c Table 4 Main application functions description Functions Main c Description...

Page 17: ...on goal is to fill the USB PD data structures with the information received from the CC lines These structures are then used by the application to feed the G0 disco information display DEMO_SPY_Handle...

Page 18: ...and T5 MOSFETs are turned ON Door is open RD56 5K1 Ohms is ignored needed only for standalone mode to be seen as a sink and CC1 and CC2 pins are connected from the G0 UCPD IP Figure 12 CC lines isola...

Page 19: ...ce So dead battery indication may be provided and Rd resistors on the CC1 line must be shown This is why when the door is closed the T5 MOSFET is enabled and RD_CC1 signal is driven so that the resist...

Page 20: ...e this screen is visible Figure 16 Attach screen Whenever a VBUS is present on the type C cable this information is displayed Then depending on the source capabilities seen dual role information may b...

Page 21: ...p Figure 21 Data role screen This screen will indicate if the connected source device supports data role swap Figure 22 Display Port screen only standalone mode If the source is capable of using the s...

Page 22: ...tion may be triggered here on a distant sink profile Figure 26 Action screen only standalone mode On this screen the user may execute the displayed commands using the joystick center to select He may...

Page 23: ...UM2546 Rev 1 23 30 UM2546 Software description 29 Figure 28 STM32CubeMonitor USB Type C PD tool debug trace selection Figure 29 STM32G0 top and bottom view of Discovery board MB1378...

Page 24: ...1 The user gets such a screen Figure 30 Trace example When the G0 disco application is used in standalone sink mode the full STM32CubeMonitor USB Type C PD tool application GUI may be used to issue so...

Page 25: ...ment user manual UM2468 5 2 5 Dynamic memory use The demonstration is currently using CSTACK 0x300 HEAP 0x800 5 3 Middlewares 5 3 1 USB PD In this application the USBPD stack used is delivered as a li...

Page 26: ...only code memory Byte Read only data Byte Read write data memory Byte STM32CubeMonitor USB Type C PD tool responder GUI 7682 540 Demo Application 13596 2345 842 Policy Engine PE 20320 16 20 Stack Prot...

Page 27: ...s Table 8 Table of acronyms Acronym CC Configuration channel USB PD USB Power Delivery GUI Graphical User Interface UCPD PC monitor application PD Power Delivery DRP Dual Role Power FRS Fast Role Swap...

Page 28: ...Table of references UM2546 28 30 UM2546 Rev 1 8 Table of references References USB IF 2017 Universal Serial Bus Power Delivery Specification rev 3 0 USB IF...

Page 29: ...UM2546 Rev 1 29 30 UM2546 Revision history 29 Revision history Table 9 Document revision history Date Revision Changes 20 Feb 2019 1 Initial version...

Page 30: ...rs 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 a...

Reviews: