FCB use case for a large flash size

Hi,

I noticed that the f_sector_cnt element of the fcb struct is a uint8_t.

How is that supposed to handle large flash sizes? I mean even with a sector of 64KB, the FCB can only take about 16MByte.

I have a flash size of 128MBytes used for sensor data logging, and want to use the FCB to handle that.

Is it safe to change the sector count type on the fcb driver files? or, should I just use multiple instances of the fcb, even that would need about 8.

Parents
  • I think you can simply change the definition of f_sector_cnt from uint8_t to unti16_t.  The usage of f_sector_cnt within fcb.c implementation is conditional checks only and the actual initialization happens in the application which can initialize it to what ever it likes based on the size of the memory it needs. I do not see anywhere in the code where you will have any loss of data due to default casting from the compiler.

Reply
  • I think you can simply change the definition of f_sector_cnt from uint8_t to unti16_t.  The usage of f_sector_cnt within fcb.c implementation is conditional checks only and the actual initialization happens in the application which can initialize it to what ever it likes based on the size of the memory it needs. I do not see anywhere in the code where you will have any loss of data due to default casting from the compiler.

Children
No Data
Related