cancel
Showing results for 
Search instead for 
Did you mean: 

How to show a text from a file (FatFs)?

I would like to show a text from a .txt file (FatFs).

The .txt file contains a log of the HMI, so it gets every time bigger.

Is there any solution to show any dynamic text?

I can do it with a wild card and set the buffer size very high. But someday the text from the file will get bigger then the wildcard buffer.

Regards

Dejan

1 ACCEPTED SOLUTION

Accepted Solutions

Write something that is adaptive and capable of working with a small memory footprint.

Change the paradigm so you don't need to load the whole file.

Perhaps be capable of pulling in lines, consider multiple passes allowing you to count lines, and record line start offsets.

Determine how many lines you need to display.

FatFs provides f_size() to determine size of file to process

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

View solution in original post

2 REPLIES 2

Write something that is adaptive and capable of working with a small memory footprint.

Change the paradigm so you don't need to load the whole file.

Perhaps be capable of pulling in lines, consider multiple passes allowing you to count lines, and record line start offsets.

Determine how many lines you need to display.

FatFs provides f_size() to determine size of file to process

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

@Community member thank you, for this approach.