No data-role swap recognized with X Cube TCPP
Hello,
I am using a STM32G0B1xx MCU with the X-CUBE-TCPP v4.1.0 stack an FreeRTOS. I am trying to setup a USB-c port with OTG-functionality. I am having some problems understanding your X-CUBE-TCPP-stack.
Some background info:
I am initializing the software with MX_UCPD1_Init() and MX_USBPD_Init() provided by the original stack/CubeMX. I am testing the connection with several USB-devices an -hosts. We tested a previous version of our software on a NUCLEO-G071RB in combination with a X-NUCLEO-DRP1M1 with your Tool "STM32CubeMonitor-UCPD", which was working fine.
1. The DPM_Params[0].PE_DataRole is always defined as USBPD_PORTDATAROLE_UFP, no matter what i connect to the USB-c port. Is this intended?
2. I do not get a Notification for USBPD_NOTIFY_DATAROLESWAP_UFP or for USBPD_NOTIFY_DATAROLESWAP_DFP in here, no matter what I connect to the USB-c port:
/**
* @brief Callback function called by PE to inform DPM about PE event.
* @PAram PortNum The current port number
* @PAram EventVal @ref USBPD_NotifyEventValue_TypeDef
* @retval None
*/
void USBPD_DPM_Notification(uint8_t PortNum, USBPD_NotifyEventValue_TypeDef EventVal)
{
/* USER CODE BEGIN USBPD_DPM_Notification */
/* Manage event notified by the stack? */
switch(EventVal)
{
//...
case USBPD_NOTIFY_DATAROLESWAP_UFP:
HAL_NVIC_SetPendingIRQ(EXTI2_3_IRQn); // this will set EVENT_DATAROLE_CHANGE
break;
case USBPD_NOTIFY_DATAROLESWAP_DFP:
HAL_NVIC_SetPendingIRQ(EXTI2_3_IRQn); // this will set EVENT_DATAROLE_CHANGE
break;
default:
DPM_USER_DEBUG_TRACE(PortNum, "ADVICE: USBPD_DPM_Notification:%d", EventVal);
break;
}
/* USER CODE END USBPD_DPM_Notification */
}I just get two notification in the beginning, both USBPD_NOTIFY_USBSTACK_START.
Do you have any hints for me where to start?
