cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX 4.9 and USB host + fatfs

alex239955_stm1
Associate
Posted on August 21, 2015 at 21:31

Hello!

I apologize for my bad English, but I do not have anyone to ask.

My task is to create a USB host to work with flash pametyu. I also use fatfs.

I'm using a microcontroller STM32f407VG. To create a project I use CubeMX 4.9. Just to study, I use the example of FatFs_USBDiskSTM32Cube_FW_F4_V1.6.0.

What is the proper question.

Analyzing the example I knew how to work with flash memory, but after creating the project using CubeMX I could not do anything himself. Can anyone suggest how to write code after the creation of the project in order to be able to mount a drive to create a file and write to it anything.

Thanks in advance.
4 REPLIES 4
Posted on August 21, 2015 at 22:47

The FatFs stuff is modelled after the classic C File IO functions.

Chan's site has a lot of examples

http://elm-chan.org/fsw/ff/en/open.html

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
alex239955_stm1
Associate
Posted on August 21, 2015 at 23:07

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6Vt&d=%2Fa%2F0X0000000bpb%2FxGEnVqtvq_F1AFxolMIDYWjAORfv64GjYjLMUyj.upc&asPdf=false
michaelruebig9
Associate II
Posted on October 07, 2015 at 15:16

Hello,

same problem here.

Do you have a solution by now?

Michael

michaelruebig9
Associate II
Posted on October 27, 2015 at 15:38

My Solution:

Before mounting the drive, you have to check, if the

id

paramter of the

USBH_UserProcess

is set to

HOST_USER_CLASS_ACTIVE

.

FAT operations are only working in this state.

Michael