cancel
Showing results for 
Search instead for 
Did you mean: 

DMA ethernet descriptor OWN bit issue

genisuvi
Associate III

Im using stm32f207 HAL library, LwIP stack with RAW api, no RTOS for an UDP server implementation.

Server is receiving frames by polling way because of client nature demands. Client is constantly asking server for reading mcu inputs and asking for writing mcu outputs. Data payload per request from client to the server and data payload per answer from the server to the client are less than 20 bytes. Minimum one could be 2 bytes.

According some statistics his communication reaches 900Kb/sec but Ethernet is configured for 100Mb/sec. It seems to be a great margin and not seems to be too much stressed. Digital IO reads/writes probably are the most speedy hw operations in therms of CPU processing.

  1. Server could be working and attending 1, 2, 3 even 4 python clients during 12 hours even bit more and sometimes only for 1 hour.
  2. Suddenly client stops receiving answers from server.
  3. using breakpoints we can see that server has no more reception requests
  4. HAL_ETH_GetReceivedFrame (&heth) call is not returning HAL_OK so I go inside this function and I see:
    1. after heth --> state = busy
    2. heth->RxDesc->Status == 1
    3. where this means that descriptor status register has OWN bit = 1 and DMA is not passing the descriptor to the MAC controller in order to put received frame from RMII line towards DMA block.
  5. After this observation we check for error flags on this statuts register and we don't see any error.
  6. After this another observation, we enabled irq and we added the irq handler to our code with the hope of detecting ethernet error interruptions, but execution thread sitlls not jumping there. So no error is detected when DMA is rapturing the Ethernet fram descriptor.

The questions now are:

  • what kind of situation is making that DMA is not freeing this descriptor and passing it to the MAC controller if no error is detected?

  • Despite of the rest ot the mcu functionalities are working and the application is running, the only way for recovering the network from this situation is manually reseting the application. We have no error detection for forcing an only ethernet reseting or re-init. Even I'm not sure that deinit and init works.

0 REPLIES 0