USBPD Analyzer often lags with I2C timeout #53
Labels
bug
Something isn't working
good first issue
Good for newcomers
internal bug tracker
Issue confirmed and logged into the internal bug tracking system
projects
Projects-related (demos, applications, examples) issue or pull-request.
usb-pd
USB Power-Delivery-related issue or pull-request
Two FreeRTOS threads call at least BSP_PWRMON_GetVoltage() without locking I2C by a mutex.
When another I2C operation is re-entered while the first one is not finished, I2C fails and waits till 3 sec timeout.
Mainly happens at
STM32CubeG0/Projects/STM32G071B-DISCO/Demonstrations/USBPD_Analyzer/Src/demo_disco.c
Line 1347 in fcc63f3
Mutex guarded version BSP_USBPD_PWR_VBUSGetVoltage() should be used instead of BSP_PWRMON_GetVoltage(ALERT_VBUS, ...).
Similarly BSP_USBPD_PWR_VBUSGetCurrent() should replace BSP_PWRMON_GetCurrent(ALERT_VBUS, ...).
Also other I2C should be guarded similarly, e.g. BSP_PWRMON_GetVoltage(ALERT_CC1 / ALERT_CC2 ...) but there is no direct replacement in BSP_USBPD_PWR_ module.
The text was updated successfully, but these errors were encountered: