Skip to main content
ADevg.1
Associate
March 3, 2023
Question

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

  • March 3, 2023
  • 4 replies
  • 5100 views

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.

4 replies

KDJEM.1
Technical Moderator
March 3, 2023

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

ADevg.1
ADevg.1Author
Associate
March 7, 2023

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

Tesla DeLorean
Guru
March 7, 2023

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 VenmoUp vote any posts that you find helpful, it shows what's working..
ADevg.1
ADevg.1Author
Associate
March 9, 2023

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
March 31, 2023

Any reply ?

Haithem Rahmani
ST Employee
April 4, 2023

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
Technical Moderator
March 31, 2023