cancel
Showing results for 
Search instead for 
Did you mean: 

How can i use sd card with httpd server? (LWIP/FATFS/ETHERNET/HTTPD/SDCARD)

KAnahar
Associate III

I need to use SD Card in my project because of my mcu has not enough memory space. I need 200MB free space so i want to use SD Card. My html,css, js files are big size. When I convert my html,css,js files to C file (fsdata.c), that file be more than 150-200MB. My MCU memory just 1MB. How can i do it? I looked FATFS-LWIP application in st code but it didnt help to me. It is basic example (i can not do anything with html,css,js file in this example). Please if you have any idea or advice, help to me 🙂

7 REPLIES 7
Andrew Neil
Evangelist III

Surely, an HTTPD server neither knows nor cares where its data comes from;

Similarly, reading from an SD card doesn't depend on where the data is going to be used.

How far have you got with this project so far?

Are you able to just serve a fixed, static web page - without any SD card?

Are you able to just read an SD card - without any networking or webserver?

KAnahar
Associate III

I can build httpd server project without SD Card. It is working now. But i need good graphic design so i need to use more space.

Also I can read data basically in sd card. But how can i do it for html css js i dont know.

HTML, CSS, and JS are just (text) files as far as the SD Card is concerned - you read them exactly the same as any other (text) file.

If I can read the fsdata.c file (which converted html, css, js files) on the sd card, the problem will be solved. But the content of the C file consists of binary codes.

No:

The fsdata.c file is a C source file to be compiled into your application.

If you want to load the files dynamically at run time, you will need to read the HTML, CSS, and JS files from the SD Card.

how its possible to showing design in screen with read c file?

sorry, I don't get what you're asking there.