Issue with MPU setup in LwIP_HTTP_Server_Netconn_RTOS for F7 V1.17.0
In LwIP_HTTP_Server_Netconn_RTOS, MPU_Config has three sections:
1) Mark the complete 4GB memory map as shareable, non-cacheable, and non-bufferable.
2) Create a 16kB area starting at 0x20078000 for ethernet buffers, non-sharable, non-cacheable, non-bufferable
3) Create a 1kB area starting at 0x2007C000 for ethernet descriptors, shareable, non-cacheable, bufferable
First, is #1 actually needed?
Second, #2 says that it is in SRAM2, but it is actually in SRAM1. SRAM2 doesn't start until 0x2007C000. The size makes me think that it should be marking all of SRAM2, but the base address is wrong. Having the region start at 0x20078000 for 16k will mark the top 4k of SRAM1 and the bottom 12k of SRAM2. An odd choice or a bug?
#3 could actually be correct, but wastes a lot of memory for 2*0xA0 == 320 bytes of space.
Finally, the symbol __estack is created in the linker file that points at 0x20080000, the top of SRAM2. But under this address is the ethernet buffers in SRAM2. This would cause some weird stack corruption as the ethernet DMAs stuff into the stack area. I think __estack should be set to 0x2007C000 which would be the top of SRAM1, under the ethernet buffers.
So, what are the implied rules in place for ethernet? It apparently needs a non-cacheable region for ethernet descriptors. There seems to be a need for ethernet buffers, but no support in the code that I can find. And why would the whole 4GB memory map be non-cacheable and non-bufferable? Is this the default?
Waiting for the next firmware release for F7,
Andrei
