STM32H563ZI : USB CDC issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-30 5:01 AM
Hello ,
As per reference document added USB driver in firmware , but gives error at function
USBD_SetClassConfig(pdev, cfgidx);
added screenshot of error
If ignore this error , USB Serial device port detected but failed to set transmission buffer
static int8_t CDC_Itf_Init(void)
{
// Set Application Buffers
USBD_CDC_SetTxBuffer(&USBD_Device,UserTXBuf,0); //USBD FAIL error received
USBD_CDC_SetRxBuffer(&USBD_Device,UserRXBuf);
// Initialize buffer pointers
UserRXBufCur = 0;
UserRXBufLen = 0;
return (USBD_OK);
}
please suggest answer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-03 6:20 AM
Go into USBD_SetClassConfig and figure out why it's failing. Set a breakpoint, step through.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-04 2:53 AM
Hello ,
USBD_EMEM error received in USBD_SetClassConfig
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-04 5:57 AM
Keep following it. Go into the Init function and find where that failed...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-05 1:08 AM
it will fail in CDC_INIT function
pdev->pClassDataCmsit[pdev->classId] always return a NULL value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-05 3:57 AM
Hello ,
Can you please explain when USBD_EMEM error received or any details about USBD_EMEM .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-12-05 6:22 AM
Step through USBD_malloc and understand why it's failing. On newer HAL USB versions, this is a static allocation which can never fail. On older ones it called malloc, which should work, but may not if you have insufficient heap space.
USBD_EMEM indicates a memory error.
