2025-11-29 3:37 AM
Greetings,
I'm making a USB PD Sink device with a STM32G483 & TCPP01-M12, that will be able to take up to 15V@3A.
I started implementing USB PD functionality using STM32CubeIDE 1.19.0 & FreeRTOS. Step by step.
The current config is mostly stock, with only a custom BSP_USBPD_PWR_VBUSGetVoltage(uint32_t instance, uint32_t *pVoltage) implementation that reads VBUS voltage & writes it in mV to pVoltage.
At init(), firstly MX_USBPD_Init() is called, after that, I'm applying power to TCPP01-M12 & disabling the Dead Battery resistors.
Current FreeRTOS config: CMSIS_V2, 16000 bytes heap with heap_4 scheme, NEWLIB_REENTRANT enabled
Current USBPD config: Full Stack, TIM2 timer, NVIC, DMA set, 2 fixed PDOs, 5V@3A & 9V@3A. Everythink else in Stack Port 0 config is not supported (except SOP).
If I understand correctly, the stack should work as follows:
I haven't implemented handling of these cases in USBPD_DPM_GetDataInfo() and USBPD_DPM_SetDataInfo(). I'm just printing using EMB_TRACE.
The problem I'm facing is the following:
I have a custom PCB that I designed. Currently, it just has blinking lights.
When I connect the PCB to a USB-PD capable power source, the PCB start with blinking lights. After around 500ms-1s, the blinking freezes (indicating that the MCU froze) for about 1s. Then, it resets.
To me, it seems that the SRC gives power -> MCU freezes -> SRC takes away power -> SRC reapplies power.
I receive events 2 & 6 in USBPD_DPM_SetDataInfo(), but I never receive any events in USBPD_DPM_GetDataInfo().
You can see that the source sends SRC_CAPABILITIES with EMB_TRACE. But this is never received by any callbacks on the MCU.
Am I missing something? How can I start debugging this configuration?
Thanks for your help!
Attached you can find the whole trace