Skip to main content
ADevg.1
Associate
Mar 3, 2023 5:36 AM UTC
Question

How to store a text file in STM32F4 using USB Mass Storage Class and FATFS?

I'm not able to create txt file, what issue , can you provide source code? please help me.

This topic has been closed for replies.

8 replies

KDJEM.1
ST Technical Moderator
Mar 3, 2023 8:48 AM UTC

Hello @ADevg.1​ and welcome to the Community :),

I recommend you to get started with the example provided here STM32CubeF4/Projects/STM32469I-Discovery/Applications/USB_Host/MSC_Standalone.

This example can help you to use the USB host application based on the Mass Storage Class (MSC) on the STM32F4xx devices and to write a small text file (less to 1 KB) on the USB flash disk.

Also, I advise you to take a look at this wiki.

I hope this help you!

Kaouthar

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.
ADevg.1
ADevg.1Author
Associate
Mar 7, 2023 11:34 AM UTC

Using Flash memory to create text file , is it possible ? without use any external USB or SD card. .

Tesla DeLorean
Guru
Mar 7, 2023 11:51 AM UTC

Yes, it's just a collection of bytes​.

The larger 128KB Flash blocks are a bit awkward to manage.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ADevg.1
ADevg.1Author
Associate
Mar 9, 2023 7:57 AM UTC

I'm allocate 128KB Flash block size, but file not created and unable to complete the format. https://github.com/ankitdevganiya13/STM32_USB_MSC_FATFS/tree/master

0693W00000aIYeZQAW.jpg

ADevg.1
ADevg.1Author
Associate
Mar 31, 2023 11:36 AM UTC

Any reply ?

Haithem Rahmani
ST Employee
Apr 4, 2023 10:15 AM UTC

Hi @ADevg.1​ 

IIRC, you are configuring the STM32 as an USB storage device and want to write data using the windows machine on the internal flash of the STM32?

is this correct?

KDJEM.1
ST Technical Moderator
Mar 31, 2023 12:47 PM UTC
To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.