S32k344 LWIP example Ping not working

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

S32k344 LWIP example Ping not working

200 Views
vaddi_vishal
Contributor I

I am using the lwIP example Example_S32K344_EMAC_lwIP_FreeRTOS_miniEVB_v1_0_S32DS36_RTD600.zip to test Ethernet functionality on the S32K344.

I downloaded this example from a post in the NXP Community and am using it without making any modifications to the code.

I have a few questions:

  1. Is there a way to create an lwIP example project directly in S32 Design Studio (S32DS), similar to how we create projects for UART, I2C, SPI, etc.?

  2. I am currently using a virtual platform for the S32K344 board to flash and run this lwIP example. However, when I connect using GDB, the program always enters the HardFault handler.

Could you please help me understand:

  • What might be causing the HardFault?

  • Whether lwIP examples can run on a virtual platform, or if real hardware is required?

If I am doing something incorrectly, please let me know.

Thank you.

Tags (1)
0 Kudos
Reply
4 Replies

186 Views
PavelL
NXP Employee
NXP Employee

Hello @vaddi_vishal ,

The lwIP Ethernet demo requires a real EMAC + PHY + link partner (and board-level wiring such as PHY reset/straps and reference clocks). Many “virtual platforms” model only a subset of peripherals and external hardware, and Ethernet support can be partial/incomplete depending on the platform. So, you need to configure your virtual platform to match the S32K344 miniEVB as closely as possible.

ad 1. Yes, you can create a project directly from lwIP example.

ad 2. You need to pinpoint which line of code is triggering the HardFault.

Best regards,

Pavel

0 Kudos
Reply

183 Views
vaddi_vishal
Contributor I
Thanks for the reply. How can I create the lwip example directly from s32ds? I am using s32ds 3.6.6 and RTD 6.0.0
0 Kudos
Reply

180 Views
PavelL
NXP Employee
NXP Employee

Hello @vaddi_vishal ,

From S32DS main menu - File/New/S32DS Project from Example

PavelL_0-1777442841984.png

lwIP examples are included in S32K3 TCPIP package.

Version S32K3 TCPIP 3.0.0 (SW32K3_TCPIP_STACK_3.0.0_D2507_DesignStudio_updatesite.zip) is dedicated for S32K3 RTD 6.0.0. SW32K3_FreeRTOS_11.1.0_6.0.0_CD1_D2506_DesignStudio_updatesite.zip should be install prior TCPIP stack. Please follow installation instruction in the respective Release Note for each package.

Best regards,

Pavel

0 Kudos
Reply

168 Views
vaddi_vishal
Contributor I
Thanks.
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2358192%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32k344%20LWIP%20example%20Ping%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358192%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20the%20lwIP%20example%20%3CSTRONG%3EExample_S32K344_EMAC_lwIP_FreeRTOS_miniEVB_v1_0_S32DS36_RTD600.zip%3C%2FSTRONG%3E%20to%20test%20Ethernet%20functionality%20on%20the%20S32K344.%3C%2FP%3E%3CP%3EI%20downloaded%20this%20example%20from%20a%20post%20in%20the%20NXP%20Community%20and%20am%20using%20it%20without%20making%20any%20modifications%20to%20the%20code.%3C%2FP%3E%3CP%3EI%20have%20a%20few%20questions%3A%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3EIs%20there%20a%20way%20to%20create%20an%20lwIP%20example%20project%20directly%20in%20S32%20Design%20Studio%20(S32DS)%2C%20similar%20to%20how%20we%20create%20projects%20for%20UART%2C%20I2C%2C%20SPI%2C%20etc.%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EI%20am%20currently%20using%20a%20virtual%20platform%20for%20the%20S32K344%20board%20to%20flash%20and%20run%20this%20lwIP%20example.%20However%2C%20when%20I%20connect%20using%20GDB%2C%20the%20program%20always%20enters%20the%20HardFault%20handler.%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3ECould%20you%20please%20help%20me%20understand%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EWhat%20might%20be%20causing%20the%20HardFault%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EWhether%20lwIP%20examples%20can%20run%20on%20a%20virtual%20platform%2C%20or%20if%20real%20hardware%20is%20required%3F%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EIf%20I%20am%20doing%20something%20incorrectly%2C%20please%20let%20me%20know.%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k344%20LWIP%20example%20Ping%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358298%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThanks.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358259%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k344%20LWIP%20example%20Ping%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358259%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F262131%22%20target%3D%22_blank%22%3E%40vaddi_vishal%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EFrom%20S32DS%20main%20menu%20-%20File%2FNew%2FS32DS%20Project%20from%20Example%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22PavelL_0-1777442841984.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22PavelL_0-1777442841984.png%22%20style%3D%22width%3A%20365px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F383940iA89CA452B8CC1543%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22PavelL_0-1777442841984.png%22%20alt%3D%22PavelL_0-1777442841984.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ElwIP%20examples%20are%20included%20in%20S32K3%20TCPIP%20package.%3C%2FP%3E%0A%3CP%3EVersion%20S32K3%20TCPIP%203.0.0%20(SW32K3_TCPIP_STACK_3.0.0_D2507_DesignStudio_updatesite.zip)%20is%20dedicated%20for%20S32K3%20RTD%206.0.0.%26nbsp%3BSW32K3_FreeRTOS_11.1.0_6.0.0_CD1_D2506_DesignStudio_updatesite.zip%20should%20be%20install%20prior%20TCPIP%20stack.%20Please%20follow%20installation%20instruction%20in%20the%20respective%20Release%20Note%20for%20each%20package.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358251%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k344%20LWIP%20example%20Ping%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358251%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EThanks%20for%20the%20reply.%20How%20can%20I%20create%20the%20lwip%20example%20directly%20from%20s32ds%3F%20I%20am%20using%20s32ds%203.6.6%20and%20RTD%206.0.0%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358243%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32k344%20LWIP%20example%20Ping%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358243%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F262131%22%20target%3D%22_blank%22%3E%40vaddi_vishal%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThe%20lwIP%20Ethernet%20demo%20requires%20a%20real%20EMAC%20%2B%20PHY%20%2B%20link%20partner%20(and%20board-level%20wiring%20such%20as%20PHY%20reset%2Fstraps%20and%20reference%20clocks).%20Many%20%E2%80%9Cvirtual%20platforms%E2%80%9D%20model%20only%20a%20subset%20of%20peripherals%20and%20external%20hardware%2C%20and%20Ethernet%20support%20can%20be%20partial%2Fincomplete%20depending%20on%20the%20platform.%26nbsp%3BSo%2C%20you%20need%20to%20configure%20your%20virtual%20platform%20to%20match%20the%20S32K344%20miniEVB%20as%20closely%20as%20possible.%3C%2FP%3E%0A%3CP%3Ead%201.%20Yes%2C%20you%20can%20create%20a%20project%20directly%20from%20lwIP%20example.%3C%2FP%3E%0A%3CP%3Ead%202.%26nbsp%3BYou%20need%20to%20pinpoint%20which%20line%20of%20code%20is%20triggering%20the%20HardFault.%3C%2FP%3E%0A%3CP%3EBest%20regards%2C%3C%2FP%3E%0A%3CP%3EPavel%3C%2FP%3E%3C%2FLINGO-BODY%3E