This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP-AM243: LittleFS buffer configuration

Part Number: LP-AM243
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Dear Sirs,

How to modify the sizes of .read_buffer, .prog_buffer, and .lookahead_buffer in lfs_config for LittleFS?
As far as I know, these buffer sizes should be related to .cache_size and .lookahead_size.
However, when I change these values through SysConfig, the buffer sizes do not actually change.

Regards,
Harry Chu

  • Hi Harry,

    I have tried changing the parameters and it is getting updated properly.

    Can you share the method how you are trying to update this values?

    Please refer below video for reference.

    Regards,

    Tushar

  • Hi Tushar,

    I may have caused some confusion earlier.

    I mean that the buffer sizes of gLfsReadBuffer0, gLfsWriteBuffer0, and gLfsLookaheadBuffer0 do not change based on the values of .cache_size and .lookahead_size.

    Regards,
    Harry Chu

  • Hi Harry,

    I have checked the SDK code and it seems that the size of above mentioned buffer depends on the read sector size of Flash.

    Please refer below image.

    Regards,

    Tushar 

  • Hi Tushar,

    This does indeed change the size of these buffers, but it's still not based on .cache_size and .lookahead_size. I think there might be an issue here.

    Regards,

    Harry Chu

  • Hi Harry,

    This does indeed change the size of these buffers, but it's still not based on .cache_size and .lookahead_size. I think there might be an issue here.

    Does the size of buffer depends on the .cache_size and .lookahead_size variable? I don't think this is the case here and in the SDK also we are not calculating the size of those buffers based on cache_size or lookahead_size.

    Regards,

    Tushar

  • Hi Tushar,

    This comment comes from lfs.h, which I believe is correct. Since these are optional statically allocated buffers, perhaps an option could be provided to disable them.

    By the way, *lookahead_buffer is in the same situation.

    Regards,

    Harry Chu

  • Hi Harry,

    To update the read and write buffers according to the value configured in 

    You can do the following change in the littlefs_open_close_config.c.xdt file located at ${MCU+SDK}/source/sysconfig/fs/.meta/littlefs/templates.

    Regards,

    Tushar