Closed davedesro closed 4 months ago
Describe the bug There's only one queue for 2x PE threads. Each PE thread needs its own queue. Here's the diff explaining the issue, and the fix.
diff --git a/app/src/usbpd/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c b/app/src/usbpd/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c index 616dd53d..20f78dc1 100644 --- a/app/src/usbpd/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c +++ b/app/src/usbpd/STM32_USBPD_Library/Core/src/usbpd_dpm_core.c @@ -433,10 +433,10 @@ USBPD_StatusTypeDef USBPD_DPM_InitOS(void) /* Create the queue corresponding to PE task */ for (uint32_t index = 0; index < USBPD_PORT_COUNT; index++) { - OS_CREATE_QUEUE(PEQueueId[index], QPE, 1, OS_ELEMENT_SIZE); if (index == USBPD_PORT_0) { + OS_CREATE_QUEUE(PEQueueId[index], QPE_0, 1, OS_ELEMENT_SIZE); /* Tasks definition */ OS_DEFINE_TASK(PE_0, USBPD_PE_Task, OS_PE_PRIORITY, OS_PE_STACK_SIZE, USBPD_PORT_0); OS_CREATE_TASK(DPM_PEThreadId_Table[USBPD_PORT_0], PE_0, USBPD_PE_Task, @@ -445,6 +445,7 @@ USBPD_StatusTypeDef USBPD_DPM_InitOS(void) #if USBPD_PORT_COUNT > 1 if (index == USBPD_PORT_1) { + OS_CREATE_QUEUE(PEQueueId[index], QPE_1, 1, OS_ELEMENT_SIZE); /* Tasks definition */ OS_DEFINE_TASK(PE_1, USBPD_PE_Task, OS_PE_PRIORITY, OS_PE_STACK_SIZE, USBPD_PORT_1); OS_CREATE_TASK(DPM_PEThreadId_Table[USBPD_PORT_1], PE_1, USBPD_PE_Task,
How To Reproduce
The modules that you suspect to be the cause of the problem (Driver, BSP, MW ...) STM32_USBPD_Library/Core
STM32_USBPD_Library/Core
The use case that generates the problem. Using 2x ports
ST Internal Reference: 175518
Fixed in commit 97ed40c9cdbb9dc18377ea4533833be2844532b2
Describe the bug There's only one queue for 2x PE threads. Each PE thread needs its own queue. Here's the diff explaining the issue, and the fix.
How To Reproduce
The modules that you suspect to be the cause of the problem (Driver, BSP, MW ...)
STM32_USBPD_Library/Core
The use case that generates the problem. Using 2x ports