Skip to main content
Visitor II
March 29, 2020
Question

Are some STM32 MCU development board libraries incomplete purposefully?

  • March 29, 2020
  • 3 replies
  • 2049 views

Hello, this is my first time asking something in here.

I'm trying to create a USB PD consumer application on STM32G071B Discovery board.

I've created a USB PD project in STM32 Cube MX.

Many critical functions relating to USB PD have no content.

Downloadable library for mentioned board:

STM32Cube_FW_G0_V1.3.0

More specifically the USBPD_Analyzer demonstration project. 

Many critical functions relating to USB PD have no content.

Also I've tried crossreferencing some functions with a similar library meant for a Nucleo board:

STM32CubeExpansion_USBPD_F0

It has many functions named the same way, but with contents.

Am I supposed to write those critical functions myself?

And if that's the case, then I don't even know where to begin.

I can't help but feel like I'm missing something here.

Any kind of help is much appreciated!

Edit:

Also I'm following stm32 UM2552.

    This topic has been closed for replies.

    3 replies

    Super User
    March 29, 2020

    Can you pls. give an example what you are missing?

    JNiin.1Author
    Visitor II
    March 29, 2020

    Thank you for your reply!

    USBPD_DPM_UserInit() and USBPD_DPM_SetupNewPower - both located in usbpd_dpm_user.c

    Every function located in usbpd_pwr_if.c

    For example USBPD_PWR_IF_Init()

    So these functions for example don't have any contents. Just a fixed "return USBPD_ERROR;".

    Super User
    March 29, 2020

    Hmm. Don't have your board, so I cannot run the code.

    But in the STM32CubeIDE project

    STM32Cube_FW_G0_V1.3.0\Projects\STM32G071B-DISCO\Demonstrations\USBPD_Analyzer\SW4STM32\STM32G071B-DISCO_USBPD_Analyzer

    file

    /STM32G071B-DISCO_USBPD_Analyzer/Application/User/usbpd_dpm_user.c

    implements USBPD_DPM_UserInit() in line 153-187

    and

    /STM32G071B-DISCO_USBPD_Analyzer/Application/User/usbpd_pwr_if.c

    implements USBPD_PWR_IF_Init in lines 216-241.

    JNiin.1Author
    Visitor II
    March 30, 2020

    Thank you for the reply!

    I had imported this project in a way that it did not have anything in /user.

    I reimported and it's all good.

    Thank you so much!

    I have a follow-up question.

    I noticed that the said STM32 CubeMX generated project has a function called "USBPD_PWR_IF_SetProfile" - it's empty.

    The analyzer demonstration project does not have an equivalent function.

    Any ideas where to look?

    Graduate II
    March 29, 2020

    I think many of the projects are just frameworks, allowing them to be customized for the specific application, with the appropriate level of function and error checking/recover, and provide project engineers with job security.

    Graduate
    March 30, 2020

    Statement of the year: "...and provide project engineers with job security" :D

    But replace "...allowing them to be customized..." with "...needing them to be reinvented by customers for getting implemented by ST after the customers have done ST´s job..." ;)