<?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>topic Re: OpenTCP Bug Fix Thread in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143053#M3511</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reversing the order of bytes in an address like that looks like an Endian addressing fix-up, but I am guessing. I do not know anything about TCP implementations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Jan 2010 23:13:48 GMT</pubDate>
    <dc:creator>J2MEJediMaster</dc:creator>
    <dc:date>2010-01-08T23:13:48Z</dc:date>
    <item>
      <title>OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143049#M3507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Alright, so perhaps I'm the last person to still be using OpenTCP on the NE64, but I thought it might be nice if there were a bug fix thread on this forum since there don't seem to be too many other resources on the web...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;-------&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;arp.c&lt;BR /&gt;-------&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In &lt;/SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;I&gt;void arp_get_response(void)&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt; :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;for( i=1; i&amp;lt;ARP_TSIZE; i++ )

Should be changed to:

for( i=0; i&amp;lt;ARP_TSIZE; i++ )
&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;Arrays in C are indexed starting at zero, not one.&amp;nbsp; Your application will never be able to add the first target to its ARP table because of this.&amp;nbsp; &lt;SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-mad.gif" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;IMG alt=":smileymad:" class="emoticon-smileymad emoticon" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-mad.gif" title="Smiley Mad" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;-----------------&lt;BR /&gt;Other notes&lt;BR /&gt;-----------------&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;If you're like me and used the Connector App as a starting point for your project, notice that you will have call &lt;I&gt;&lt;SPAN style="text-decoration: underline;"&gt;RTI_Init()&lt;/SPAN&gt;&lt;/I&gt; somewhere &lt;STRONG&gt;before&lt;/STRONG&gt; you call &lt;I&gt;&lt;SPAN style="text-decoration: underline;"&gt;RTI_Enable()&lt;/SPAN&gt;&lt;/I&gt; in order for real-time interrupts to actually occur.&amp;nbsp; In main.c of the Connector App, this call is not made, and there are no real-time interrupts.&amp;nbsp; This causes unpredictable behaviour on all of the OpenTCP services which rely on real-time interrupts.&amp;nbsp; &lt;SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;IMG alt=":smileysurprised:" class="emoticon emoticon-smileysurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" title="Smiley Surprised" /&gt;&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I promise to paste in any other fixes I make.&amp;nbsp; Feel free to post your fixes here too.&amp;nbsp; &lt;SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143049#M3507</guid>
      <dc:creator>nerdboy</dc:creator>
      <dc:date>2020-10-29T08:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143050#M3508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Are you sure about this change?&lt;BR /&gt;The ARP table used by OpenTCP has a fixed Broadcast entry at the arp_table[0] position. See arp_init()&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;    /* set broadcast entry    */       qstruct = &amp;amp;arp_table[0];    qstruct-&amp;gt;pradr = IP_BROADCAST_ADDRESS;    qstruct-&amp;gt;state = ARP_RESOLVED;    qstruct-&amp;gt;type = ARP_FIXED_IP;    qstruct-&amp;gt;ttl = ARP_TIMEOUT;    qstruct-&amp;gt;retries = ARP_MAXRETRY;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;The reason that I know this is because the uTasker project also uses a similar method for its ARP table management. In fact it consistently uses the form (always looping from 1) except from when searching for existing entries:&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;PRE&gt;    int i = 0;    while (++i &amp;lt; ARP_TABLE_ENTRIES) {         ...    }&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;whereas OpenTCP usually loops from 0 and sometimes from 1.&lt;BR /&gt;&lt;BR /&gt;Without studying all cases in detail I think that looping from 1 is in fact the correct method in all cases except from when doing a look up of the address to be sent to (when broadcast entry may need to be found). Starting from 0 is in all other cases possibly not an error but a wasted loop since the fixed broadcast entry never times out or is changed.&lt;BR /&gt;&lt;BR /&gt;Check out also the uTasker forum at &lt;A href="http://www.uTasker.com/forum/" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;http://www.uTasker.com/forum/&lt;/A&gt;&lt;BR /&gt;&lt;/DIV&gt;This discusses general TCP/IP stack topics as well as the NE64 and M5223X Freescale devices.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143050#M3508</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T08:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143051#M3509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Are you sure about this change?&lt;BR /&gt;The ARP table used by OpenTCP has a fixed Broadcast entry at the arp_table[0] position. See arp_init()&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;You're right about the broadcast entry at zero, thanks Mark.&amp;nbsp; I had forgotten about it!&amp;nbsp; But OpenTCP won't exhibit proper ARP behaviour unless the ARP response processing starts looking at entry zero (supposedly the broadcast entry).&amp;nbsp; I'm wondering if there's a bug elsewhere where the broadcast entry is overwritten by a new ARP request, although I couldn't find anything after a scan through arp.c.&amp;nbsp; If I find the real cause I'll correct my proposed fix (hack) - if anyone else has any ideas, let me know!&amp;nbsp; &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Aug 2007 00:43:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143051#M3509</guid>
      <dc:creator>nerdboy</dc:creator>
      <dc:date>2007-08-30T00:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143052#M3510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I realize this thread is a few years old, but I will start here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We recently noticed that the dhcp client with OpenTCP is posting the chaddr in reverse order from the IP layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I have found that in one of the projects, NE64withProcessorExpert, this code has been modified:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
 /* chaddr */// *buf_ptr++=localmachine.localHW[5];// *buf_ptr++=localmachine.localHW[4];// *buf_ptr++=localmachine.localHW[3];// *buf_ptr++=localmachine.localHW[2];// *buf_ptr++=localmachine.localHW[1];// *buf_ptr++=localmachine.localHW[0]; *buf_ptr++=localmachine.localHW[0]; *buf_ptr++=localmachine.localHW[1]; *buf_ptr++=localmachine.localHW[2]; *buf_ptr++=localmachine.localHW[3]; *buf_ptr++=localmachine.localHW[4]; *buf_ptr++=localmachine.localHW[5]; buf_ptr+=10;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with no comment about the change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My initial thoughts are that for local networks, this should make little difference as the DHCP server should be using the chaddr for issuing IP addresses, and only in the improbable situation that the transposed id conflicts with another hardware device.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was just curious if anyone knew anything about this change and any other problems that might be encountered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143052#M3510</guid>
      <dc:creator>WRS</dc:creator>
      <dc:date>2020-10-29T08:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143053#M3511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reversing the order of bytes in an address like that looks like an Endian addressing fix-up, but I am guessing. I do not know anything about TCP implementations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jan 2010 23:13:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143053#M3511</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2010-01-08T23:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143054#M3512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have the following problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Under heavy bus load in direction HCS12 to computer (UDP) the HCS12's ethernet controller sometimes losts a package when the computer sends an UDP package back. I use the OpenTCP project &lt;A href="http://sourceforge.net/projects/freescaleotcp/files/freescaleotcp/NE64_Vend_OpenTCP/NE64_Vend_OpenTCP.ZIP/download" rel="nofollow" target="_blank"&gt;NE64_Vend_OpenTCP.ZIP&lt;/A&gt; from sourceforge and have placed a counter which is increased by one before the udp_send(...) function is called. I can see that it's called as often as expected, but the package counter in wireshark is smaller than these counter so that some data packages are missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The higher the bus load the bigger the number of the missing packages. The udp_send() function never has a negative value. Is there any opportunity to see whether the ethernet controller is able to accept data?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did anybody has this problem too?&lt;/P&gt;&lt;P&gt;How can data which is placed in the net_buf get lost?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jan 2010 01:22:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143054#M3512</guid>
      <dc:creator>BuddyB</dc:creator>
      <dc:date>2010-01-30T01:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: OpenTCP Bug Fix Thread</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143055#M3513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I'm using LWIP 1.4.0 stack with MPC5567. It's quite stable, but require around 35 k of flash and 35 of RAM ( UDP +&amp;nbsp; TCP and enough buffer to run a simple http server)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jun 2011 18:29:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/OpenTCP-Bug-Fix-Thread/m-p/143055#M3513</guid>
      <dc:creator>AROK</dc:creator>
      <dc:date>2011-06-18T18:29:45Z</dc:date>
    </item>
  </channel>
</rss>

