How MAC, FIFO and DMA descriptor is dealing with received frames from and UDP client using HAL libraries?
I have read the datasheet where this part of ethernet is explained. But I have not clear of all taking it to a practical case.
Case:
- Client is sending constantly requests to the stm32f207 HAL based with Lwip stack and no RTOS udp server.
- Client requests has between 2 and 20 bytes of data payload.
- Every request payload is put in a frame. Every frame has its overload bytes due to MAC, ip and udp headers.
I'm wondering what happens with those frames when they achieve MAC controller and the follwing blocks: FIFO and DMA, since FIFO has 2Kbytes, and MAC sends the frame to the DMA by a frame descriptor (struct type). But FIFO are in the middle of these two blocks and I don't know what FIFO does with the DMA descriptor.
So please, let me know if something that I'm go to say is wrong:
- As the payload are very short I guess that received frame will be treated being not truncated.
- It is only one ethernet dma descriptor object for allocating received data from remote hosts. (not an array of descriptors)
- From MAC reception MAC controller puts the whole frame into the descriptor frame register.
- After this, if FIFO is empty I guess the descriptor is passing directly to the DMA and DMA is passing inmediatly to the memory system
- If FIFO is not empty I don't know how descriptor works in this case.
My questions:
- Every received frame from remote host (client) will be put inmediatly into the dma descriptor by de MAC controller or could MAC controller be waiting for more than one frame and put more than one into the descriptor until get descriptor register full?
- If yes, is it a limit of number of frames or number of total bytes that can be inside of a DMA ethernet descriptor?
- What is done by the FIFO with this descriptor? For me has more sense that MAC controller is passing the frames to the FIFO and when DMA ends of sending the frames to the memory system the FIFO is giving its bytes to the DMA.
- In the case of not empty FIFO frames are allocated inside it, but FIFO block can't be dma descriptor own, so how does FIFO for writing frames on this descriptor? Who is the descriptor owner? Is it DMA owned, is it MAC owned, who writes FIFO frames into descriptor if FIFO has never got the de descriptor own...
thanks in advance
