cancel
Showing results for 
Search instead for 
Did you mean: 

LWIP - udp_new() returns PCB as NULL

Mz.1
Associate III

Hi,

I decided to upgrade my STM32CubeMX to the latest version 6.9.1.

my project was generated first with STM32CubeMX 6.5.0 - so I had to copy the IOC manually.

I checked multiple times that all configuration is the same like it was, and it is.

 

when I'm calling the LWIP method udp_new() I'm getting NULL and than I can't send any UDP message.

I did a debug and notice this is happening under "do_memp_malloc_pool" function in the memp.c file

 

this is not happening in the old code generation.

 

it there special configuration that I'm not aware of?

 

thanks for the help!

This discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions
LCE
Principal II

Don't know about Cube, but in some *opt.h file you can set the maximum number of UDP PCBs, have you checked that?

Do you get this error already on the first udp_new() ?

And depending on STM32 you have to take care where in the SRAM the lwip memory pool is placed.
That definitely applies to the H7.

View solution in original post

3 REPLIES 3
LCE
Principal II

Don't know about Cube, but in some *opt.h file you can set the maximum number of UDP PCBs, have you checked that?

Do you get this error already on the first udp_new() ?

And depending on STM32 you have to take care where in the SRAM the lwip memory pool is placed.
That definitely applies to the H7.

Mz.1
Associate III

@LCE thanks for your reply :)

Don't know about Cube, but in some *opt.h file you can set the maximum number of UDP PCBs, have you checked that? yes it set to 4

> Do you get this error already on the first udp_new() ? yes on the first

 

Pavel A.
Super User

Debug. Go into udp_new().