S32K344 lwip with DCache enabled

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

S32K344 lwip with DCache enabled

Jump to solution
329 Views
ola_gook
Contributor III

(Using DS 3.5, latest RTD and latest lwip)

I have a working lwip project running and now need to also enable data cache with compiler flag D_CACHE_ENABLE.

However, as soon as I enable it, the lwip functionality is lost. The UM and IM for Gmac seem to state that it should be possible but I cannot understand exactly how. Gmac_Ip_Cfg data is placed in non cachable RAM and still it does not work. I disabled the flag -fdata-sections to make Cfg data end up in non cachable RAM (0x2043xxxx).
 
Is there example code for how to make lwip work together with dcache?
 
Regards
/Ola
0 Kudos
1 Solution
257 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ola_gook 

You can take a look at this post:

https://community.nxp.com/t5/S32K/S32K344-S32K324-TCPIP-STACK-Intergration/m-p/1527082/highlight/tru...

There's step by step guide including demo application which contains these changes.

Regards,

Lukas

View solution in original post

0 Kudos
3 Replies
314 Views
ola_gook
Contributor III

I managed to get one step closer to the solution.

I found another similar issue where the proposed solution was to make sure the lwip heap is placed in non_cachable ram. Unfortunately, the detailed solution using S32DS was not possible to see due to bad resolution in attached image.

Instead, I did this temporarily by simply appending in mem.c:

LWIP_DECLARE_MEMORY_ALIGNED(ram_heap, MEM_SIZE_ALIGNED + (2U * SIZEOF_STRUCT_MEM))__attribute__((section(".mcal_bss_no_cacheable")));

 

I also made sure that the Gmac_Ip_Cfg.o elements are placed in non_cachable RAM by building without -fdata-sections

Current result is that pinging it (or connecting to port 80 with a browser, same result) works about 60% of the time. 

Thus, I get the feeling that there is some more data that needs to put in non_cachable RAM.

Any suggestions?

Regards

57 Views
yosri_c
Contributor II

hi Ola ,

i'm just wondering where exactly did you append that one ?

i'm stuck with the same issue and couldn't find the exact fix for it

 

thank you

0 Kudos
258 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @ola_gook 

You can take a look at this post:

https://community.nxp.com/t5/S32K/S32K344-S32K324-TCPIP-STACK-Intergration/m-p/1527082/highlight/tru...

There's step by step guide including demo application which contains these changes.

Regards,

Lukas

0 Kudos