cancel
Showing results for 
Search instead for 
Did you mean: 

LWIP Using ICache on STM32H723

wh
Associate III

Dear all,

I'm running the LWIP on a STM32H723 processor and need to enable the ICache and DCache within CubeMX. I'm also using DHCP which will only work when both caches are enabled. When I disable the ICache DHCP will timeout? 

UDP stop working after a number of packets without any notification of the reason. This occurs when the ICache is enabled, this is the default configuration.  

I managed to get bot ICMP and UDP (TCP) working  by using the default CubeMX configuration and disable the ICache when DHCP has given an IP address. From then on I can transmit UDP packages without any problem. 

Is there anyone who can explain what is going on?  Why does the LWIP stack need the cache in the first place? Does the Ethernet HAL library use the Cache? 

Enabling and disabling the ICache depending on the position in the software process really feels like  a hack. I would like to understand what the reason is and how to solve it properly. 

Thanks in advance,

Wim 

 

 

 

3 REPLIES 3
ASEHST
ST Employee

Hello @wh,

Caching significantly improves lwIP stack efficiency by reducing the time needed for data access. Turning off the icache can cause latency since the processor has to obtain instructions from the main memory, which is slower compared to the speed of accessing the cached instructions.

Regarding your cache issue, please verify the MPU configuration against the picture below:

 

95.png

 

Thanks

Aya

If your question is answered, please close this topic by clicking "Accept as Solution".
Pavel A.
Evangelist III

@wh Indeed it is a hack. Unfortunately there are too many issues in the ETH library. "Hack" is the best description for it.

 

wh
Associate III

Thanks all,

After some serious debugging I finally got it working. Took me days! It would be nice if the latest STM32CubeMX version would generate proper code for the LWIP to HAL interface. Should not be to difficult for ST employees having all the inside information. 

 

Regards,

Wim