Skip to main content
Dejan Nedeljkovic
Associate III
September 8, 2020
Solved

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

  • September 8, 2020
  • 2 replies
  • 1150 views

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

This topic has been closed for replies.
Best answer by Tesla DeLorean

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

2 replies

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
September 8, 2020

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 VenmoUp vote any posts that you find helpful, it shows what's working..
Dejan Nedeljkovic
Associate III
September 9, 2020

@Community member thank you, for this approach.