cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H753 - Issue when setting up web server (issue with udp_init() )

JayDev
Senior II

Hello! I'm trying to setup a basic webserver and was following an online video that set it up for an F7 chipset. While the chips are very different, a lot of the processes should be similar so I'm trying to port it to an STM32H753. While researching the differences (and trying to set it up myself), I came across a number of issues that seem to be H7 specific.

I came across this guide on how to set things up correctly but I'm now having issues with the program stalling out when calling the MX_LWIP_Init() command. I've tried it with and without an OS but it seems to be getting stuck in the same place for both processes, so I assume something is getting stuck. Essentially, my call stack looks like this (I really wish they'd add a function call stack in the software like Atmel has):

MX_LWIP_Init()

lwip_init()

udp_init();

Eventually, it gets to the udp_init() function and it tries to call this function:

udp_init(void)
{
#ifdef LWIP_RAND
  udp_port = UDP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND());
#endif /* LWIP_RAND */
}

When it calls line 4, it goes to this section in syscalls.c and hangs:

void _exit (int status)
{
	_kill(status, -1);
	while (1) {}		/* Make sure we hang here */
}

Unfortunately, I'm still new to ethernet communications so I'm not entirely sure what the issue is. I suspect the issue has to do with some of the Cortex settings that were modified as described in the above link:

0693W00000BbxhCQAR.jpg 

My guess is it's trying to write/set something up in a place it shouldn't and that's the reason for the error? To be fair though, I don't understand what the error is trying to tell me other than it's trying to setup something related to the UDP and is just hanging. Maybe the issue is elsewhere.

Unfortunately, I've been poking at it for a few hours, managed to narrow it down to where it is, try a couple different configurations (both with and without OS, so it doesn't appear to be specific to that) and I end up in the same place. I must have a setting wrong somewhere.

At this point, I'm just trying to be able to simply ping the board so I'm hoping I get these basics down and can build on it from there. Any help you can give me would be greatly appreciated!

I'll include my project file just in case someone has a chance to take a look. Thanks for your help!

1 REPLY 1
alister
Lead

>> udp_port = UDP_ENSURE_LOCAL_PORT_RANGE(LWIP_RAND());

As an engineer, you're responsible whether you wrote it or not.

Read those macros or read the assembler in the list file (in Eclipse turn on list files in Tool Settings, Other/Reports) or in the debugger and/or step in and figure it out.

>>I came across this

Something here may help.

https://community.st.com/s/question/0D50X0000C6eNNSSQ2/bug-fixes-stm32h7-ethernet

https://community.st.com/s/question/0D50X0000BOtfhnSQB/how-to-make-ethernet-and-lwip-working-on-stm32