2021-08-12 01:26 PM
I was chasing down a problem and came across this code in the USBD_LL_RESET function inside of USBD_core.c:
if (pdev->pClassData != NULL)
{
if (pdev->pClass->DeInit != NULL)
{
(void)pdev->pClass->DeInit(pdev, (uint8_t)pdev->dev_config);
}
}
However, every other place that calls pClass->DeInit (there are 4 of them) has the following code:
if (pdev->pClass != NULL)
{
(void)pdev->pClass->DeInit(pdev, (uint8_t)pdev->dev_config);
}
Shouldn't the first example match the following ones? If you're resetting the USB, wouldn't you always want to call the DeInit function, regardless of whether or not there is pClassData? You're clearing it everywhere else, why not there as well?
This code, or something very similar (most recent framework is slightly different than the old ones), exists in the L4 and H7 frameworks, so presumably the others as well.
2021-08-18 08:05 AM
Hello @JKaz.1 ,
The issue has been raised internally.
Thank you for reporting this out.
BeST Regards,
Walid
2021-08-18 08:06 AM
ST Internal Reference: 112054 (PS: This is an internal tracking number and is not accessible or usable by customers).