Store MQX web pages externally

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Store MQX web pages externally

Jump to solution
1,401 Views
seandema
Contributor IV

I'm working on a project that will be using the web page server feature of MQX RTCS. However the web pages will probably be too large to store using TFS(tiny file system) on the internal flash of the Kinetis K60 I'm using. Is there a way to store web pages externally? Preferably on a flash chip that I can put on my board. I'm not sure how to point the web server to that since all the example I have seen use TFS.

Thanks

Labels (1)
Tags (1)
0 Kudos
1 Solution
506 Views
Martin_
NXP Employee
NXP Employee

Hello,

Web pages can be stored on any media accesible via MFS. There exist the following examples:

-web pages stored on USB memory stick (/demo/web_hvac)

-web pages stored on SD card (TWR-K60N512 Quick start)

It is also possible to use FFS and store web pages on NAND flash. HTTPSRV application can access different file systems via aliases. For example your web browser can access web page like:

http://192.168.1.202/usb/index.html

and via HTTPSRV aliases this can be mapped to

a:/index.html

where a:/ is an MFS installed on whatever media (USB mass storage, SD card, ffs+NAND flash, external NOR flash via flashx).

View solution in original post

0 Kudos
5 Replies
506 Views
seandema
Contributor IV

In case anyone else is looking into the issue. I was able to store webpages externally on a SPI based flash part that was formatted with MFS. Allowing me to access it like any other MFS based drive such as USB flash. I received some driver code called NFTL from my Freescale rep that allowed me to run MFS over the SPI interface. Then I just wrote a little copy function to copy my web pages from a USB drive to the SPI flash and pointed the web server to the SPI flash driver letter (something like c:).

Hope that helps.

0 Kudos
506 Views
williamely
Contributor IV

Another option that I have used is to gzip the HTML, JS, and CSS files and modify the web server to alert the browser that the files are gziped. This is a common practice for web servers like IIS and Apache. You might find that you don't need external memory at all. I typically see an overall 75% reduction in size. I have made a utility that automates this process but I can't release it to the public however I can tell you to look at the HTTP compression article on Wikipedia and go from there.

Your application my be different than mine but I have made the assumption that my clients are using a browser capable of handling gzip compressed files (any popular browser made in the last decade...) and do not need to negotiate the compression scheme.

I need to update my MQX 4.1 RTCS to handle HTTP compression so maybe I'll post a write-up how to do this if anyone is interested.

0 Kudos
507 Views
Martin_
NXP Employee
NXP Employee

Hello,

Web pages can be stored on any media accesible via MFS. There exist the following examples:

-web pages stored on USB memory stick (/demo/web_hvac)

-web pages stored on SD card (TWR-K60N512 Quick start)

It is also possible to use FFS and store web pages on NAND flash. HTTPSRV application can access different file systems via aliases. For example your web browser can access web page like:

http://192.168.1.202/usb/index.html

and via HTTPSRV aliases this can be mapped to

a:/index.html

where a:/ is an MFS installed on whatever media (USB mass storage, SD card, ffs+NAND flash, external NOR flash via flashx).

0 Kudos
506 Views
seandema
Contributor IV

Thank you, that clears up a lot.

Am I correct in understating that flashx is included with MQX but FFS is not? I'd like to try using a flash chip as that seems like the lowest cost option. I believe there are licensing fees when using SD cards and I'm using the USB port for other stuff on this project.

Thanks

0 Kudos
506 Views
Martin_
NXP Employee
NXP Employee

FFS is a standalone patch for Freescale MQX 4.0.2.2.

Freescale MQX™ Software Solutions Product Summary Page

Supported for TWR-K60F120M, TWR-K70F120M, TWR-MCF54418 and TWR-VF6510 boards.  Please note the FFS wear levelling requires tens of KBytes memory for function.