2020-01-31 05:05 AM
Hi,
Is there any issue if in STM32H743ZI, ethernet driver I call:
….
SCB_CleanDCache();
SCB_DisableDCache();
HAL_ETH_Transmit(&EthHandle, &TxConfig, ETH_DMA_TRANSMIT_TIMEOUT);
SCB_EnableDCache();
...
so far, it works perfectly until now instead of only SCB_CleanDCache();
Many thanks
Solved! Go to Solution.
2020-01-31 05:11 AM
It should be unnecessary.
Consider using the By Addr version so you just flush the buffer, not cripple the MCU entirely.
2020-01-31 05:11 AM
It should be unnecessary.
Consider using the By Addr version so you just flush the buffer, not cripple the MCU entirely.
2020-01-31 05:29 AM
Or you can permanently disable caching just for the memory region where the dma buffers are located
https://community.st.com/s/question/0D70X000007Q6AwSAK/stm32f7-using-spi-slave-with-dma-to-set-a-flag-ie-no-interrupts (scroll down to the last answer)
2020-02-01 05:11 AM
Look for my (not the selected one) answer and discussion with Pavel:
And generally study this:
2020-02-01 11:23 AM
@ Piranha: I already did what you suggested, added "By_Addr" in the loop. The thing is I got ethernet working, but Ping is roughly, and 50% is timeout.
My solution is, before transmit I add SCB_DisableDCache();
After transmitted, we enable SCB_EnableDCache();
Everything work smooth and fast. Ping is 100% response and <1ms all the time, which is very good.
SCB_DisableDCache();
HAL_ETH_Transmit(&EthHandle, &TxConfig, ETH_DMA_TRANSMIT_TIMEOUT);
SCB_EnableDCache();
Not sure if that way is safe or not.
2020-02-01 12:42 PM
Disabling cache implies cleaning and invalidating all of it. The effect of that is described in my comment in that other topic.
With "by_Addr" functions the code runs faster and therefore other flaws are more likely to show off. As can be read in a link related to "lwIP driver Rx buffers released while still in use" flaw, unfortunately in ST's implementation for H7 the Rx part of code is so broken, that it can't work at all.
Read my post with a phrase "false premise" and look for Harrold's workaround here:
https://community.st.com/s/question/0D50X0000BozSc5SQE/ethernet-security-issues