Details on how to implement a USB PD Battery Status request from a sink to a battery source with STM32Cube_FW_G0_V1.6.3
I am using a STM32G071CB MCU on a device that connects to a battery that supports USB PD and I would like to get a battery status periodically. Code generated by STM32CubeMX that includes trace and GUI code works as expected when using STM32CubeMonitor-UCPD. However, the return path of a battery status reply message does not go through usbpd_dpm_user.c, but through GUI code instead. I would like my application to use usbpd_dpm_user.c as the interface using STM32Cube_FW_G0_V1.6.3, but information on how to do that is incomplete and examples are outdated. There seems to be more required than just selecting appropriate usbpd PE options and adding code to USBPD_DPM_SetDataInfo().
Currently, USBPD_DPM_RequestGetBatteryStatus() returns USBPD_ERROR, but a request is send to the battery anyway. However, the battery status reply message does not trigger a call to USBPD_DPM_SetDataInfo() or USBPD_DPM_ExtendedMessageReceived(). What am I missing? Is there any documentation other than usbpd basics?
