W5100 Shield :: Increasing RX Buffer size

Hi, having a few problems with trying to receive alot of UDP messages via W5100 & Mega2560

I have set my PC application to send out 4 530 byte UDP messages all at once (I am not in control of the block burst) and it does this 25 times a second

I have increased the SPI speed to nearer 14MHz limit in W5100.h -> #define SPI_ETHERNET_SETTINGS SPISettings(14000000, MSBFIRST, SPI_MODE0)

But I am only getting 3 out of 4 of the messages, and I am pretty sure that the last one is getting dumped because I have exceeded the 2K (default) RX buffer for the socket

So, I would like to increase the RX buffer size, I am not bothered that I will have less sockets, the default is 4 and I am happy with just 2, as long as I can change the RX buffer from 2K to 4K

I have done some googling, and just left with confusion, and have also had a bit of a crack at tweaking some numbers here and there in W5100.h

#define MAX_SOCK_NUM  4

and

  static const int SOCKETS = 4;
  static const uint16_t SMASK = 0x07FF; // Tx buffer MASK 
  static const uint16_t RMASK = 0x07FF; // Rx buffer MASK 
  static const uint16_t SSIZE = 2048; // Max Tx buffer size 
  static const uint16_t RSIZE = 2048; // Max Rx buffer size

for example, changing the SOCKETS to 2 and the SMASK/RMASK to 0x0FFF and SSIZE/RSIZE to 4096 had no effect but crash the ethernet shield, so I kind of stopped there

I would like to continue with this route, without having to jump to a different shield or processor board

Any help here would be appreciated

Thanks

Last I checked, the UDP packets are sent separately. You must read the packet before the w5100 will accept the next packet. Are you sending the packets from another device on the same localnet?

SurferTim: Last I checked, the UDP packets are sent separately. You must read the packet before the w5100 will accept the next packet. Are you sending the packets from another device on the same localnet?

Yes, and it appears that for 3 of the Packets, they are received correctly, just the fourth All packets will come from the same source