Showing results for 
Search instead for 
Did you mean: 

stm32g431 ucpd sink stack fail at -o2/-o3/-oFast optimization levels

Associate II

I am running STM32G431 board with USBC PD feature.

CubeIDE 1.14.1

I am trying to bring up the UCPD stack.

I refer the basic guideline:

It worked ideally.

However, if I add in my code a call "USBPD_DPM_RequestMessageRequest()", the operation gets broken.

Negotiation with Source fails, leading to power loss, and call "USBPD_DPM_RequestMessageRequest()" is not even reached.

I tried to search for the solution, but only found this, something probably related: 


Is there anybody, who hit the same issue?

It is definitely source code issue. Is there a fix?


Kind regards, Ivan.

Pavel A.
Evangelist III

While waiting for more helpful replies - can you shuffle the working code a little, to see if there's something like code/data memory overflow? Add some debug prints, led blinking...