When I have initialised my W5100 and start writing to the socket 0 memory space, the write pointer (offset from base address, named S0_TX_WR in the data sheet) starts at some random number rather than at zero. This makes the first packet I send smaller than I intend it to be as the offset reaches my TCP_PACKET_SIZE maximum before being incremented TCP_PACKET_SIZE times.
I know I could do subtraction of that initial value in my own code to compensate for this problem but I would like to keep the execution time as low as I possibly can, and would therefore want to avoid that. It is also nice to know that the system will behave in the exact same way each time it is switched on.
Why does S0_TX_WR start at a value other than 0? And how can I make the S0_TX_WR offset start at exactly 0 without messing up the way W5100 accesses the TX buffer?