cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo F746 - LwIP / TCP Server

KPovs.1
Associate II

I have managed to get LwIP working and my Nucleo can be pinged and discovered via IP scanner tool. I want to get TCP/IP server working and I saw there are some files called TCP inside LwIP Library I just can get my head around it. But I have used TCPServerRAW that I got from a tutorial. Everything is fine until server need to transmit back, well until program wants to write into (probably unwritable) memory location. I just can't figure out where I can change those parameters so that TX pbuff dosen't end up in HardFault. I tried to setup MPU but I can't find locations soooo...

I am using latest CubeIDE update (1.11.0).

Below are the files I am using.

1 REPLY 1
KPovs.1
Associate II

Ok, So I've tried to not use these files I have mentioned above and started a fresh project and used integrated into LwIP libraries. So after reading comments / instructions in tcp.c file I tried to create project with these instructions. But somehow I still get a HardFault.

So these are the steps:

  • Created a new tcp_pcb with function tcp_new(). there the problem begins where function can't allocate memory for new pcb. Functions does not create pcb with state = CLOSED. ok next..
  • when I call tcp_bind() function I get a HardFault. I think there is some problem in memory allocation. Bellow I will also attach picture of memory pools that LwIP or whatever creates. What I can see from the memory map they are not incorrect so I don't know what the problem could be? maby I need to configure MPU so the MCU can acces those memory pools?

0693W00000WLdFoQAL.png 

also STM goes into HardFault at line 683 of tcp.c:

  LWIP_ERROR("tcp_bind: can only bind in state CLOSED", pcb->state == CLOSED, return ERR_VAL);