STM32U5 - USB CDC UART not working: USBPD_DPM_CADCallback(..) is not calling
I have build the project with Nucleo_U5A55ZJ-Q with 1.4.0 and 6.2.0 library from the start, following the example code (working) with IOC setup (USBPD and USBX). After fixing the CSRST issue earlier with missing __HAL_RCC_SYSCFG_CLK_ENABLE() but I note the demo code do not use this command.
The code is running, but there is no COM port (the demo code (2021) did work with COM3). I found the USBPD_DPM_CADCallback(..) is not calling.
Below is code found in uspd_dpm_core.c where the DEF_TASK_FUNCTION(USBPD_CAD_Task) is working (via breakpoint), which suggests the interrupt is responding okay.
I have spent 5 hours trying to figure out the difference between the generated code (2024) and the demo code (2021). I'm open to investigating why USBPD_DPM_CADCallback(..) is not calling. I attached ioc file.
DEF_TASK_FUNCTION(USBPD_CAD_Task)
{
uint32_t _timing;
#ifdef _LOW_POWER
UTIL_LPM_SetOffMode(LPM_CAD, UTIL_LPM_DISABLE);
#endif /* _LOW_POWER */
for (;;)
{
_timing = USBPD_CAD_Process();
OS_GETMESSAGE_QUEUE(CADQueueId, _timing);
}
}
/**
* @brief CallBack reporting events on a specified port from CAD layer.
* @PAram PortNum The handle of the port
* @PAram State CAD state
* @PAram Cc The Communication Channel for the USBPD communication
* @retval None
*/
void USBPD_DPM_CADCallback(uint8_t PortNum, USBPD_CAD_EVENT State, CCxPin_TypeDef Cc)
{
