STM32CubeMX LWIP not working
hi all ,
i have verified the offset of LAN8720 in the datasheet and its fine.
PHY Special Control/Status register Offset - 0x1F
PHY Interrupt Source Flag Register Offset - 0x001D
other values i couldn't verify with datasheet.
When i set PHY_address is set 0 , the tow LED's on the Ethernet connector is OFF.
So i had to set to 1 .anyway for both case i didn't get ping reply from STM32F417.
As i said hardware has been verified already with hex file and ping was working fine.
So its clear that the configuration issue in my code .
This is my code :
int main(void)
{
/* MCU Configuration----------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
// MX_CRC_Init();
// MX_I2C1_Init();
// MX_I2C2_Init();
// MX_IWDG_Init();
// MX_RNG_Init();
// MX_SPI1_Init();
// MX_TIM3_Init();
// MX_TIM5_Init();
// MX_TIM8_Init();
// MX_TIM11_Init();
// MX_USART1_UART_Init();
// MX_USART3_UART_Init();
// MX_USB_OTG_HS_HCD_Init();
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_SET);
MX_LWIP_Init();
/* USER CODE BEGIN 2 */
// HAL_UART_Receive_IT(&huart1, rx_ser_buffer1, sizeof(rx_ser_buffer1));
// // Disable DE -> Enable /RE
// HAL_GPIO_WritePin(TSI_DE_GPIO_Port, TSI_DE_Pin, GPIO_PIN_RESET);
// dma_restart(&huart1, rx_ser_buffer3, sizeof(rx_ser_buffer3));
// HAL_UART_Receive_IT(&huart3, rx_ser_buffer3, sizeof(rx_ser_buffer3));
/* USER CODE END 2 */
static int state = 0;
while (1)
{
state = ~state;
MX_LWIP_Process();
HAL_GPIO_WritePin(LED0_GPIO_Port, LED0_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_GPIO_WritePin(LED2_GPIO_Port, LED2_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_GPIO_WritePin(LED3_GPIO_Port, LED3_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_GPIO_WritePin(LED4_GPIO_Port, LED4_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_GPIO_WritePin(LED5_GPIO_Port, LED5_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_GPIO_WritePin(LED6_GPIO_Port, LED6_Pin, (state != 0 ? GPIO_PIN_SET : GPIO_PIN_RESET));
HAL_Delay(200);
//HAL_IWDG_Refresh(&hiwdg);
/* Handle LwIP timeouts */
}
}
Is there any other setting to be done ? appreciate for your great help