Stuck in "sendto"
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: Stuck in "sendto"
by Coccoliso ·
Hi,
from what you say packet transmission is made but the DHCP server then does not recognize the content.
What MPU uses? Maybe a 16 or 32 bit CPU?
If this is the case then DHCP packet sended is malformed ([url]Problems while compiling dhcp.c file]).
Some 16/32 bits compilers warn when they are operating an optimization (on structures) while others ignore it, but the structure is no longer serialized in right mode and bytes are not placed as they should be.
RE: Stuck in "sendto"
by Wizneter ·
Hi Coccoliso
Thank you very much for taking the time to look over and reply. Im sorry to say that tried to include everything but forgot to mention that the server does give out a lease, again sorry. I’m using a 32bit Microchip CPU, with there default compliers, C32.
I’m practically certain the issue is related to the interrupt flags. It seems to never see the end of the packet going out. That why it gets stuck in the loop in “sendto”. Therefore I don’t think it even looks for a response, its still waiting for the packet to leave the device.
Though from looking through your link, it may well be the same symptom as the other issue. Perhaps the INT flags aren’t set correctly due to this. Though I can’t see were in the code the IMR registers are even called (I think they need to be set/cleared?)
Another question would be do you have a working DHCP project on a 32 bit processor?
Kind regards
Wizneter
RE: Stuck in "sendto"
by Coccoliso ·
Hi,
one thing that comes in mind is the correct setting of the SPI.
With PIC to obtain a correct reading I had to set the SPI in this way: clock idle low, rising edge and sample on end.
With routines that uses can correctly read a register ( ex product id) or not?
For what it regards as a 32-bit C DHCP I can not help you.
I ported the wiznet routines (driver / DHCP / DNS and PING) in firewing basic for PIC18 (8-bit) and PIC24 (16-bit) devices so sources are written in basic. The firewing compiler use the microchip C compiler to get the HEX file and so the structures are optimized with PIC24 and PIC32 devices.
You can not send the structure “as is” but you have to decompose it in bytes before sending … the problems that I have mentioned in previous post.
I do not know if can help you but basic sources are here [url]http://www.firewing.info/pmwiki.php?n=FirewingUser.W5500[/url].
RE: Stuck in "sendto"
by Wizneter ·
Hi Coccoliso
Thank you I’ve got it going.
Once I fixed up the structures the “sendto” function didn’t lockup and DHCP started to wiork.
Thanks for all your help.
Kind regards
Wizneter