Skip to main content
AJeth.2
Associate
January 15, 2021
Question

How To Read Chunk Character Using Fat FS, in My file 6 Lakh Character

  • January 15, 2021
  • 3 replies
  • 1596 views

how to read 600 K(6 Lakh ) and more character at a time using Fat FS Micro SD Card , my File store in SD Card in File more then 6 Lakh Character is there , If any other way to read please help me , thanks in advance

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
January 15, 2021

You break the task into smaller bite size pieces you can manage.

For text files and things with inconsistent sizing you'll need to buffer slightly differently and use thought and skill. The "Read Everything" method is not one that scales well.

T​ry implementing on a PC using fopen, fread, etc it will be easier to work through the logic.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
AJeth.2
AJeth.2Author
Associate
January 15, 2021

Thank you for your answer

Tesla DeLorean
Guru
January 15, 2021

For FatFs you can use f_size to determine a file length, vs fseek,ftell in usual C implementations.

If you have a 32KB buffer, do alternating f_read/f_write to copy the content of one file to another, for example

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
AJeth.2
AJeth.2Author
Associate
January 15, 2021

Yes i checked the File length using ​ f_size in my file 650000 length, when i am read the file using f_read then hard fault error is there. Buffer data type is BYTE.

​​

I need the whole file character in one buffer,i mean 650000 character.​