Hello everyone,
Sorry for late response. Here is the feedback from our team:
The current lwip stack based on RTD 2.0.0 is only tested with K344 not K324, thus, some changes must be implemented when porting the K344 lwip demo on to K324:
1. The linker files of 2 projects CM7_0 and CM7_1 should be kindly tweaked to ensure there is no overlap between two cores. In this case, you can use new empty K324 project CM7_0 linker file and startup code to replace it. Besides, you need to cut down the freeRTOS heap size / lwip stack heap size to reduce the ram cost, or increase you CM7_0 linker file memory region (and decrease CM7_1 linker file memory region), and ensure your compile result would not overlap.
2. Tweaks for compile errors after step 1. In the "OsIf_rtd_port.c", the SCB relative configurations should be changed for K324, not K344. Please note, you need to change these settings every time you re-generate code from .mex file, due to they would be refreshed correspondingly.



3. The default project setting enabled Cache, and the lwip heap memory was allocated from cacheable region. Thus there are risks about data inconsistency when CPU and EMAC uDMA access asynchronously. Two way to avoid this issue:
① Just disable the D-cache, the original Lwip_s32k344 demo use the same way. It's convenient, but lower running efficiency for other applications.
② Allocate the lwip heap from non-cacheable region. Thus the cache can keep enable, it's good. When use this way, you need to make below changes:
a) Increase the non-cacheable region (decrease shareable region) in linker file and add the lwip non-cacheable heap region for next use.


b) Add lwip memory allocation macro in .mex tcpip component "user setting" page, thus it would be generated in lwipcfg.h, and to replace the default allocation way in "arch.h" which allocate memory from shareable region.

Please find attachment for the demo. Let me know if it works.
Best Regards,
Nam