Can't Go From Dynamic IP to Static IP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't Go From Dynamic IP to Static IP

Jump to solution
977 Views
kackle123
Contributor IV

I have a question very similar to this unanswered question:

https://community.nxp.com/thread/315763

I am using MQX 4.2.0.1 on a K64.  Using an embedded web page, I tell the K64 to go from its static IP address, to a dynamic, and then back to a static.  The program uses the ipcfg functions, but won't go from a dynamic address back to a static address.  The ipcfg_unbind() constantly returns 7425 (1D01 hex), even if I call it repeatedly.  When debugging deeper, there seems to be some semaphore problem within ipcfg.c.  Is this something someone can recreate on their end? 

0 Kudos
Reply
1 Solution
707 Views
kackle123
Contributor IV

I put ipcfg_bind_dhcp_wait() in a separate task to avoid code delays; and it worked. 

I'm note sure why the ipcfg_unbind() constantly returns 7425 (1D01 hex) in my above code, but I'm under a project deadline so I have to move on.  Thank you for your replies.

View solution in original post

0 Kudos
Reply
5 Replies
708 Views
kackle123
Contributor IV

I put ipcfg_bind_dhcp_wait() in a separate task to avoid code delays; and it worked. 

I'm note sure why the ipcfg_unbind() constantly returns 7425 (1D01 hex) in my above code, but I'm under a project deadline so I have to move on.  Thank you for your replies.

0 Kudos
Reply
707 Views
kackle123
Contributor IV

I tried the MQX shell example project.  It worked.  I noticed it uses ipcfg_bind_dhcp_wait().  My code was trying to use ipcfg_bind_dhcp() instead; can you confirm that ipcfg_bind_dhcp() works when using ipcfg_bind_staticip() later?  (Code snippet attached.)

0 Kudos
Reply
707 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

ipcfg_bind_dhcp :  Binds Ethernet device to networking using DHCP protocol.

ipcfg_bind_dhcp_wait :  Bind Ethernet device to network using a DHCP protocol, blocking mode.   This function will not return until the process is finished or error occures.

As the DHCP address resolving make take some time. I suggest you using  ipcfg_bind_dhcp_wait().

Regards

Daniel



-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
707 Views
kackle123
Contributor IV

Thank you; I will try it and post my results here.

0 Kudos
Reply
707 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi

I did a quick test with shell commands, with demo

C:\Freescale\Freescale_MQX_4_2\rtcs\examples\shell\build\iar\rtcs_shell_frdmk64f

My test result is it can go from dynamic ip to static ip in my side.

Could you please double check it? Please see the below picutre

pastedImage_1.png

Regards

Daniel

0 Kudos
Reply