cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly update fsdata_custom.c based website?

Raymond Buck
Senior

I am using STM32CubeIDE Version 1.3.1 on a Windows 10 computer to build my project.

I have a httpd server running on a custom STM32F407 board. It works properly and the website is displayed when accessed in a browser.

I use makefsdata.exe to convert the html code to a fsdata_custom.c file. The file is placed in the Middlewares/Third_Party/LwIP/src/apps/http folder.

The problem I have is when I make a modification to the html files and regenerate the fsdata_custom.c file. If I replace the existing file with the newly created file, the old website continues to be displayed. This has nothing to do with a caching problem. If I pull the site up in a browser on another computer that has never accessed the site, the old site is displayed.

I have found a convoluted way of making the 407 board display the new page.

I use File Explorer and right-click the fsdata_custom.c file, select Resource Configurations, and select Exclude from build. I then uncheck the Release checkbox, click OK, and compile the project. The build will fail with errors. I then use Resource Configurations again, check Release, and compile the project. It then compiles successfully and the new website is properly displayed.

If I again modify the html files and replace the fsdata_custom.c file I have to jump through the same hoops to get the new site to display. Why do I have to do this? I looked but didn't find any build settings in STM32CubeIDE that references the fsdata.c or fsdata_custom.c file.

1 REPLY 1
Raymond Buck
Senior

After an additional hour or so of testing I have figured out how makefsdata.exe properly. The makefsdata.exe file has to be in a separate directory with no other files present. The html files have to be in a separate folder by themselves. They cannot be in the same directory as the makefsdata.exe file. When you run the makefsdata program it will create the fsdata_custom.c file in the directory that makefsdata.exe is in.

Assume the html files are in c:\fss and makefsdata.exe is in c:\fm. Run the following command to generate the fsdata_custom.c file.

C:\fm makefsdata c:\fss -f:fsdata_custom.c <ENTER>

The fsdata_custom file will be created in the c:-fm directory. If you then compile the project and program the board, the new website will be displayed when accessed.

I don't know why the previous process I described worked. I was placing the html files in the same directory as the makefsdata program. I don't know why that would make a difference but somehow it confused the compiler.