AnsweredAssumed Answered

Suggestion for USB MSC HOST on F7-Disco

Question asked by Majerle.Tilen on Aug 3, 2015
Latest reply on Aug 4, 2015 by Majerle.Tilen

I'm building USB MSC HOST implementation library from stack provided in CubeF7 v1.1.0 series. I successfully fixed a bug with comparison for timeout and I got it working far quickly for first time.

I took Application examples from CubeF7 for USB MSC Host and copy/paste things to my project. Again, quite fast successful.

Then, I checked how to use this in main file how to mount USB and worked OK.
File was written and text also to USB. Checked on PC and file is there. Great.

Then, I tried with another USB flash key, and there is funny thing:
1. Mounted is OK (f_mount returns FR_OK)
2. File is opened OK (FA_OPEN_ALWAYS | FA_WRITE | FA_READ)
3. f_puts said that characters are written to file.
4. File is closed OK (At least should be)
5. On some USB FLASH KEY, FR_NOFILE is returned when trying to reopen (With opening mode FA_READ | FA_WRITE) file and there is actually no file on USB, no matter what they returned on f_open and f_puts.
   On some works OK.

All USB flash keys were all formatted in different configurations (But all of them always the same when testing) for testing and write was OK always on the same.

So, I checked again ST example for MSC HOST, trying there the same KEY which didn't work on my example and there it worked OK.

So my question here for ST USB STACK developers.
Where should I look for error like this?

FATFS implementation is OK because it works on some of flash keys.

I'm using HS mode with external ULPI PHY.

PS: Library is built for F4 and F7 series (For F4 I took F429 Discovery with embedded PHY). There I got the same behaviour and have no idea why.
USB Conf is technically copy/paste from example on ST, except added is support for HA and FS modes at the same time if needed. This was checked and HS and FS modes are handled properly. I also enabled/disabled DMA for USB to test and always the same behaviour.

Another problem I have, is that when CACHE is enabled on F7 series, USB HS mode does not work. Again, where should I take a look for this problem? Not enabling cache on the beginning of main function works just OK.

I can send project if needed (working with Keil uVision). Clock configuration is the same as on example.

One of USB flash keys where this does not work is the one I got from STM32F439-EVAL board.

Below is image from my LOG on LCD I made by myself.

I hope we will find solution for this problem.

Edit: I've enabled FS mode also and I got the same behaviour. First it says that file is opened when I open it using FA_OPEN_ALWAYS mode and that string is written, but file is not on USB.