Can't Go From Dynamic IP to Static IP

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can't Go From Dynamic IP to Static IP

ソリューションへジャンプ
2,620件の閲覧回数
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 件の賞賛
返信
1 解決策
2,350件の閲覧回数
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 件の賞賛
返信
5 返答(返信)
2,351件の閲覧回数
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 件の賞賛
返信
2,350件の閲覧回数
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 件の賞賛
返信
2,350件の閲覧回数
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 件の賞賛
返信
2,350件の閲覧回数
kackle123
Contributor IV

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

0 件の賞賛
返信
2,350件の閲覧回数
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 件の賞賛
返信