adding lwip on a existent project

Showing results for 
Search instead for 
Did you mean: 

adding lwip on a existent project

Contributor I


I'm trying to add lwip support to a existent project on FRDM-K66F

First I've created a new project (freeRTOS) with lwip support (and manny others supported devices), then I've created a other project from NXP example (dhcp_lwip_freeRTOS).

Both of then are working ok, but if I try to copy the contents of the lwip_dhcp_freertos.c to the main c file into my project it can't initialize the device:

Initializing PHY...

Cannot initialize PHY.

Another problem: If I copy the files freeRTOSConfig.h and lwipopts.h from nxp example to my source folder and delete the templete folders under freertos folder and lwip folders it don't compile anymore.

Is there a tutorial or something like that on how I can add lwip with dhcp support on a existent project?


Thank you!


--- UPDATE ---

Debbuging my project I found that the code fails here:


    /* Check PHY ID. */
        result = MDIO_Read(handle->mdioHandle, handle->phyAddr, PHY_ID1_REG, &regValue);
        if (result != kStatus_Success)
            return result;
    } while ((regValue != PHY_CONTROL_ID1) && (counter != 0U));

    if (counter == 0U)
        return kStatus_Fail;



The variable regValue aways had 0x00.

On the example project the regValue had 0x22


--- UPDATE ---

A very strange thing happen, when it reads the current regValue it was 0x00 on example:


regVallue are the last signaficative bits of mmfr

But when the function returns it had 0x22:


The same didn't happen on my project:



Somebody can help me?


But when 

0 Kudos
0 Replies