Stands to argue the EMAC0 DMA would never have direct access to bit band SRAM memory region defined in the memory range macro below. Memory map table shows Logical bit bad region 0x2000.0000 - 0x2006.FFFF}.
Why should we need a blocking macro if the DMA only has access to physical address for storing descriptors and FIFO data?
Same goes for (pbuf_alloc()), would not the object link to what ever the defined .data space is defined in LWIP as the Heap?
Does not (lwipopts.h) specify physical SRAM range for allocating (Pbufs) called (MEM_LIBC_MALLOC==0) or the Heap?
Text below states DMA data buffers exist in physical SRAM address space {0x0000.0000 - 0x0003.FFFF} or 262,143KB total SRAM boundary?
Macro at bottom of post blocks and tests {if NOT logical bit band } memory space Ok to allocate (Pbufs) in physical memory space?
Why does the DMA need to be constrained to physical memory?
>> Might that test ever have the reverse effect then physical data can cross into the applications bit band .data space?
/* Does this pbuf's payload reside in memory that the Ethernet DMA
* can access?
*/
if(!PTR_SAFE_FOR_EMAC_DMA(pBuf->payload))
{
/* This buffer is outside the DMA-able memory space so we need
* to copy the pbuf.
*/
pBuf = pbuf_alloc(PBUF_TRANSPORT, p->tot_len, PBUF_RAM);
Data sheet:
The descriptor lists reside in the SRAM memory address space. Each descriptor can point to a maximum of two buffers. This enables two buffers to be used at different physical addresses rather than contiguous buffers in memory. The data buffer also resides in the physical memory space and consists of an entire frame or part of a frame, but cannot exceed a single frame. Note: The EMAC DMA Controller only has access to internal system SRAM memory.
/**
* A macro which determines whether a pointer is within the SRAM address
* space and, hence, points to a buffer that the Ethernet MAC can directly
* DMA from.
*/
#define PTR_SAFE_FOR_EMAC_DMA(ptr) (((uint32_t)(ptr) >= 0x2000000) && \
((uint32_t)(ptr) < 0x20070000))

