lwIP stack ping demo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

lwIP stack ping demo

4,248 Views
Kewal
Contributor IV

I was trying to build the demo of lwip stack with freertos. though I am able to build, debug and able to see debug prints like TCP/IP initializing/ initialized... and ping:send and ip address.

 

When I ping the board I am not able to get through it.

 

1. My activity is blinking(with equal interval) and link is steady. I have set the jumper settings in MII mode. I am able to see some debug printfs.

also i have tried,

2. My activity seems to blink (with unequal interval) and link is steady. I have set the jumper in RMII mode, I am unable to see any debug printfs.

 

I followed one of the guide for lwip stack integration for jumper settings. Is there any thing in details i need to check or missing here.

Labels (1)
0 Kudos
5 Replies

1,952 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi,

Which platform are you selecting to build that demo? Would you please help to specify? Thanks for your patience!

and the KSDK 1.2 has already provided the LwIP ping demo based on freeRTOS, you  may find in the folder of  C:\Freescale\KSDK_1.2.0\examples\frdmk64f\demo_apps\lwip\lwip_ping_demo\ping_rtos\ping_freertos after installation. Have you tried it? if you still fail with this demo, then maybe there is some hardware issue of your board, such as jumper settings or something like that, but if this demo works well with your board, there should  be software issue in your own project.

Hope that helps,


Have a great day,
Kan

Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,952 Views
Kewal
Contributor IV

Oh I almost forgot mention about the hardware, I have currently chosen TWR-K64F120M based demo of LwIP and also working on a TWRK64 hardware. I have not changed any jumper settings expect I am putting the serv board in MII configuration. There is a document online which says hardware has to be configured in RMII mode for demo to work but the PHY driver code checks if its MII mode.

I am getting confused there. And can you direct me to the right jumper settings for achieving the LwIP demo?

Thanks,

Kewal

0 Kudos

1,952 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Kewal,

Yes, TWR-K64F120M does support MII interface, but the LwIP ping demo needs some modification to support this . before going ahead, please check the board jumpers settings referring to the following links.

TWR-SER: http://cache.freescale.com/files/microcontrollers/doc/user_guide/TWRSERUM.pdf

TWR-K64F120M : http://cache.freescale.com/files/microcontrollers/doc/user_guide/TWRK64F120MUG.pdf

for TWR-K64F120M and TWR-SER, please make sure the jumpers are set in default configuration. Please note the K64 tower board user guide provide table 5 for RMII settings, so for MII, just following the table 6.

above are hardware configuration, for software , please open the project in the folder of "C:\Freescale\KSDK_1.2.0\examples\twrk64f120m\demo_apps\lwip\lwip_ping_demo\ping_bm" after you installed KSDK 1.2, and add MII config in ethernetif.c and use MII config to replace RMII config in the enet configuration structure.

enet_config_rmii_t miiCfg = {kEnetCfgMii, kEnetCfgSpeed100M, kEnetCfgFullDuplex, false, false};

enet_mac_config_t g_enetMacCfg[ENET_INSTANCE_COUNT] =

{

{

kEnetMacNormalMode,  /*!< ENET normal mode*/

NULL,      /*!< ENET mac address*/

    &miiCfg,

    /*!< enet mac control flag recommended to use enet_mac_control_flag_t

it is special control for loop mode, sleep mode, crc forward/terminate etc*/

kEnetRxCrcFwdEnable | kEnetTxCrcBdEnable | kEnetMacEnhancedEnable,

NULL,    /*!< ENET Rx FIFO threshold*/

NULL,    /*!< ENET Tx FIFO threshold*/

0,    /*!< ENET rxaccelerator config*/

    0, /*!< ENET txaccelerator config*/

0,    /*!< ENET Pause duration*/

    NULL, /*!< ENET Special configure for MAC*/

#if FSL_FEATURE_ENET_SUPPORT_PTP

    false,

#endif

},

};

I have tested that demo on my TWR-K64 board, and you may try it on your side.

44.png

Hope that helps,


Have a great day,
Kan

Freescale Technical Support
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,952 Views
Kewal
Contributor IV

Kan,

I just gave try and it works. thanks for the help.

Though it might be a IAR related question I would still ask if you could help me quickly, I was able to see .ewd file in the examples if you go down to the LWIP +FreeRTOS with IAR workspace. I have created a project with exactly same source code and grouping but I am not able to debug. the only difference is that .ewd file is present in the workspace provided by KSDK but when i create a workspace .ewd(debugger settings) file is missing.

I appreciate if you could help me on this.

thanks,

Kewal

0 Kudos

1,952 Views
Kewal
Contributor IV

Also what I am seeing is, when I try to debug it just gets stuck at Busfault handler. I am surely missing something to configure.

thanks,

Kewal

0 Kudos