W5300 UDP init problem
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W5300 UDP init problem
by irina WIZnet ·
Hi~
What is the BIT16EN pin set to?
and could you please tell me the used interface?(For example, use the indirect bus)
What do you show when you read the S0_TTLR?
If you don’t write S0_TTLR, you can read 0x80.
thanks,
best regards,
irina
RE: RE: W5300 UDP init problem
by Addi ·
Dear Irina!
Thank you for your replay and support!
I used direct bus and set BIT16EN pin to HIGH level
Also I read 0x80 from S0_MR
Now I have problems with initialization of UDP mode
But I can ping the device
I do the following:
After that I just read S0_SSR (adress 0x208) on cycle and check its value on 0x0022
CS High level time is 210 ns during write and cyclic read
But INT value always on High level
And S0_SSR always 0x0001 - ARP
I checked that after writing to S0_CR, S0_CR cleared
Please help
RE: RE: W5300 UDP init problem
by Addi ·
Dear Irina!
Thanks for your support!
I use direct bus and BIT16EN =1, also i can write to S0_TTLR, and can read what ive wtitten to.
And I write to S0_TTLR before open command
But the situation is still the same (…, free size reg shows not free
RE: RE: W5300 UDP init problem
by Addi ·
Dear Irina!
Declaring my proble more fully!
Im doing the folowing:
nRESET pin hold in low 10
After nRESET release(going to HIGH) wait 10 ms
Write to MR (address 0x000) = 0x0000 ;
Write to IMR (address 0x004) = 0x70FF ;
Write to SHAR (address 0x008) = 0x0008 ;
Write to SHAR2 (address 0x00A) = 0xDC01 ;
Write to SHAR4 (address 0x00C) = 0x0203 ;
Write to GAR (address 0x010) = 0xA9FE ;
Write to GAR2 (address 0x012) = 0x0001 ;
Write to SUBR (address 0x014) = 0xFFFF ;
Write to SUBR2 (address 0x016) = 0x0000 ;
Write to SIPR (address 0x018) = 0xA9FE ;
Write to SIPR2 (address 0x01A) = 0x0003 ;
Write to RTR (address 0x01C) = 0x0FA0 ;
Write to RCR (address 0x01E) = 0x0007 ;
Write to MTYPER (address 0x030) = 0x01FF ;
Write to TMS01R (address 0x020) = 0x4000 ;
Write to TMS23R (address 0x022) = 0x0000 ;
Write to TMS45R (address 0x024) = 0x0000 ;
Write to TMS67R (address 0x026) = 0x0000 ;
Write to RMS01R (address 0x028) = 0x0800 ;
Write to RMS23R (address 0x02A) = 0x0000 ;
Write to RMS45R (address 0x02C) = 0x0000 ;
Write to RMS67R (address 0x02E) = 0x0000 ;
Write to S0_IMR (address 0x204) = 0x001C ;
Write to S0_DIP (address 0x214) = 0xA9FE ;
Write to S0_DIP2 (address 0x216) = 0xD955 ;
Write to S0_DPORTR(address 0x212) = 0x1388 ;
Write to S0_MR (address 0x200) = 0x0002 ;
Write to S0_PORTR (address 0x20A) = 0x1388 ;
Write to S0_TTLR (address 0x21E) = 0x0080 ;
Read S0_TTLR (address 0x21E) = 0x0080;
Write to S0_CR (address 0x202) = 0x0001 ;
Read S0_TX_FSR2 (address 0x226) and check on value more than 192 bytes
If true
Write to FIFO 96 words and after that write to WRSR registes 192
and after that write SEND command
else
Read S0_TX_FSR2 (address 0x226) and check on value more than 192 bytes again until true will reached
RE: W5300 UDP init problem
by irina WIZnet ·
Hi~
You must be set ‘1’ as bit 0, so you can see interrupt of the SOCKET 0.
This value is the operation status of TCP.
You said, you want to use the UDP mode ,is it right?
If right, you have to set the RECV/TIMEOUT/SENDOK
It is the status that ARP-request is transmitted in order to acquire destination hardware address.
This status is observed when SEND command is performed at the SOCK_UDP.
If hardware address is successfully acquired from destination(when ARP-response is received), it is changed to SOCK_UDP. If It’s failed and ARP timeout occurs(Sn_IR(TIMEOUT)= ‘1’), in case of UDP mode it goes back to previous status(SOCK_UDP)
You can see the network packet using the wireshark program.
If you use this program, you can confirm the status.
(For example, failed ARP-response…)
thank
best regards,
irina
RE: W5300 UDP init problem
by Addi ·
Dear Irina!
Thanks a lot for your support
I have done all as you mentioned
And now I have got the following configuration to W5300
My PC Ethernet adapter IPv4 address is 169.254.217.85 and Mask is 255.255.0.0
My PC Ethernet adapter VirtualBox IPv4 address is 169.254.48.96
I set up on W5300 configuration IP address 169.254.0.3 and for gate 169.254.0.1 and for mask 255.255.0.0
I attached Wireshark log
wiresharklog.pdf (395 KB)
RE: W5300 UDP init problem
by Addi ·
Unfortunally, the situation is still the same
RE: W5300 UDP init problem
by irina WIZnet ·
Hi~
Could you please try to test the next operation?
Write to S0_CR(address 0x202) == 0x0001(Socket open operation as UDP) → S0_SSR: SOCK_UDP
Read to S0_CR(address 0x202) → 0x0000
Write to S0_CR(address 0x202) == 0x0020(Send operation)
→ You can see the ARP request via wireshark program. And when completing the SEND process, S0_IR (SENDOK) becomes ‘1’.
After checking S0_IR(SENDOK) = ‘1’, the host can give SEND command to the next data.
thanks
best regards,
irina
RE: W5300 UDP init problem
by Addi ·
Dear Irina!
Thanks a lot!
Now some is good)
I send data and received SEND_OK!)
But I dont understand why its working without SOCK_UDP establishing(without Socket initializtion of UDP )
Can you explain?, please
And can I continue without Socket initializtion of UDP further?
Sending Wireshark log
wiresharklog2.pdf (885 KB)
RE: W5300 UDP init problem
by Addi ·
Sending current init + send flow
Also Attaching Wireshark UDP printscreen
RE: W5300 UDP init problem
by irina WIZnet ·
Hi addi
I saw the attached figure. W5300(169.254.217.3) send the UDP packet to 169.254.217.85, is it right?

I thank it operates as well.
UDP is different from TCP.
It initializes SOCKET 0 and Opens according to protocol type set in S0_MR(P3:P0)
when it sets S0_CR as OPEN command , S0_SSR according to S0_MR(P3:P0)
Therefore if you operate the UDP, SOCK_INIT of S0_SSR isn’t exist .
thank,
best regards,
irina
RE: W5300 UDP init problem
by Addi ·
Yet another problem(
But the previous was done successfully , thanks to Irina
Now Ive noticed that I can not send more then one byte
The flow the same, except I send sequentually Word by Word to Tx_Fifo the data(92 Words).
Wireshark shows that UDP sending is absent, but when I store one Word to Fifo, It shows UDP sending with one sent Word and another more, wich I havent send
Please, help
Thanks in advance
RE: W5300 UDP init problem
by irina WIZnet ·
Hi~ Addi
Sorry, for the late reply to your question.
You need to confirm the sending size or the socket buffer size when Socket init operate.
thanks,
BR
irina