lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] An external filesystem for httpd


From: Noam Weissman
Subject: Re: [lwip-users] An external filesystem for httpd
Date: Thu, 1 Feb 2018 08:56:42 +0000

Hi,

I have created a separate HTTPD server based on the contribution, some input 
from other users and my own input.

One of the changes that I made was to create a different FS structure. Instead 
of a link list that places each file
after the other and a linked list at the end of data I created a link list that 
holds OFFSET to file location before the list of files.

The difference is, that this construction can be either placed internally in 
the micro or externally in a large FLASH. 

I created a PERL script that has two options. Either creates a C data file 
similar to the one used in the contribution 
And can be linked with the project, or a binary file that can be stored in an 
external FLASH. All the user need to do is 
know where is the base address for the beginning of linked list starts and 
change FS code to read from external FLASH.

The code for using an external FLASH is not yet finished as I never actually 
had time to test it with an external FLASH file. 
I use it now only internally In a micro, similar to the standard HTTPD.

The file construction that I use is as follows:

#  typedef struct 
#  {
#    int OffsetToNextHeader;    // offset in bytes to the next header
#    int OffsetToFileName;      // offset in bytes to the file name
#    int FileDataLen;           // file size in bytes
#    int OffsetToFileData;           // offset in bytes to the file data
#               
#  } FsDataFile_t;


First the file has a list of the above items. Secondly following the above 
items are the actual HTML etc files.

Actually one even can place the HTML, JS etc... files in none continues memory.

Hope that helps in any way.  


BR,
Noam.


-----Original Message-----
From: lwip-users [mailto:address@hidden On Behalf Of Giuseppe Modugno
Sent: Thursday, February 01, 2018 10:15 AM
To: address@hidden
Subject: [lwip-users] An external filesystem for httpd

Until now, I was using the embedded fs generated by the tool makefsdata. 
Unfortunately the filesystem I'd like to create is bigger than the internal 
Flash memory of the MCU.

I'm thinking to use an external SPI Flash memory to save the filesystem. 
So I need another tool that creates an ouput binary (or Intel Hex) image file 
to save directly in the SPI Flash memory. I know I can write this tool 
completely myself, but I'm sure there are some good examples to look at.
Also I need some source code to access this filesystem over SPI (open file, 
read 100 bytes, and so on).

I think I can use the FAT filesystem, however I think it is over complicated 
respect what I need to do.

Actually httpd automatically search for files in fsdata data structure (that is 
a linked list). With an external file system, I think I have to consider every 
file as a custom file. I'm in doubt if it's better to read immediately the 
content from external Flash in
fs_read_async_custom() (blocking until all data are ready), or start a 
background (non-blocking) process that reads from external SPI Flash and 
signals when it ends.

Any suggestions?


_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]