Adding the Ethernet stack to the base firmware

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

Adding the Ethernet stack to the base firmware

270 Views
Anna_Anna
Contributor II

I am working with the 3-Phase Permanent Magnet Synchronous Motor Control Development Kit with S32K396 MCSPTR2AK396. I installed the following stack:
S32DS_3.6.5_RFP_win32
S32K3_ETPU_SW_4.9_2.0.1_D2512
SW32K3_S32M27x_RTD_R23-11_7.0.0_QLP03_D2512
SW32K3_FreeMASTER_Driver_1.5.0_D2512
S32K3xx_AMMCLIB_RTM_1_1_45_BIN
MCSPTR2AK396_SW
GCC version 10.2.
SW32K3_FreeRTOS_11.1.0_0.8.0_CD1_D2603
SW32K3_TCPIP_STACK_4.0.0_D2512

I tested two projects separately. The basic motor control project (MCSPTR2AK396_PMSM_FOC_3Sh_SwRes_ll_M7_0_0) works perfectly. The example project with Ethernet (lwip_baremetal_s32k396) also works, and the board pings successfully.

Next, I wanted to combine these two projects so that while controlling the motor, I could transmit data over Ethernet. It sounds like a logical continuation, but I encountered some difficulties.

In the motor project, the POWER module is used, and when I add the Ethernet driver (Eth_43_GMAC), it starts requiring the Mcu module. When I add the Mcu, the configurator complains—Mcu and POWER cannot coexist.

Now I’m trying different approaches: I attempt to replace POWER with MCU, try to transfer clock settings, but this leads to a bunch of other errors. And it’s unclear how many more incompatibilities will arise.

So my main question is: Is this even feasible? Am I wasting my time, and are these fundamentally incompatible things? Or am I just thinking incorrectly and missing something?

If anyone has successfully run both the motor and Ethernet together on the S32K396, please share your experience. Maybe there’s a ready-made example or a proven configuration method. I would be very grateful for any information.

Anna_Anna_1-1787238162573.png

Anna_Anna_3-1787238893017.png

 

 

 

Tags (1)
0 Kudos
Reply
1 Reply

205 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Please note that SW32K3_TCPIP_STACK_4.0.0_D2512 supports the GMAC HLD driver (Eth_43_GMAC), which is based on the MCAL Ethernet stack. The MCSPTR2AK396 example, however, is based on the IP driver layer.

Because of this architectural mismatch, integrating the TCP/IP stack into the existing MCSPTR2AK396 project is not a straightforward task. The TCP/IP stack does not interface directly with the IP-layer GMAC drivers.

The approach you tried could be feasible, using a mixed architecture where the motor-control peripherals remain on the IP driver layer while Ethernet uses the MCAL/HLD stack required by the TCP/IP solution. However, the feasibility of this approach must be evaluated on a case-by-case basis, depending on the specific drivers and overall software architecture used.

I am not aware of a ready-made demo combining both motor control and Ethernet on the S32K396.

However, HLD-based motor-control demos are available for other S32K3 derivatives, such as the S32K344:

https://community.nxp.com/t5/S32K-Knowledge-Base/S32K3-Motor-control-SW-examples/ta-p/1804577

These examples may provide useful guidance if you decide to move toward an HLD/MCAL-based architecture.

