AnsweredAssumed Answered

LPCUSBlib + FatFS + USB Write Error while powering down periodically

Question asked by TOJO MADAPPALLIL THOMAS on May 13, 2019
Latest reply on May 20, 2019 by TOJO MADAPPALLIL THOMAS

Hi,

 

 

I have been using LPCUSBlib and FatFS in my project to support USB as a host. In my project, I store data to the USB device periodically. It was working smooth until I introduce a power save option.

 

 I tried to power down the USB when it is not in use. It saved me a lot of power conception. I was happy, and it looked working but some USB devices doesn’t like this power down. I found data loss on these USB’s. I loss the data which I write to the last file.

 

Starting Up

Create folder1->file1 and write some data

Create folder2->file2 and write some data

Create folder3->file3 and write some data

 

Power Down the USB

... 

Power Up the USB

Append some data to folder1->file1

Append some data to folder2->file2

Append some data to folder3->file3

 

Power Down the USB

 

When I check the files, data in the file3 found missing.

 

Any help is appreciated.

 

Thanks in advance.

Outcomes