2
\$\begingroup\$

I have PIC18F67K22 controller. I am making data logging system. I am using M25PE80 external flash for storing data.

I am storing session wise data in external flash. Also I am storing start and stop address of every session in PIC internal EEPROM.

So How can I delete individual session to manage all session?

For example: If we have stored six session in flash and we want to delete the 3rd session then all data after the 3rd session is overwrite to 3rd session to last session means all session is moving towards.

\$\endgroup\$
1
  • \$\begingroup\$ You probably want a file system. Maybe you can adapt e.g. FatFs to your needs? \$\endgroup\$
    – Renan
    Commented Aug 21, 2013 at 14:25

1 Answer 1

3
\$\begingroup\$

It seams to me that you need to implement some sort of File System.

Following your example: That way you don't need to copy all the data after the 3rd session back. It'll just create an empty sector that will be filled in a future file writing.

I suggest implementing a sort of FAT file-system. That why if you want to extend your project to have almost unlimited space (going from 8Mb to something like 2GB) is just a matter of writing a SD-card driver.

Also by taking a look at the datasheet I would consider making the sector size 64KB, or 4KB, to match the sector erase from the FLASH. This helps a lot since when deleting data you don't need to cache a part of it and write it back.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ +1 for using FAT: FatFs provides a nearly ready-to-use implementation (just needs to write a few microcontroller-specific functions). \$\endgroup\$
    – Renan
    Commented Aug 21, 2013 at 14:25
  • \$\begingroup\$ @Renan: FatFs seams like a cool implementation \$\endgroup\$
    – arthur.b
    Commented Aug 21, 2013 at 16:17
  • \$\begingroup\$ @shail korat : If I have answered your question could you accept it as an answer? I'm new to the website, but I think that's the way it works. \$\endgroup\$
    – arthur.b
    Commented Aug 22, 2013 at 17:27
  • \$\begingroup\$ @arthur.b: I am also new to the website.You answered your question which is not my exact answer for me but I got an idea to what i do.so thank very much. \$\endgroup\$ Commented Aug 23, 2013 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.