BR, Petr

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2407065%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAdding%20the%20Ethernet%20stack%20to%20the%20base%20firmware%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2407065%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20working%20with%20the%203-Phase%20Permanent%20Magnet%20Synchronous%20Motor%20Control%20Development%20Kit%20with%20S32K396%20MCSPTR2AK396.%20I%20installed%20the%20following%20stack%3A%3CBR%20%2F%3ES32DS_3.6.5_RFP_win32%3CBR%20%2F%3ES32K3_ETPU_SW_4.9_2.0.1_D2512%3CBR%20%2F%3ESW32K3_S32M27x_RTD_R23-11_7.0.0_QLP03_D2512%3CBR%20%2F%3ESW32K3_FreeMASTER_Driver_1.5.0_D2512%3CBR%20%2F%3ES32K3xx_AMMCLIB_RTM_1_1_45_BIN%3CBR%20%2F%3EMCSPTR2AK396_SW%3CBR%20%2F%3EGCC%20version%2010.2.%3CBR%20%2F%3ESW32K3_FreeRTOS_11.1.0_0.8.0_CD1_D2603%3CBR%20%2F%3ESW32K3_TCPIP_STACK_4.0.0_D2512%3CBR%20%2F%3E%3CBR%20%2F%3EI%20tested%20two%20projects%20separately.%20The%20basic%20motor%20control%20project%20(MCSPTR2AK396_PMSM_FOC_3Sh_SwRes_ll_M7_0_0)%20works%20perfectly.%20The%20example%20project%20with%20Ethernet%20(lwip_baremetal_s32k396)%20also%20works%2C%20and%20the%20board%20pings%20successfully.%3C%2FP%3E%3CP%3ENext%2C%20I%20wanted%20to%20combine%20these%20two%20projects%20so%20that%20while%20controlling%20the%20motor%2C%20I%20could%20transmit%20data%20over%20Ethernet.%20It%20sounds%20like%20a%20logical%20continuation%2C%20but%20I%20encountered%20some%20difficulties.%3C%2FP%3E%3CP%3EIn%20the%20motor%20project%2C%20the%20POWER%20module%20is%20used%2C%20and%20when%20I%20add%20the%20Ethernet%20driver%20(Eth_43_GMAC)%2C%20it%20starts%20requiring%20the%20Mcu%20module.%20When%20I%20add%20the%20Mcu%2C%20the%20configurator%20complains%E2%80%94Mcu%20and%20POWER%20cannot%20coexist.%3C%2FP%3E%3CP%3ENow%20I%E2%80%99m%20trying%20different%20approaches%3A%20I%20attempt%20to%20replace%20POWER%20with%20MCU%2C%20try%20to%20transfer%20clock%20settings%2C%20but%20this%20leads%20to%20a%20bunch%20of%20other%20errors.%20And%20it%E2%80%99s%20unclear%20how%20many%20more%20incompatibilities%20will%20arise.%3C%2FP%3E%3CP%3ESo%20my%20main%20question%20is%3A%20Is%20this%20even%20feasible%3F%20Am%20I%20wasting%20my%20time%2C%20and%20are%20these%20fundamentally%20incompatible%20things%3F%20Or%20am%20I%20just%20thinking%20incorrectly%20and%20missing%20something%3F%3C%2FP%3E%3CP%3EIf%20anyone%20has%20successfully%20run%20both%20the%20motor%20and%20Ethernet%20together%20on%20the%20S32K396%2C%20please%20share%20your%20experience.%20Maybe%20there%E2%80%99s%20a%20ready-made%20example%20or%20a%20proven%20configuration%20method.%20I%20would%20be%20very%20grateful%20for%20any%20information.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Anna_Anna_1-1787238162573.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Anna_Anna_1-1787238162573.png%22%20style%3D%22width%3A%20322px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Anna_Anna_1-1787238162573.png%22%20style%3D%22width%3A%20322px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F395037i0FEEEC43489008BB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Anna_Anna_1-1787238162573.png%22%20alt%3D%22Anna_Anna_1-1787238162573.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAnna_Anna_1-1787238162573.png%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAnna_Anna_1-1787238162573.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAnna_Anna_1-1787238162573.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Anna_Anna_3-1787238893017.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Anna_Anna_3-1787238893017.png%22%20style%3D%22width%3A%20384px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Anna_Anna_3-1787238893017.png%22%20style%3D%22width%3A%20384px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F395042i0FE6F28DDC00392C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Anna_Anna_3-1787238893017.png%22%20alt%3D%22Anna_Anna_3-1787238893017.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAnna_Anna_3-1787238893017.png%3C%2Fspan%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAnna_Anna_3-1787238893017.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAnna_Anna_3-1787238893017.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2408051%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Adding%20the%20Ethernet%20stack%20to%20the%20base%20firmware%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2408051%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CDIV%3E%0A%3CP%3EPlease%20note%20that%20SW32K3_TCPIP_STACK_4.0.0_D2512%20supports%20the%20GMAC%20HLD%20driver%20(Eth_43_GMAC)%2C%20which%20is%20based%20on%20the%20MCAL%20Ethernet%20stack.%20The%20MCSPTR2AK396%20example%2C%20however%2C%20is%20based%20on%20the%20IP%20driver%20layer.%3C%2FP%3E%0A%3CP%3EBecause%20of%20this%20architectural%20mismatch%2C%20integrating%20the%20TCP%2FIP%20stack%20into%20the%20existing%20MCSPTR2AK396%20project%20is%20not%20a%20straightforward%20task.%20The%20TCP%2FIP%20stack%20does%20not%20interface%20directly%20with%20the%20IP-layer%20GMAC%20drivers.%3C%2FP%3E%0A%3CP%3EThe%20approach%20you%20tried%20could%20be%20feasible%2C%20using%20a%20mixed%20architecture%20where%20the%20motor-control%20peripherals%20remain%20on%20the%20IP%20driver%20layer%20while%20Ethernet%20uses%20the%20MCAL%2FHLD%20stack%20required%20by%20the%20TCP%2FIP%20solution.%20However%2C%20the%20feasibility%20of%20this%20approach%20must%20be%20evaluated%20on%20a%20case-by-case%20basis%2C%20depending%20on%20the%20specific%20drivers%20and%20overall%20software%20architecture%20used.%3C%2FP%3E%0A%3CP%3EI%20am%20not%20aware%20of%20a%20ready-made%20demo%20combining%20both%20motor%20control%20and%20Ethernet%20on%20the%20S32K396.%3C%2FP%3E%0A%3CP%3EHowever%2C%20HLD-based%20motor-control%20demos%20are%20available%20for%20other%20S32K3%20derivatives%2C%20such%20as%20the%20S32K344%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K3-Motor-control-SW-examples%2Fta-p%2F1804577%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FS32K-Knowledge-Base%2FS32K3-Motor-control-SW-examples%2Fta-p%2F1804577%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EThese%20examples%20may%20provide%20useful%20guidance%20if%20you%20decide%20to%20move%20toward%20an%20HLD%2FMCAL-based%20architecture.%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E