adding lwip on a existent project

cancel
Showing results for 
Search instead for 
Did you mean: 

adding lwip on a existent project

52 Views
alfredos
Contributor I

Hi!

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:

 

//File:fsl_phyksz8081.c
    /* Check PHY ID. */
    do
    {
        result = MDIO_Read(handle->mdioHandle, handle->phyAddr, PHY_ID1_REG, &regValue);
        if (result != kStatus_Success)
        {
            return result;
        }
        counter--;
    } 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:

alfredos_0-1617657260360.png

regVallue are the last signaficative bits of mmfr

But when the function returns it had 0x22:

alfredos_1-1617657532080.png

The same didn't happen on my project:

alfredos_2-1617657915517.pngalfredos_3-1617657971461.png

 

Somebody can help me?

 

But when 

0 Kudos
0 Replies