Skip to main content
Visitor II
November 12, 2024
Question

USB PD Part selection

  • November 12, 2024
  • 16 replies
  • 8504 views

Hello,

I'm working with the STM32U575VGT6 as my primary MCU and need a USB-C DRP PD IC. I'm considering the TCPP03-M20 or STUSB1600AQTR. My question is, when the PD operates in sink mode (during charging), we intend to turn off all power supplies, including the MCU. Is it possible to use these ICs in sink mode without the MCU? Additionally, we need the PD to act as a source when external peripherals are connected to this board through USB-C.

    This topic has been closed for replies.

    16 replies

    Technical Moderator
    November 12, 2024

    Hi @NajeemSyed 

    Given your requirements, and as of the progress of certification of power delivery, I recommend using TCPP03 with STM32U5 MCU.

    • In sink mode, the TCPP03-M20 can manage the initial connection and basic power negotiation. For full PD operation and better flexibility and compatibility, the MCU is required to manage the negotiations. The use of N-MOS for managing power with the STM32 MCU is optimal and supported.
    • In source mode, the MCU control the power delivery and manage the role swap to source mode.

    X-CUBE-TCPP V4 package, is certified for USB-PD 3.1, providing support for the latest USB Power Delivery specification. So, by leveraging the strengths of both the TCPP03-M20 and the STM32U5 MCU, you can achieve a robust and efficient power delivery solution.

    Visitor II
    November 13, 2024

    Subject: Issue with USB Data Transfer and Battery Charging on STM32U575ZI

    Hello,

    We are working on implementing a dual-role USB Power Delivery (USBPD) setup with an internal battery. The system is designed so that when an external charger is connected to the STM32U575ZI, it charges the internal battery. However, when the STM32U083RC (external device) is connected to the same USB port, the STM32U575ZI provides power to the STM32U083RC. This is the expected behavior for our application.

    **Hardware Setup:**
    We are using the TCPP03-M20 USB Type-C Power Delivery protection IC for dual-role power application, as outlined in this [ST link](https://www.st.com/en/protections-and-emi-filters/tcpp03-m20.html?ecmp=tt9470_gl_link_feb2019&rt=db&id=DB4442).

    For testing purposes, we are using the X-NUCLEO-DRP1M1 expansion board and following the steps from this [video tutorial](https://www.youtube.com/watch?v=mJ4VX_2B6wE), which uses the STM32G071RBT.

    However, we have encountered two main issues:

    1. **X-NUCLEO-DRP1M1 options not appearing in STM32CubeMX for STM32U575ZI:**
    We are unable to enable the X-NUCLEO-DRP1M1 options in STM32CubeMX for STM32U575ZI, as shown in the video tutorial (see attached picture).

    2. **DMA configuration not available for STM32U575ZI:**
    While the DMA options are available and configurable when using STM32G071RBT, they do not appear for STM32U575ZI. We are unable to enable DMA options for Nucleo board STM32U575ZI, as shown in the picture.

    NOTE- same we tried with custom PCB we are getting same result.

    Could you please advise on how to configure the X-NUCLEO-DRP1M1 and enable DMA on Nucleo board STM32U575ZI?

    3cee0b25-03a1-4fb3-b39c-c88870099f8a.jpeg

    c235fae3-c1b5-44db-9b1a-1c15c9f425f5.jpeg

    6b752f07-1934-48cf-b62f-1cbe85e9e9e4.jpeg

    37a5a317-8ab2-4930-83d5-c6be8df47625.jpeg

    ST Employee
    November 14, 2024

    Dear NajeemSyed 

    X-NUCLEO-DRP1M1 are in Nucleo-64 form factor so it is dedicated to be plugged directly on a NUCLEO-G0xx or G4xx.

    this is ony in this case that you can use the X-NUCLEO-DRP1M1 BSP.

     

    Then in your case, you have to define required resources :

    - I2C

    - GPIO Out for Enable

    - EXTI for FLAG

    - At least 1 ADC Channel for Vbus

    And in the X-Cube-TCPP software pack, "Platform settings" affect these resources to the application requirements.

     

    The video is using STM32G0xx MCU in its example. This MCU is using DMA,

    For STM32U5 go to the GPDMA page.

     

    Best regards

    Pascal

     

    Explorer II
    December 3, 2024

    Hi Pascal,

    Thank you for the update and your advice to use AzureRTOS for the initial tests. I will proceed with it as suggested. Please let me know once you have a solution for the X-CUBE-FREERTOS issue on USBPD applications for STM32U5xx.

    Looking forward to hearing from you.

    Thanks,

    Best regards,
    Rajkumar

     

    ST Employee
    December 9, 2024

    Hi Rajkumar24

    I made some changes in your .ioc.

    - I configure USART1 which is the one connected to the STLINK.

    - I enabled "CAD Role Toggle" in the USBPD Middleware configuration

    - I enabled X-cube-TCPP middleware, (may be disabled during the migration).

    Let me know if it works well.

    Best regards

    Pascal

     

     

     

    Explorer II
    December 9, 2024

    Hi Pascal,

    We tested the modified file (with Azure RTOS) that you shared, and it is working fine. We now have a better understanding of how dual role works.thanks.

    As you know, our application involves USB data transfer and USBPD dual role with FreeRTOS. Could you please guide us on how to integrate FreeRTOS into this setup? If you could share a USBPD- FreeRTOS IOC file, it would be very helpful.

    Additionally, I would like to learn more about the USB PD monitor software tools.  Is there anything that needs to be changed in the UCPD monitor settings? If so, could you please provide instructions on how to do that?

    Looking forward to your guidance.

     

    Best regards,

    Rajkumar

    ST Employee
    December 10, 2024

    Hi Rajkumar24

    Thanks for your video.

     

    For STM32CubeMonitor UCPD, please refer to the documentation here

     

    To switch your application to X-Cube-FreeRTOS

    1- Copy files included in the ftl_u5.zip package attached to your folder :

    C:\Users\YOUR_USER_NAME\AppData\Local\Programs\STM32CubeMX\db\templates\

    2- in STM32CubeMX : Unselect ThreadX

    3- in STM32CubeMX : In the Software Pack menu, Select components, Select the X-Cube-FREERTOS

    Enable Core "TZ_Non_Supported", Heap : "Heap_4" 

    Back to the Middleware section, enable it : Default configuration is perfect, no need to change anything.

    - Please find attached my .ioc for reference

    4- In STM32CubeMX : Generate the Code

    5-In your IDE add "_RTOS" preprocessor and  "osCMSIS=0X20001U" preprocessor.

     

    Best regards

    Pascal

     

     

     

    ST Employee
    December 11, 2024

    Hi Rajkumar24

    1-Using STM32CubeMX
    No problem with the warning on X-CUBE-TCPP : this is because you are using X-CUBE-FREERTOS instead of ThreadX.
    For the errors, I have no compilation issue on my side, maybe you can try the 3rd Code generation option (see Capture_H5_STM32CubeMX.jpg attached)
    You need to add Preprocessor : "_RTOS" and "osCMSIS=0x20001U"
    (see Capture_H5_STM32CubeIDE.jpg attached)

    2-Using STM32CubeIDE
    ou need Preprocessor : "_RTOS" and "osCMSIS=0x20001U"
    (see Capture_H5_STM32CubeIDE.jpg attached)

    Best regards
    Pascal

    Explorer II
    December 11, 2024

    Hi Pascal,

    After Done what you said before, the compilation Error was fixed. but after upload the generated code the drp1m1 module not perform dual role as like we test before with threadx.

    I attached my IOC and images for your reference.please verify our ioc file.

    Looking forward to your guidance.

    Best regards,

    Rajkumar

    ST Employee
    December 12, 2024

    Hi Rajkumar24

     

    Please try this .ioc, it works on my side on a setup identical to yours.

     

    Best regards

    Pascal

     

    Explorer II
    December 12, 2024

     

    Hi Pascal,  

     

    Thank you for the IOC file.it’s working perfectly with FreeRTOS. I have attached a video for your reference. Once again thank you.

    As mentioned earlier, our final product includes power delivery, data transfer (USB CDC host), and code flashing via USB instead of ST-Link.  

    Initially, we tested only with the Nucleo U575 board, and both USB flashing and USB CDC host functionality were working fine.

    (Note-Code flash via usb- Just connect ph0 pin to ground and put power via USB port instead of stm32,Instead of st link)

     

    1. after adding the X-Nucleo Drp1m1 board to the Nucleo U575 board and following the same pin connection as you mentioned earlier and we added the D+ and D- pins with jumper wires.data transfer and code flashing are not working. Could you please guide me if there is any hardware connection Or any usbpd configuration we might have missed?  

    2. could you confirm if the battery on the X-Nucleo board needs to be connected to the sink (screw terminal) for charging?  

    Looking forward to your guidance.  

     

    Best regards,  

    Rajkumar  

    ST Employee
    December 13, 2024

    Hi Rajkumar24

    Thank you for your video ! Happy to read that your application is working.well.

     

    1- I suppose you connected D+/D- from X-NUCLEO-DRP1M1 CN10-12 and CN10-1.

    If yes, this is correct, R19 and R20 are present.

    The difficulty I see is that using free wires we don't respect anymore the 90Ohms differential pair.

     

    PPAIL1_0-1734072487953.png

    PPAIL1_1-1734072538904.png

    2- I confirm, the battery charge has to be managed from the X-Nucleo-DRP1M1 sink (screw terminal).

    Here is an application block diagram:

     

    PPAIL1_2-1734073463836.png

    Best regards

    Pascal

     

     

    Visitor II
    December 16, 2024

    Hi Pascal,

    Based on the DK, we have designed our own PD circuit for our custom board. Please cross-verify the schematics and let us know if we need any changes?

    NajeemSyed_0-1734333821550.png

     

    Explorer II
    December 14, 2024

    Hi Pascal,

    Thanks now battery charging working.

    Thanks for the circuit, we are following same connection. We also added the twisted wire (we take from external usb cable) and soldering to between the two boards.still usb host not working but usbpd dual role working.while debugging we came to know Issue with osKernelStart Triggering Automatically in UCPD Implementation.

    While integration to usb host code ,UCPD functionality is working correctly, but I am facing an issue with osKernelStart. Despite not explicitly calling osKernelStart in my code, the function is still being executed, and it subsequently triggers vTaskStartScheduler(). I have verified and commented out all instances of osKernelStart in the code, but the issue persists—it appears that osKernelStart is being called from elsewhere, leading to the scheduler's start. This behavior is preventing me from taking control of my operating system.

    could you please provide clarity on whether any UCPD-related software or driver could be invoking this function? For reference, I have attached an image for your review.

    Looking forward to your guidance.  

    Best Regards 

    Rajkumar