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, ®Value);
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:
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
Hi @alfredos @danielchen ,
Actually I'm too facing the same issue, rather for me I created a new project from scratch - for c++
The current values before system assert happens are as follows:
Since regValue hasn't reached and the Counter/PHY_READID_TIMEOUT_COUNT haven't satisfied the while loop condition - The status turns into kStatus_Fail.
How does the things work under this hood ?
Any help is appreciated.
Hi alfredos:
Just an information: when you copy another folder into your MCUXpresso project, the default behavior is: this folder will be excluded from build. you need to uncheck "exclude resource from build".
Regards
Daniel