Change IP setting on fly for NXP RT1170 with freeRTOS

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

Change IP setting on fly for NXP RT1170 with freeRTOS

ソリューションへジャンプ
1,069件の閲覧回数
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,049件の閲覧回数
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,050件の閲覧回数
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,051件の閲覧回数
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,055件の閲覧回数
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,052件の閲覧回数
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 件の賞賛
返信