Skip to main content
Visitor II
August 17, 2020
Solved

Nucleo-G474 and X-Nucleo-USBPDM1 sink setup for continuous changement of PDOs and APDOs

  • August 17, 2020
  • 12 replies
  • 7678 views

Hey there,

since a few weeks i am setting up a USB-PD sink with the Nuc-USBPDM1 and Nuc-G474.

In this special case i want to:

1. Read out charger PDOs

2. Set up Fixed PDOs (e.g. 15V@3A) and switching during runtime

3. Set up APDOs according to PPS (variable voltage and current) and switching during runtime

My project files are generated by CubeMX with firmware package 1.2.0 for the G4 series (with 1.3.0 i couldn't get this work). I am using non RTOS mode.

For now it is possible for me to select fixed PDOs and switching them during runtime (by USBPD_DPM_RequestMessageRequest). But when i want to set up an APDO (by requesting continuously every 100ms) i can't get this work.

Only the first request is sent by the stack (proved with Cypres USB-PD protocol analyser) and after this i only get a "USBPD_BUSY" or "USBPD_ERROR" by the request function and the stack goes crazy (hard resetting every few seconds). The whole board has to be reset, that USB-PD stack works stable again.

Is there any possibility to get PPS working properly with my setup. Or do i have to make special changes in CubeMX, "usbpd_dpm_user" or "usbpd_dpm_core"?

Best regards

    This topic has been closed for replies.
    Best answer by Guenael Cadier

    Dear @S.Cross​ 

    Thanks for your attachments.

    Libraries provided in USBPD Middleware could be used on several targets. Depending on Cortex M core used inside the STM32xx device, several libs for same IDE/USBPD feature configuration, exist. For STM32G4xx, libs with ***_CM4*** are ok.

    Regarding the Hard Reset issue, could you try to use updated lib (as attached to this post, please remove"_update" suffix), rebuild you binary, and check if issue still present ?

    Thanks

    Guenael

    12 replies

    S.CrossAuthor
    Visitor II
    September 18, 2020

    Dear @Guenael Cadier_O (ST Employee)​ ,

    my IDE i am using is Keil v5.20.0.0 with "USBPDCORE_PD3_FULL_CM4_Keil.lib".

    The IOC file and libraries are within the archive attached.

    Thanks

    ST Employee
    September 22, 2020

    Dear @S.Cross​ 

    Thanks for your attachments.

    Libraries provided in USBPD Middleware could be used on several targets. Depending on Cortex M core used inside the STM32xx device, several libs for same IDE/USBPD feature configuration, exist. For STM32G4xx, libs with ***_CM4*** are ok.

    Regarding the Hard Reset issue, could you try to use updated lib (as attached to this post, please remove"_update" suffix), rebuild you binary, and check if issue still present ?

    Thanks

    Guenael

    S.CrossAuthor
    Visitor II
    September 24, 2020

    Dear @Guenael Cadier​ ,

    thank you for the new lib. This solved my problem completely!! Now switching between PDOs and APDOs during runtime with my sink emulation is possible without getting any unexpected HardReset signaling.

    Best regards

    S.CrossAuthor
    Visitor II
    September 21, 2020

    Dear @Guenael Cadier​ ,

    ich checked the entries in the forum and found this question:

    https://community.st.com/s/question/0D53W00000BKW4KSAX/xcubeusbpd-problem-unexpected-hardreset-transmission

    which seems to point to the same problem. In my case i have activated the CRC module and use it for validation in my communication. Could this result in that trouble i have with the USB-PD stack?

    Thank you and best regards