Description
Caution
The Issues are strictly limited for the reporting of problem encountered with the software provided in this project.
For any other problem related to the STM32 product, the performance, the hardware characteristics and boards, the tools the environment in general, please post a topic in the ST Community/STM32 MCUs forum.
Describe the set-up
NUCLEO-G071RB + X-NUCLEO-SRC1M1
Describe the bug
Within the context of a sink application. If a PDO is described with 0 current, then the PDO comparison will always fail. e.g.
SNK PDO = 5V 0A
SRC PDO = 5V 3A
Will return a PDO mismatch even though technically this isn't a mismatch unless its a rule violation I am unaware of.
How To Reproduce
Create a SNK PDO with a 0A current level. have a SRC PDO with matching voltage and >0A available.
Additional context
I am not yet familiar enough with github to post exact links but
Projects/NUCLEO-G071RB/Applications/USB_PD/SNK1M1_Sink/USBPD/Target/usbpd_dpm_user.c
line 1176
if ( (snkvoltage50mv == srcvoltage50mv)
&&(snkopcurrent10ma <= srcmaxcurrent10ma))
{
currentrequestedpower = (snkvoltage50mv * snkopcurrent10ma) / 2; /* to get value in mw */
currentrequestedvoltage = snkvoltage50mv;
}
currentrequestedpower will end up as 0 because snkopcurrent10ma is 0. When currentrequestedpower is 0 it is considered a mismatch. But that's not true. since the requested current is less than the available current.
Screenshots
N/A