cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up USB HS FIFO size for STM32H745

SLuka.1
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2

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

SLuka.1
Associate II

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.