2021-08-15 08:15 AM
Hi. I'm trying to migrate from USB FS to HS composite device on STM32H745. FS device (VCP+MSM) works fine, the settings for FIFO are:
HAL_PCDEx_SetRxFiFo( &hpcd_USB_OTG_FS, 0x80 ); // RxFIFO:
HAL_PCDEx_SetTxFiFo( &hpcd_USB_OTG_FS, 0, 0x40 ); // EP0IN:
HAL_PCDEx_SetTxFiFo( &hpcd_USB_OTG_FS, 1, 0x40 ); // MSC bulk IN:
HAL_PCDEx_SetTxFiFo( &hpcd_USB_OTG_FS, 2, 0x20 ); // CDC interrupt IN:
HAL_PCDEx_SetTxFiFo( &hpcd_USB_OTG_FS, 3, 0x20 ); // CDC bulk IN:
Switching to HS I see that non composite VCP or MSC works fine also. But, switching to my composite implementation, I see in wireshark USB analyser, that MSC responds to command read10 with invalide data, there are no sector data with size of 4096, at the same time there were resets requsts from HOST, & the VCP channel is not working well, but after some time, when windows stops requests to MSC, VCP starts work properly.
In my opinion there is some problem with FIFO allocation, but I don't know in what direction to digg.
I tried some configuretions of FIFO for HS device taking into attention that whole size of memory dedicated to HS device for STM32H745 is 0x400 words.
So I tried to work with the configuration:
HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_HS, 0x120);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 0, 0x70);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 1, 0x70);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 2, 0x70);
HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_HS, 3, 0x70);
But no luck. I trided to understand how to calculate FIFO size from reference manual, but... I need some explanation.
Endpoint configuration is:
CDC_IN_EP = 0x81;
CDC_OUT_EP = 0x01;
CDC_CMD_EP = 0x82;
MSC_EPIN_ADDR = 0x83;
MSC_EPOUT_ADDR =0x03;
Thank you for advise.
Solved! Go to Solution.
2021-08-30 02:22 AM
Hello @SLuka.1 ,
There are some examples developed with the high speed frequency in our H7 firmware package.
You can take a look at this one and get inspiration (Path : Projects\STM32H747I-DISCO\Applications\USB_Device\MSC_Standalone)
Otherwise, Take a look at this presentation. it might be helpful.
BeST Regards,
Walid
2021-08-30 02:22 AM
Hello @SLuka.1 ,
There are some examples developed with the high speed frequency in our H7 firmware package.
You can take a look at this one and get inspiration (Path : Projects\STM32H747I-DISCO\Applications\USB_Device\MSC_Standalone)
Otherwise, Take a look at this presentation. it might be helpful.
BeST Regards,
Walid
2021-09-07 10:20 PM
Thanks a lot. It was my mistake, when i was writing wrapper for composite device i have defined proper descriptor only for composite FS device, meanwhile descriptor for HS composite was wrong.