cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP RTOS Home Page on NUCLEO-H723ZG not changing

Newtham
Associate II

Hi all,

I'm trying to create a simple webpage server on a NUCLEO-H723ZG. I understand some basics, but overall I'm pretty new to all of this. So I'm starting from the LwIP Server Netconn RTOS example. If I load the default example to the board, it works great. But, after trying everything I can think of, and looking all over the internet, I cannot seem to change the homepage to my own static HTML file. I've figured out how to use the MAKEFS scripts and all that, but, assuming it compiles without errors, the default homepage does not change. I've tried different options and saving the fsdata file to different directories, but nothing works.

This is for a proof-of-concept for my company's latest project, and I don't need to be an LwIP expert quite yet (maybe later). So, simple question: starting from the default LwIP Server Netconn RTOS example, and running MAKEFS script on my HTML files, how do I get them into my project so they show up? That's it: just how do I switch to a different homepage?

Thanks!!

Robert

1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal

After you have created the fsdata file, you have to copy it.

I have to copy it into the project's lwip http folder:

projectname\Middlewares\Third_Party\LwIP\src\apps\http

Important thing is that you don't let CubeIDE compile that file (somehow with right click menu).

I have that html stuff in some other folder, and then use a windows batch file *.bat for renaming and copying it to the project folder:

:: *******************************************************
:: file rename and copy batch
:: *******************************************************
 
@echo off
 
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo fsdata file batch copy and rename utility
echo ------------------------------------------------------------------
 
@echo off
 
:: ******* get OLD file DATE
for %%a in (fsdata_custom.c) do set FileModDate=%%~ta
set FileModDate=%FileModDate: =_%
set FileModDate=%FileModDate:.=-%
set FileModDate=%FileModDate::=-%
 
echo FileModDate: %FileModDate%
 
@echo on
:: ******* rename OLD file
rename fsdata_custom.c fsdata_custom_%FileModDate%.c
 
:: ******* move OLD file
move fsdata_custom_%FileModDate%.c 0_backup
 
:: ******* rename NEW file
rename fsdata.c fsdata_custom.c
 
:: ******* copy NEW file
copy fsdata_custom.c "D:\01 Development\STM32\STM32H723_ETA_Nucleo\Middlewares\Third_Party\LwIP\src\apps\http"
 
pause

View solution in original post

2 REPLIES 2
LCE
Principal

After you have created the fsdata file, you have to copy it.

I have to copy it into the project's lwip http folder:

projectname\Middlewares\Third_Party\LwIP\src\apps\http

Important thing is that you don't let CubeIDE compile that file (somehow with right click menu).

I have that html stuff in some other folder, and then use a windows batch file *.bat for renaming and copying it to the project folder:

:: *******************************************************
:: file rename and copy batch
:: *******************************************************
 
@echo off
 
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo fsdata file batch copy and rename utility
echo ------------------------------------------------------------------
 
@echo off
 
:: ******* get OLD file DATE
for %%a in (fsdata_custom.c) do set FileModDate=%%~ta
set FileModDate=%FileModDate: =_%
set FileModDate=%FileModDate:.=-%
set FileModDate=%FileModDate::=-%
 
echo FileModDate: %FileModDate%
 
@echo on
:: ******* rename OLD file
rename fsdata_custom.c fsdata_custom_%FileModDate%.c
 
:: ******* move OLD file
move fsdata_custom_%FileModDate%.c 0_backup
 
:: ******* rename NEW file
rename fsdata.c fsdata_custom.c
 
:: ******* copy NEW file
copy fsdata_custom.c "D:\01 Development\STM32\STM32H723_ETA_Nucleo\Middlewares\Third_Party\LwIP\src\apps\http"
 
pause

Thank you, LCE! I was finally able to get it! Greatly appreciated.

For the record, here's what I did (slightly modified from the above answer):

  1. Create a fresh instance of the LwIP_HTTP_Server_Netconn_RTOS example in my workspace in STM32CubeIDE.
  2. Use one of the editions of the "makefsdata" script to generate the fsdata.c file.
  3. Rename that file to fsdata_custom.c.
  4. Open my workspace folder in Windows and then navigate to LwIP_HTTP_Server_Netconn_RTOS\Middlewares\Third_Party\LwIP\src\apps\http
  5. Copy the fsdata_custom.c file to this folder.
  6. Clean, compile, and flash the program onto the NUCLEO-H723ZG.