Change IP setting on fly for NXP RT1170 with freeRTOS

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Change IP setting on fly for NXP RT1170 with freeRTOS

跳至解决方案
1,073 次查看
ping1
Contributor V

Dear all

I just started learning RTOS with RT 1170 DEV board, and would like to change IP address while it is running, I am able to change it from DHCP to static, but struggling to change it from static to DHCP, I believe I still need to call do it like it is starts up: 

 

 

        netifapi_dhcp_start(&netif);
        while (ethernetif_wait_linkup(&netif, 5000) != ERR_OK)
        {
            PRINTF("PHY Auto-negotiation failed. Please check the cable connection and link partner setting.\r\n");
        }
        (void)ethernetif_wait_ipv4_valid(&netif, ETHERNETIF_WAIT_FOREVER);

 

 But it is not running and stuck somewhere, I am new to freeRTOS. Please advise what I did wrong.

Thank you!

Ping

标记 (2)
0 项奖励
回复
1 解答
1,053 次查看
ping1
Contributor V

Hi, Edwin

It does need a thread to change to DHCP just as if it starts up, and delete the thread after finished changing. It is working now.

Ping

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,054 次查看
ping1
Contributor V

Hi, Edwin

It does need a thread to change to DHCP just as if it starts up, and delete the thread after finished changing. It is working now.

Ping

0 项奖励
回复
1,055 次查看
ping1
Contributor V

sorry, there is a mistake in my reply, below is what I wanted to say:

I wonder whether it needs to be done in a new thread when start DHCP again? in non OS system I just done with RT1024, change to static IP don't need to call netif_add() again, there is another api netif_set_addr(). I wonder whether there is another set of similar API to call when change to DHCP from static? 

Ping

0 项奖励
回复
1,059 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @ping1,

It might be worth looking into the place in the code where the the execution halts to get a better insight on what the specific issue might be. That said, the most straightforward recommendation would still be to de-initialize and reinitialize the stack anyways, so I would advice you to do so and let me know if the issue persists.

BR,
Edwin.

0 项奖励
回复
1,056 次查看
ping1
Contributor V

Thanks for reply, Edwin

I wonder whether it needs to be done in a new thread when start DHCP again? in non OS system I just done with RT1024, change to DHCP don't need to call netif_add() again, there is another api netif_set_addr(). I wonder whether there is another set of similar API to call when change to DHCP from static? 

BR

Ping

0 项奖励
回复