Nucleo F746 - LwIP / TCP Server
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-12-15 11:53 PM
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.
- Labels:
-
Ethernet
-
STM32CubeIDE
-
STM32F7 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-12-22 5:46 AM
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?
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);
