I am trying to build an application that uses FreeRTOS and the lwip stack. I am using the MIMXRT1064-EVK with version 2.6.1 of the SDK.
I am running into an issue where after I have initialized enet and tcp/ip I cannot ping the board.
I am initializing enet and tcp/ip with the same code that is in the example programs provided by the sdk, and have an almost identical configuration for lwipopts.h. I have attached my version of lwipopts.h to this post for comparison.
I know my connection to the board is good because when I flash the example programs to the board I am able to ping them without issues.
Have I set up anything incorrectly in my initialization that could be causing this issue?
Are there other places that I should be looking that could be causing this issue?
Thanks in advance,
Joe
Code used to initalize enet and tcp/ip:
gpio_pin_config_t gpio_config = {kGPIO_DigitalOutput, 0, kGPIO_NoIntmode};
BOARD_ConfigMPU();
BOARD_InitPins();
BOARD_BootClockRUN();
BOARD_InitDebugConsole();
BOARD_InitModuleClock();
//TCPIP init
IOMUXC_EnableMode(IOMUXC_GPR, kIOMUXC_GPR_ENET1TxClkOutputDir, true);
GPIO_PinInit(GPIO1, 9, &gpio_config);
GPIO_PinInit(GPIO1, 10, &gpio_config);
/* pull up the ENET_INT before RESET. */
GPIO_WritePinOutput(GPIO1, 10, 1);
GPIO_WritePinOutput(GPIO1, 9, 0);
delaygpio();
GPIO_WritePinOutput(GPIO1, 9, 1);
IP4_ADDR(&fsl_netif0_ipaddr, IP_ADDRESS_0, IP_ADDRESS_1, IP_ADDRESS_2, IP_ADDRESS_3);
IP4_ADDR(&fsl_netif0_netmask, IP_MASK_0, IP_MASK_1, IP_MASK_2, IP_MASK_3);
IP4_ADDR(&fsl_netif0_gw, IP_GW_0, IP_GW_1, IP_GW_2, IP_GW_3);
tcpip_init(NULL, NULL);
netifapi_netif_add(&fsl_netif0, &fsl_netif0_ipaddr, &fsl_netif0_netmask, &fsl_netif0_gw, &fsl_enet_config0,
ethernetif0_init, tcpip_input);
netifapi_netif_set_default(&fsl_netif0);
netifapi_netif_set_up(&fsl_netif0);
PRINTF("\r\n************************************************\r\n");
PRINTF(" TCP Echo example\r\n");
PRINTF("************************************************\r\n");
PRINTF(" IPv4 Address : %u.%u.%u.%u\r\n", ((u8_t *)&fsl_netif0_ipaddr)[0], ((u8_t *)&fsl_netif0_ipaddr)[1],
((u8_t *)&fsl_netif0_ipaddr)[2], ((u8_t *)&fsl_netif0_ipaddr)[3]);
PRINTF(" IPv4 Subnet mask : %u.%u.%u.%u\r\n", ((u8_t *)&fsl_netif0_netmask)[0], ((u8_t *)&fsl_netif0_netmask)[1],
((u8_t *)&fsl_netif0_netmask)[2], ((u8_t *)&fsl_netif0_netmask)[3]);
PRINTF(" IPv4 Gateway : %u.%u.%u.%u\r\n", ((u8_t *)&fsl_netif0_gw)[0], ((u8_t *)&fsl_netif0_gw)[1],
((u8_t *)&fsl_netif0_gw)[2], ((u8_t *)&fsl_netif0_gw)[3]);
PRINTF("************************************************\r\n");
Hi Joseph:
I tested the lwip_tcpecho_freertos demo with evkmimxrt1064 board, using your lwipopts.h
First the compile failed.
If I comment on below line, it will be OK
//#define LWIP_TIMEVAL_PRIVATE 0
I can ping successfully on my side.
I did not modify anything on lwip_tcpecho_freertos.c.
It seems the difference between us is the macro 'LWIP_TIMEVAL_PRIVATE'.
I would suggest you check this macro. and double check it on your side.
Regards
Daniel