<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis MicrocontrollersのトピックStrange behavior in RTCS ipcfg.c when using LWDNS</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152992#M282</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been working on using DHCP to automatically configure a K60 using a TWR-K60 + TWR-SER development setup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OS is MQX 3.7. &amp;nbsp;I tried using the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error = ipcfg_bind_dhcp_wait(IPCFG_default_enet_device, 0, NULL);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was followed by checking the error for the result, and printing out the resulting ip information&lt;/P&gt;&lt;P&gt;using the same code that's in the Security_Network.c file (lines 98-101).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The scenario was this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I plugged in the TWR-SER board to an isolated switch connected only to a DHCP server. &amp;nbsp;The configuration worked, and I was able to see the correct IP Address, Netmask, Gateway, and DNS address. &amp;nbsp;The lease time on the DHCP server was set to 5 minutes. &amp;nbsp;After about 1 minute, I plugged the TWR-SER board into another network with a different DHCP server. &amp;nbsp;The lease was renewed after a few minutes, and I was able to see the correct IP, Gateway, and NetMask, but the DNS server address was the same as before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After digging through some of the RTCS code, I found the relevant section called during a renew of the DHCP lease, starting at line 949 in ipcfg.c, and it looks like (with&amp;nbsp;RTCSCFG_ENABLE_LWDNS﻿ set) the only update to the DNS address happens by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ipcfg_data[device].dns = ntohl (optptr);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The global&amp;nbsp;LWDNS_server_ipaddr﻿ is never updated when the lease is renewed. &amp;nbsp;Is there any reason for this? &amp;nbsp;I added the following line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ipcfg_add_dns_ip (device, ipcfg_data[device].dns);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems to do the trick, the DNS address is now included in the new DHCP lease.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jul 2011 22:44:53 GMT</pubDate>
    <dc:creator>TravisHidlay</dc:creator>
    <dc:date>2011-07-22T22:44:53Z</dc:date>
    <item>
      <title>Strange behavior in RTCS ipcfg.c when using LWDNS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152992#M282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been working on using DHCP to automatically configure a K60 using a TWR-K60 + TWR-SER development setup.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The OS is MQX 3.7. &amp;nbsp;I tried using the code below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error = ipcfg_bind_dhcp_wait(IPCFG_default_enet_device, 0, NULL);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was followed by checking the error for the result, and printing out the resulting ip information&lt;/P&gt;&lt;P&gt;using the same code that's in the Security_Network.c file (lines 98-101).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The scenario was this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I plugged in the TWR-SER board to an isolated switch connected only to a DHCP server. &amp;nbsp;The configuration worked, and I was able to see the correct IP Address, Netmask, Gateway, and DNS address. &amp;nbsp;The lease time on the DHCP server was set to 5 minutes. &amp;nbsp;After about 1 minute, I plugged the TWR-SER board into another network with a different DHCP server. &amp;nbsp;The lease was renewed after a few minutes, and I was able to see the correct IP, Gateway, and NetMask, but the DNS server address was the same as before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After digging through some of the RTCS code, I found the relevant section called during a renew of the DHCP lease, starting at line 949 in ipcfg.c, and it looks like (with&amp;nbsp;RTCSCFG_ENABLE_LWDNS﻿ set) the only update to the DNS address happens by:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ipcfg_data[device].dns = ntohl (optptr);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The global&amp;nbsp;LWDNS_server_ipaddr﻿ is never updated when the lease is renewed. &amp;nbsp;Is there any reason for this? &amp;nbsp;I added the following line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ipcfg_add_dns_ip (device, ipcfg_data[device].dns);﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This seems to do the trick, the DNS address is now included in the new DHCP lease.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 22:44:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152992#M282</guid>
      <dc:creator>TravisHidlay</dc:creator>
      <dc:date>2011-07-22T22:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior in RTCS ipcfg.c when using LWDNS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152993#M283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I probably should have posted this in the MQX RTCS forum... &amp;nbsp;Can a moderator move the post?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jul 2011 22:47:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152993#M283</guid>
      <dc:creator>TravisHidlay</dc:creator>
      <dc:date>2011-07-22T22:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior in RTCS ipcfg.c when using LWDNS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152994#M284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Travis,&lt;/P&gt;&lt;P&gt;Have you resolved this issue?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Sep 2011 00:09:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152994#M284</guid>
      <dc:creator>DavidS</dc:creator>
      <dc:date>2011-09-22T00:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior in RTCS ipcfg.c when using LWDNS</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152995#M285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might be helpful for someone. Before binding dhcp, use the following to make sure the network link is ready:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//wait for the network to be ready&lt;/P&gt;&lt;P&gt;while (ipcfg_task_poll() == FALSE);&lt;/P&gt;&lt;P&gt;//next bind dhcp&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had the same problem that after wireless had been disconnected I was unable to get correct DNS address. This thread was helpful but my problem finally was solved by code mentioned above.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 May 2012 17:32:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Strange-behavior-in-RTCS-ipcfg-c-when-using-LWDNS/m-p/152995#M285</guid>
      <dc:creator>Jarpba</dc:creator>
      <dc:date>2012-05-09T17:32:00Z</dc:date>
    </item>
  </channel>
</rss>

