Size of Flash Drive

Hello All,

Does anyone know exactly how to calculate the actual size that NetOS can use on the Flash drive.

I am using the ConnectCore9P and have set up the File System size to 1408K in the Flash Memory Map settings under project properties in Digi ESP. From the tests that I have done this seems to allow the total file size on the Flash drive to be about
1,200,000 bytes. I have determined this by using HTTP to download files until I get an error.

Is there a defined method for working out exactly what file size it is possible to store, and are there any API routines or other methods to determine free space on the drive from within the application?

Have you looked at NAFSvolume_stats()?

Also remember that everything is stored in blocks.


There is an element of the block size of the FLASH file system that affects the maximum file size allowed.

Please see the following from the API reference manual. Reference System Software Services
File System
Flash File System
Somewhere on that page you’ll find the following:

The block size used effects the maximum size of a file that can be mapped. The following are the file size limits using different block sizes:

512 block size: 8 MB+
1K block size: 64 MB+
2K block size: 512 MB+
4K block size: 4096 MB+

The above figures show that using a 1K block size allows mapping a file with a maximum size of over 64 MB bytes. Using a larger block size provides an 8 times (8x) increase in file size mapping capability.