I have an STM32F7 Nucleo and I am trying to use the TCP CLI component from the STM32F4 example from FreeRTOSLabs. It simly has the ip-config and netstat commands. The problem I am having is that in the ip-config command callback, there is a call as follows:
FreeRTOS_inet_ntoa( ulAddress, ( &( pcWriteBuffer[ strlen( pcWriteBuffer ) ] ) ) );
So in the telnet console, when I call the ip-config, the Ip address is printed correctly, but on the second round of the callback, before it should print the Netmask, there is a Hard Fault. What I can see is that the first ntoa call somehow overwrites the CLI list in memory, so when
xReturn = pxCommand->pxCommandLineDefinition->pxCommandInterpreter( pcWriteBuffer, xWriteBufferLen, pcCommandInput );
is called there is an invalid address for the Ip Config pxCommandLineDefinintion
Here is what I see before and after
FreeRTOS_inet_ntoa() in the debugger:
Any suggestions on why this might happen? I am using BufferAllocation_2 for the TCP stack and heap_4 for MemMang. I tried increasing the heap size but it didn’t fix the problem. I’m guessing part of the problem is somehow in the pvPortMalloc but I cant find whats going on.