2015-07-15 05:22 AM
Hello,
during the last two days I am trying to run the ''MSC_Standalone'' example application from Cube F7 1.1 HAL packege on STM32F7-Discovery using latest IAR compiler (7.40.3). The application is is quite simple (read/write and list files from USB Flash drive), but I didn't manage to get it working. Based on the information on the display it seems that the enumeration and MSC part pass fine (Serial number detected, number of supported LUNs = 1, vendor = Generic, class = 0x08, ...). However, the example fails later on during first occurrence of f_write or f_read with FR_INVALID_OBJECTS error code. During debugging I have found out that MSC_Handle is left cycling in in MSC_IDLE state with error MSC_NOT_READY. If I change the error state into MSC_OK the FatFS starts working (reading, writting, listing files) just fine. Could this be a bug somewhere in USBH_MSC_Process function? I have also tried the FreeRTOS flavor of the same example from the same HAL release, but the problem is the same. I have also tried several different USB Flash drives, but with no luck. The problem seems similar to/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM3241G-EVAL%20-%20STM32Cube_FW_F4_V1.1.0%20-%20USB%20HOST%20MSC&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=585
, but this should be solved long time ago. I have also tried various optimization parameters (like described in previous post) but the result is the same. Has somebody tried the MSC host examples for STM32F7-DISCO? Thanks, ÄŒrt null2015-07-24 04:36 AM
I believe I have found the bug in the latest USBH (v2.3.1) library which was causing the problems described in the previous post. The problem lies in usbh_msc.c line 446 which has been changed.
WRONG (v2.3.1) if((phost->Timer - MSC_Handle->timer) > 10000) CORRECT if((phost->Timer - MSC_Handle->timer) < 10000)2015-07-29 06:59 AM
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.