<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックAdding DHCP to ColdFire_Lite demo</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137221#M1916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;At the recent ColdFire Ethernet Seminar, a ColdFire_Lite program that provided a web server was used as a demo of the M52233DEMO board. It had a fixed IP address of 192.168.1.99. However, there are bits and pieces in the code that almost allow the program to use DHCP to obtain its IP address. Just a few changes are necessary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ones below have worked for me, but I have not stress tested them and don't know, for example, what would happen if the DHCP server didn't serve up an IP address.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any feedback.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In main.c, replace the code used to set the address to 192.168.1.99 to read as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifdef DHCP_CLIENT // 24 May 06 -- rlt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// zero out info to be provided by DHCP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_ipaddr = (0x00000000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_defgw = (0x00000000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].snmask = (0x00000000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* hardcode FEC IP address for now. We set it in netstatic, and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* Ip startup code will initialize net[] from it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#elif 1 // EMG 192.168.1.99&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// added gateway as 192.168.1.1 to allow pinging beyond LAN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_ipaddr = (0xC0A80163);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_defgw = (0xC0A80101); // 24 May 06 -- rlt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].snmask = (0xffffff00);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else //jpw 192.168.2.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_ipaddr = (0xC0A80203);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_defgw = (0xC0A80201);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].snmask = (0xffffff00);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif // DHCP_CLIENT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In dhcsetup.c, in the dhc_setup() function, just before the test&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!(nets[iface]-&amp;gt;n_flags &amp;amp; NF_DHCPC))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;continue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;add&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifdef DHCP_CLIENT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nets[iface]-&amp;gt;n_flags |= NF_DHCPC ; /* use DHCP Client on each iface */ // rlt 26 May 06&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make this work, you have to uncomment the definition of DHCP_CLIENT in ipport.h to read&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#define DHCP_CLIENT 1 /* include DHCP client code */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To restore the project to its original (except for my added 192.168.1.1 gateway) just comment out the #define of DHCP_CLIENT. If you don't want the gateway, change 0xC0A80101 to 0x00000000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Richard&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. Sorry about the lack of indenting in the code, but that's the way the forum's software formats it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 May 2006 12:45:18 GMT</pubDate>
    <dc:creator>Richly</dc:creator>
    <dc:date>2006-05-27T12:45:18Z</dc:date>
    <item>
      <title>Adding DHCP to ColdFire_Lite demo</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137221#M1916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;At the recent ColdFire Ethernet Seminar, a ColdFire_Lite program that provided a web server was used as a demo of the M52233DEMO board. It had a fixed IP address of 192.168.1.99. However, there are bits and pieces in the code that almost allow the program to use DHCP to obtain its IP address. Just a few changes are necessary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The ones below have worked for me, but I have not stress tested them and don't know, for example, what would happen if the DHCP server didn't serve up an IP address.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd appreciate any feedback.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In main.c, replace the code used to set the address to 192.168.1.99 to read as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifdef DHCP_CLIENT // 24 May 06 -- rlt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// zero out info to be provided by DHCP&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_ipaddr = (0x00000000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_defgw = (0x00000000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].snmask = (0x00000000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* hardcode FEC IP address for now. We set it in netstatic, and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* Ip startup code will initialize net[] from it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;*/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#elif 1 // EMG 192.168.1.99&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;// added gateway as 192.168.1.1 to allow pinging beyond LAN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_ipaddr = (0xC0A80163);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_defgw = (0xC0A80101); // 24 May 06 -- rlt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].snmask = (0xffffff00);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#else //jpw 192.168.2.3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_ipaddr = (0xC0A80203);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].n_defgw = (0xC0A80201);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;netstatic[0].snmask = (0xffffff00);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif // DHCP_CLIENT&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In dhcsetup.c, in the dhc_setup() function, just before the test&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if (!(nets[iface]-&amp;gt;n_flags &amp;amp; NF_DHCPC))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;continue;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;add&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#ifdef DHCP_CLIENT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;nets[iface]-&amp;gt;n_flags |= NF_DHCPC ; /* use DHCP Client on each iface */ // rlt 26 May 06&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;#endif&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To make this work, you have to uncomment the definition of DHCP_CLIENT in ipport.h to read&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#define DHCP_CLIENT 1 /* include DHCP client code */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To restore the project to its original (except for my added 192.168.1.1 gateway) just comment out the #define of DHCP_CLIENT. If you don't want the gateway, change 0xC0A80101 to 0x00000000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Richard&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. Sorry about the lack of indenting in the code, but that's the way the forum's software formats it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2006 12:45:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137221#M1916</guid>
      <dc:creator>Richly</dc:creator>
      <dc:date>2006-05-27T12:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding DHCP to ColdFire_Lite demo</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137222#M1917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hi Richard&lt;/P&gt;&lt;P&gt;I can't comment as to the suitability of the Lite code for DHCP but did once analyse the OpenTCP DHCP support, which is also available for the Coldfire. In this case it deviated in several points from RFC 2131, which required random startup and backoff repetition times and lease management theoretically up to about 100 years.&lt;/P&gt;&lt;P&gt;I have an implementation of DHCP which has been well tested and is RFC 2131 conform included in the uTasker operating system with integrated TCP/IP stack. It has a port to the M5223X and a powerful demo project for the EVB or demo board.&lt;/P&gt;&lt;P&gt;See the following posting for links to an on-line demo, documentation and a simple application form - it is free for educational and hobby work, including free email support and has a growing community working on freescale devices.&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=274" target="_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=274&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You can download target code to see it in action on your own board here (including DHCP...):&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="http://www.mjbc.ch/software/uTasker/M5223X/uTaskerV1.2beta005_m5223X.s19" rel="nofollow" target="_blank"&gt;&lt;FONT color="#000000" size="2"&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;A href="http://www.mjbc.ch/software/uTasker/M5223X/uTaskerV1.2beta005_m5223X.s19" target="test_blank"&gt;http://www.mjbc.ch/software/uTasker/M5223X/uTaskerV1.2beta005_m5223X.s19&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;You can also read a note on the DHCP implementation here:&lt;BR /&gt;&lt;A href="http://www.mjbc.ch/documents/uTasker/uTaskerDHCP.PDF" rel="nofollow" target="_blank"&gt;&lt;/A&gt;&lt;A href="http://www.mjbc.ch/documents/uTasker/" target="test_blank"&gt;http://www.mjbc.ch/documents/uTasker/&lt;/A&gt;&lt;U&gt;&lt;FONT color="#0000ff"&gt;uTaskerDHCP.PDF&lt;/FONT&gt;&lt;/U&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;The uTasker includes a unique real-time simulator enabling complete development and testing of IP applications (and more) on a simulated M5223X running in real time, which&amp;nbsp;typically cuts development time of embedded projects by around 60%. Once the code is working it can be downloaded and verified on the target, cutting out tedious target testing and its inherent lower efficiency.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;As I said, it's free, with no strings attached for hobby (and evaluation) work. It is fully supported and not only allows a flying start but is great fun to work with. So don't be shy, the uTasker solution will impress you!!&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;Mark Butcher&lt;BR /&gt;&lt;A href="http://www.mjbc.ch/" rel="nofollow" target="_blank"&gt;www.mjbc.ch&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 May 2006 17:40:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137222#M1917</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2006-05-27T17:40:57Z</dc:date>
    </item>
    <item>
      <title>Re: Adding DHCP to ColdFire_Lite demo</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137223#M1918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;The latest version of the web server demo includes support for&amp;nbsp;DHCP&amp;nbsp;by simply pushing and holding SW1 at power-up.&lt;/P&gt;&lt;P&gt;The DHCP client has been tested with Netgear, Linksys, Belkin, and Netgeo routers.&lt;/P&gt;&lt;P&gt;If you have any questions please contact me at:&amp;nbsp; eric.gregori@freescale.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Jul 2006 03:55:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Adding-DHCP-to-ColdFire-Lite-demo/m-p/137223#M1918</guid>
      <dc:creator>ericgregori</dc:creator>
      <dc:date>2006-07-09T03:55:19Z</dc:date>
    </item>
  </channel>
</rss>

