Showing results for 
Search instead for 
Did you mean: 

Duplicate functions in board driver files and generated user files

Associate II


I am building a project for the STM32G071B Disco board.

I am struggling to understand why there are duplicate functions in stm32g071b_discovery_usbpd_pwr.c and usbpd_pwr_user.c, for example - BSP_USBPD_PWR_VBUSGetVoltage().

This function is fully and correctly implemented for the board in stm32g071b_discovery_usbpd_pwr.c - it uses the I2C part that senses VBUS.

However the code that is actually called is in usbpd_pwr_user.c and has an empty implementation for BSP_USBPD_PWR_VBUSGetVoltage() and according to manuals it is expected to be implemented there.

As the functions share exactly the same name I can not defer the call from one module to another.

What is the correct STM32 Cube IDE "way" to deal with this without deleting generated code which seems an incorrect approach.

Thank you!