cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to display a simple webserver page without rtos

Brasco72
Associate

Hello ,

I'm working on a STM32F407VET6 board with integrated ethernet port.
I'm using Stm32CubeIde 1.18.1 with firmware FW_F4 V1.28.2.
I'm just starting out and trying to display a webserver page without rtos for the moment.
I've been going round in circles for quite a long time, even with chatgpt and company...

At the moment I've managed to activate lwip (2.1.2) and it's working because when I start up I ping the address 192.168.0.123 and it responds.
However, as soon as I open my web browser and try to access it, the page doesn't display.

These are the obscure areas for me.
The tutorials I've followed show each time: First of all goto LWIP->Target->lwipopts.h and change the #define HTTPD_USE_CUSTOM_FSDATA 0
or I don't have this define generated automatically by stm32CubeIde so I don't set it.
I've used a tutorial "controllerstech".
I like it (I've even taken fsdata.c directly from it)
Every time I get build errors, so I exclude it.

I don't know where it's going wrong, but I've been failing for hours and hours...
If anyone can help me I'd be very grateful.

3 REPLIES 3
mbarg.1
Senior III

You could have problems:

in file system;

in Http decode;

in tcp receive ;

in tcp send;

in data overflow;

and, last but not least, you have an OS or Ethernet would not work; could be a no-brand one, but something is managing your app, and this is the worst nightmare for my glass ball to try to help you.

Hello,

Thank you for your reply. I know that there can be several sources of problems.
I was thinking that implementing a ‘hello world’ webserver page on my card should be something basic...
In fact, not so much for the uninitiated.

However, I set my pins to ioc, set the memories, enabled lwip and put my fsdata.c

From there the prerequisites seemed solid enough for me to find where the error comes from, I even added some printf on usart1 and I see them on putty, this indicates that ethernet is ok and in addition my ping works, it is when sending the request to get my page that it sticks. ... I don't know how to go about finding where the bug is... my fsdata.c is no good? do I have to include it in the build? or can I add printf to better understand what's going on?

 

Well, you have to look at LwIP and HttpD if they work properly, setting breakpoints and running step by step - unfortunately I do not have any f407 hw to replicate your problem.

You have ping working, than you should be able to see if any SYN packet comes in, if you reply with SYNACK and if HTTP GET is coming and is acked, probably wiresahrk can tell it without digging deeper in code.

But at the end, you must see why your app discard the GET or does not point to correct FS - you will need to go low level.