Trying to move over G0 DRP example code, the UCPD tracer program stops seeing the board
I am trying to build an application with a SNK and DRP usbc port, using a USBPDM1 and a DRP1M1 with a nucleo g071rb
I have successfully run the DRP example application, but when I try and add the functionality to my sink application stm32cubemonitor-ucpd stops seeing the board.
Specifically when adding in the drp example code:
// (in usbpd_dpm_user.c)
USBPD_StatusTypeDef USBPD_DPM_UserInit(void)
{
/* USER CODE BEGIN USBPD_DPM_UserInit */
/* PWR SET UP */
if(USBPD_OK != USBPD_PWR_IF_Init())
{
return USBPD_ERROR;
}
#if defined(_RTOS)
#if (osCMSIS < 0x20000U)
osMessageQDef(MsgBox, DPM_BOX_MESSAGES_MAX, uint32_t);
DPMMsgBox = osMessageCreate(osMessageQ(MsgBox), NULL);
if(NULL == osThreadCreate(osThread(DPM), &DPMMsgBox))
#else
DPMMsgBox = osMessageQueueNew (DPM_BOX_MESSAGES_MAX, sizeof(uint32_t), NULL);
if (NULL == osThreadNew(USBPD_DPM_UserExecute, &DPMMsgBox, &DPM_Thread_Atrr))
#endif /* osCMSIS < 0x20000U */
{
return USBPD_ERROR;
}
#endif /* _RTOS */
return USBPD_OK;
/* USER CODE END USBPD_DPM_UserInit */
}Because osMessageGet seems to have changed for cmsis2
I changed the USBPD_DPM_UserExecute function to use the new "osMessageQueueGet" call
#if (osCMSIS < 0x20000U)
void USBPD_DPM_UserExecute(void const *argument)
#else
void USBPD_DPM_UserExecute(void *argument)
#endif /* osCMSIS < 0x20000U */
{
/* USER CODE BEGIN USBPD_DPM_UserExecute */
#if defined(_RTOS)
/* User code implementation */
uint32_t _timing = osWaitForever;
osMessageQId queue = *(osMessageQId *)argument;
osEvent msg;
osStatus_t status;
do
{
status = osMessageQueueGet(queue, &msg, NULL, _timing);
switch (((DPM_USER_EVENT)msg.value.v & 0xF))
{
case DPM_USER_EVENT_TIMER:
{
break;
}
default:
break;
}
_timing = CheckDPMTimers();
}
while(1);
#endif /* _RTOS */
/* USER CODE END USBPD_DPM_UserExecute */
}other then that and the required defs in the same file. I cant find any more changes that would be needed to get the tracer to run properly
I'm curious if I have missed anything required?
