I have come across 3 bug today in code from ioLibrary_v100 that
has issues when ported to 16bit.
Function “wiz_send_data”, in W5500.c:
uint16_t ptr = 0; needs changed to a uint32.
If not the upper 8 bits gets truncated during
addrsel = (ptr << 8) + (WIZCHIP_TXBUF_BLOCK(sn) << 3);
This causes garbage to be sent out during a send data.
Also changed it in wiz_recv_data, although it was working.
Function “inet_ntoa” and “inet_ntoa”_pad, in sockutil.c:
sprintf((char*)addr_str,"%d.%d.%d.%d",(int32_t)(addr>>24 & 0xFF),(int32_t)(addr>>16 & 0xFF),(int32_t)(addr>>8 & 0xFF),(int32_t)(addr & 0xFF))
int32’s needs changed to int16’s.
It may be compiler dependent, but for me I had to change it to int16’s or I was getting
extra characters out of the sprintf function.
Function “loopback_tcps”, in loopback.c:
ret is defined as int32, but in this line:
SendLen = TCPSend(sock, data_buf, ret)
function TCPSend is expecting the length to be uint32.
Had to add a type cast like this:
SendLen = TCPSend(sock, data_buf, (Uint32)ret)
with out the type cast garbage was passed to TCPSend.
Maybe this will help someone, and maybe for future updates.