cancel
Showing results for 
Search instead for 
Did you mean: 

USB_host MSC with stm32f746

RMasi.19
Associate II

Hi, after of much struggle in the programming, seeing the tutorial of controllers_tech, can create files and directories in usb memory. I had problems with these case, when insert the usb memory the flow of program enter in Application_Start but never went to Application_Ready. 

case HOST_USER_CONNECTION:

Appli_state = APPLICATION_START;

break;

case HOST_USER_CLASS_ACTIVE:

Appli_state = APPLICATION_READY;

Mount_USB();

...

break;

Then seeing some thereads about these problem, found that the file usbh_ctlreq.c have these lines:

if (USBH_MAX_EP_PACKET_SIZE < (uint16_t)USBH_MAX_DATA_BUFFER)

{

/* Make sure that maximum packet size (bits 0..10) does not exceed the max endpoint packet size */

ep_descriptor->wMaxPacketSize &= ~0x7FFU;

ep_descriptor->wMaxPacketSize |= MIN((uint16_t)(LE16(buf + 4) & 0x7FFU), (uint16_t)USBH_MAX_EP_PACKET_SIZE);

}

else

{

/* Make sure that maximum packet size (bits 0..10) does not exceed the total buffer length */

ep_descriptor->wMaxPacketSize &= ~0x7FFU;

ep_descriptor->wMaxPacketSize |= USBH_MAX_EP_PACKET_SIZE;

}

the flow of program always falls in condition else, then i increased the size of USBH_MAX_DATA_BUFFER, in .ioc file Usb_host middleware, of 512 a 2048 bytes, then the flow of program entered in the first condition.

and flow program can now enter a Application_Ready. Some users say what error bug in these lines, i want know if these is true and what meaning have these two constans
USBH_MAX_EP_PACKET_SIZE < (uint16_t)USBH_MAX_DATA_BUFFER

 

1 REPLY 1
KDJEM.1
ST Employee

Hello @RMasi.19 ,

Thank you for reporting this issue.

This issue is already reported internally. It is a bug in host lib v3.4.1 integrated in STM32CubeF7 1.17.0 version.

This issue is fixed on host lib v3.5.0 available in ST github.

Internal ticket number: 136958 (This is an internal tracking number and is not accessible or usable by customers).

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.