Wiz830mj and UDP

I have problems with UDP: when I send packet from PC wiz830 reads packet info correctly, but data is wrong. S0_RX_RSR value equals to whole packet size before I read the packet and it equals to 0 after reading data, that’s write. I’ve checked read address, it’s correct (0x0230). Also PC doesn’t get any UDP packet from wiz830! I had similar problem with wiz820io (PC couldn’t get any UDP packet from wiz820io, but wiz820io got packets from PC and data were correct).
As for TCP it works OK in Server and Client modes in both directions .Overall channel speed I got with Altera Nios 2 proc + DMA controllers is 99Mbits/s (according to Windows Task Manager network monitor). Connection is stable, module is able to transmit and receive data for at least 10 min. I’ve set aside the problem I described in another thread (“wiz830mj stops working after some time”) and now I’m going to realize UDP.
I would be gratefull if someone gave me some advice.

P.S. I checked data bus and see that wrong data values are present on it during data copying from S0_RX_FIFOR to processor memory, so either PC sends this wrong values to wiz830MJ or wiz830MJ gives wrong values on processor’s demand.


Your problem is very difficult situation to analyze.
We will solve this together step by step.

I wonder what is the packet size and how many packets?
Is some part or entire of the received data wrong?

PS> You can check with Wireshark capture program - whether PC or WIZ830MJ is wrong.

I use short packets with different lengths (1-40 bytes). When I use port 5000 wireshark forms a message “Malformed packet, Exception occured” and recognized protocol as YAMI, not UDP. I’ve tried port 5001 and wireshark didn’t find any problems and recognized protocol as UDP, but in both cases wiz830 gives me wrong data (all values are wrong). In wireshark data block of the packet is completely the same as I transmit from PC.
When I send one packet from PC it’s processed more or less correctly (except wrong data block), but after the second packet everything is wrong: source IP, port number, packet size, so I have to restart host processor’s programme.
I analyzed TCP packets with wireshark and found out that port 5000 is recognized as a port for “GSM over IP” and error message is given out, but data is transmitted correctly anyway.

It seems that Wrong data problem is due to WIZ830-side. And Don’t care to display other protocol on wireshark.
(To slove that, Select only both UDP & TCP protocol on [Analyze][Enable protocol] of Wireshark menu.)

By the way, I don’t understand this situation that the data is correct on TCP but, wrong on UDP.
The entire data was wrong, am I right?
If the entire data is wrong, I will wonder the configuration of each socket memory.
If a part of data is wrong, I will wonder the driver code or access timing.

First, let me know how to configure W5300 as TMSR(0~7), RMSR(0~7) and MTYPER.

mtyper=0x00ff; tmsr0=0x08; rmsr0=0x08. I work with 16 bits bus, so I used following commands :
IOWR(W5300,0x0020,0x0800) and IOWR(W5300,0x0028,0x0800). In case of TCP this works normally and data is always transmitted and received correctly. I tried 0x0808 values for tmsr01 and rmsr01 and UDP receiving process went on NORMALLY (data was correct). What do I do wrong? Anyway, thank you very much for the progress I’ve made.

I recommend that all socket TX/RX memory should be configured, even if it is zero.
For more detail, Refer to MTYPER, TMSxR and RMSxR in datasheet.