Ethernet problems after software reset

Hi,

I have 1 “arduino due” and ethernet shield 2 connected.

My software reset is caused by code:

#define SYSRESETREQ    (1<<2)
#define VECTKEY        (0x05fa0000UL)
#define VECTKEY_MASK   (0x0000ffffUL)
#define AIRCR          (*(uint32_t*)0xe000ed0cUL) // fixed arch-defined address
#define REQUEST_EXTERNAL_RESET (AIRCR=(AIRCR&VECTKEY_MASK)|VECTKEY|SYSRESETREQ);

if(xpto){
REQUEST_EXTERNAL_RESET  //<<reset.. 
}

This code works fine, arduino restart but shield keep the lights on.

After run my code … I have ethernet connection (computer ping ok) but my udp connection not work.

  if (!Udp.beginPacket(ntpServer, 123)) Serial.println(F("beginPacket error")); >> OK
  if (!Udp.write(packetBuffer, NTP_PACKET_SIZE)) Serial.println(F("write error"));    >> OK
  if (!Udp.endPacket()) Serial.println(F("endPacket error"));                                    >> OK
      
  //Wait to see if a reply is available
  delay(500);  //Adjust this delay for time server (effects accuracy, use shortest delay possible)

  if (Udp.parsePacket())
  {
}

Udp.parsePacket() return 0… why ??

It’s possible to restart shield like when i press serial monitor button ??

Problem solved...

add "Udp.Stop()" after last Udp.beginPacket() loop..