element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Experts, Learning and Guidance
  • Technologies
  • More
Experts, Learning and Guidance
Ask an Expert Forum Discovery board. HTTP Server. Webpage in SD
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Experts, Learning and Guidance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 4 replies
  • Answers 1 answer
  • Subscribers 303 subscribers
  • Views 812 views
  • Users 0 members are here
  • sdio
  • http
  • stm32f4discovery
  • server
Related
See a helpful answer?

Be sure to click 'more' and select 'suggest as answer'!

If you're the thread creator, be sure to click 'more' then 'Verify as Answer'!

Discovery board. HTTP Server. Webpage in SD

Former Member
Former Member over 12 years ago

Hi Everyone,

 

I have a STM32F4Discovery board from ST Microelectronics, and I have implemented on it an http server using the lwip v1.41 stack. I also have implemented a micro-SD with SDIO and FATFS, and USB FS as a mass storage device. All of this is working fine together.

 

My question is if I can store the webpages in the SD card in binary format instead of using the fsdata.c inside the microcontroller flash. If so, how can I do that? Is there any example?

 

Thanks

  • Sign in to reply
  • Cancel
  • mconners
    0 mconners over 12 years ago

    I don't know that there is an example, and I only looked at the code to see if I could answer your questions, but here goes.

     

    In the file fs.c and fs.h is where your access to the "filesystem" is implemented. I think if you replace those the methods/functions in fs.c to read directly from the sd card you would effectively do what you want to do.

     

    They look like fairly simple/standard functions so it shouldn't be too difficult.

     

    Good luck,

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mconners
    0 mconners over 12 years ago in reply to mconners

    BTW, to clarify a little bit you would want to replace

     

    fs_open(), fs_close(), fs_read(), etc.. with functions of the same name, that take the same arguments and have them call the functons that you would use to access the file system on the sd card.

     

    You would have to take care of the mount somewhere, but you could create an fs_init() function that gets called from httpd.c when it gets loaded.

     

    What you are essentially doing is creating an adapter or a facade.

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to mconners

    Mike,

     

    Thanks for your help.

    I couldn't make it work yet (I'm kind of newbie in http and fatfs image) but I'm sure that's the way I have to follow.

     

    Martin

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mconners
    0 mconners over 12 years ago in reply to Former Member

    I'm not completely familiar with the entirety of the code you were working with, but I'm pretty certain the suggestions I made will get you where you need to go.

     

    In the fat fs code there are going to similar function calls to *_open(), *_close(), *_read(), so you either need to modify fs.c to call the functions in your fatfs code, or modify httpd.c to call the fatfs functions directly instead of the ones in fs.c.

     

    It seems like you've done pretty well getting all of that to work together so I'm sure you can get it done.

     

    Mike

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube