cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Save Data in USB

haythem
Associate II
Posted on June 28, 2014 at 21:01

Hi, I'm looking for a means which lets me save a text file on a USB key from a variable that can be found in my program. . I work with a STM32F4 (KEIL compiler) 

  Does someone can help me to find a solution? 

Thank you in advance
5 REPLIES 5
Posted on June 29, 2014 at 01:18

STM32F4-DISCO, USB FLASH DRIVE, FATFS FILE SYSTEM

STM32F4-Discovery_FW_v1.1.0\Project\FW_upgrade\Binary\readme.txt
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
haythem
Associate II
Posted on July 01, 2014 at 17:07

Thank you, so the problem with FW upgrade is that the STM32F4 unable to detect my flash disk and therefore do not happen to save a text file to the flash disk

Posted on July 01, 2014 at 17:27

Sounds like a design issue, or the connectivity/type of USB Flash drive, to me.

Such connectivity is demonstrably achievable on the STM32F4-DISCO and STM32F429I-DISCO boards with an OTG type cable from the Micro-AB connector.

Suggest you review what you're doing, and express/present the problem is a solvable form.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
haythem
Associate II
Posted on July 01, 2014 at 17:39

I'll explain my problem. As part of a school project I am able to create a system that can calculate parameters with a mathematical formula that I have already defined in the program. Thereafter, the result will be stored in a variable of the type real. My problem is that wants to find a solution to be able to store the actual variable in a text file using a USB key connected to STM32F4 by an OTG cable.I tried to use the example ''FW upgrade'' but I can not understand very well that I can handle it properly.

Posted on July 01, 2014 at 18:04

Ok, but you need to understand the difference between the broad discussion about what your whole project needs to do, and the far narrower discussion about what your ''problem'' is, and why it's not detecting the USB Flash drive, if that is in fact what the problem is.

So you need to break down the project into smaller pieces, and understand how those pieces work, how they might be fashioned to your particular use case, and integrated into your larger project.

I have suggested looking at the FW Update example because it includes several key features you'll need. It provides a USB driver that talks to the Flash Drive, and integration layer to read/write on to the media, and a File System to manage the creation and access of the files, which is compatible with a PC OS that you might subsequently attach the USB Flash Drive.

The task for you is to understand the mechanics of what the example is doing now, strip out the firmware reading/upgrading functionality, and add some experimental code that writes some arbitrary data to a file. Once you have THAT working, then you need to look at porting it to your large application, or porting that functionality into the framework you've just created for yourself.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..