CODECOMPOSER: TMS570LC4357 with EMAC

Part Number: CODECOMPOSER

Hi ! 

I use my TMS570 as HTTP server. 

I have no difficult to run this server when I turn on the microcontroler. 

But when I unplug and plugin again the Ethernet the server cannot be run again and I get stuck into a while loop in function : hdkif_rx_inthandler

while(hdkif_swizzle_data(curr_bd->flags_pktlen) & EMAC_BUF_DESC_SOP)
with 
curr_bd: 0x00000000
next: 0xEA00DE24
bufptr: 3942645758
bufoff_len: 3942645758
flags_pktlen: 3942645758
pbuf: 0xEAFFFFFE
 
I have to turn off/on to have acces to the server.
I think there is garbage data when I plug the Ethernet but why the code cannot get over this ?
 
Here is the content when the server run normally :
curr_bd: 0xFC521004
next: 0x181052FC
bufptr: 3435201032
bufoff_len: 1375731712
flags_pktlen: 1375731904
pbuf: 0x0802C1BC 
 

And when it get stuck

curr_bd: 0x00000000

next: 0xEA00DE27
bufptr: 3942645758
bufoff_len: 3942645758
flags_pktlen: 3942645758
pbuf: 0xEAFFFFFE
 
In my main I test if the connection is cut : 
flag_Phy = 0
 
And then reset the server. But even with that I cannot return to a normal execution.
Have you any idea please ?
 
 
image.png
 
 
When the Ethernet is plug in this run and get stuck image.png