Skip to main content
Associate
November 29, 2025
Solved

How to prevent "board reset by user" in USBPD stack.

  • November 29, 2025
  • 1 reply
  • 168 views

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:

  • At the cable attachment, the source presents 5V on VBUS and sends its capabilities to the sink to establish explicit contact.
  • USBPD stack uses these data sharing mechanisms from USBPD_CORE_DataInfoType_TypeDef:
    • USBPD_CORE_DATATYPE_RDO_POSITION (0x02): Reset PDO position selected by the sink.
    • USBPD_CORE_DATATYPE_SRC_PDO (0x00): Reads the SRC PDOs
    • USBPD_CORE_ DATATYPE_RCV_REQ_PDO (0x06): Forward PDO to application.

 

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

krzo99_0-1764415785196.png

 

Best answer by krzo99

I was able to fix it by setting LIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY from 5 to 3 in FreeRTOS config.

As pointed out here

1 reply

Technical Moderator
December 1, 2025

Hello @krzo99 

Did you use the examples provided in X Cube TCPP ?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.Best regards,FBL
krzo99AuthorBest answer
Associate
December 2, 2025

I was able to fix it by setting LIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY from 5 to 3 in FreeRTOS config.

As pointed out here