I maked simple program with LWiP, and call netconn_bind(conn, IP4_ADDR_ANY, port) halted MCU board nucleo-f767zi.
I maked simple program with LWiP. After I got dinamyc address, I tried socket connection and call netconn_bind halted MCU.
My code:
for(;;)
{
if(OK_D == 0)
{
IP_A = gnetif.ip_addr.addr;
if(IP_A == 0)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_RESET); // led 2
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_SET); // led 3
} else
{
dhcp_stop(&gnetif);
OK_D = 1;
}
} else
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET); //led 3
osDelay(1);
if(OK_E == 0)
{
conn = netconn_new(NETCONN_TCP);
if(conn != NULL)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_SET); //led 2
osDelay(1);
err1 = netconn_bind(conn, IP4_ADDR_ANY, 100);
osDelay(1);
err2 = netconn_connect(conn, &IP_Server, 21000);
if (err1 == ERR_OK)
{
OK_E = 1;
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7, GPIO_PIN_SET);
}
}
}
}
}
Please, help me resolve this problem.
LWiP settings in CubeMX:
