<?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のトピックRe: Bug in MCF54452 FEC broadcast reject function?</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Bug-in-MCF54452-FEC-broadcast-reject-function/m-p/151043#M3935</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;26.4.10 Receive Control Registers (RCR0 &amp;amp; RCR1)RCRn controls the operational mode of the receive block and &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;must be written only when ECRn[ETHER_EN] is cleared (initialization time).&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;You can't write to that register while the chip is running. No wonder the chip is stopping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't need to "monitor the FEC to restart it". Don't write to registers you're not allowed to write to and it won't stop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You probably don't want to shut down the entire chip in order to change that bit in that register, as you'll lose "real packets" while doing that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't take any CPU overhead to receive packet. The FEC is doing all that for you. So leave it to receive all packets and then simply ignore the ones you don't want in the receive code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; I need to reject broadcast frame accord to the flux of broadcast to avoid broadcast storm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's not a good way to "avoid broadcast storms". There's only a "storm" if a device wrongly responds to broadcasts. You can get a "storm" if a buggy device responds to a broadcast packet with a broadcast response. That's a software bug. You find them and fix them (in your gear) or stop using devices from someone else that does that. Or you write your own code to ignore the packets at the software level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 08:54:15 GMT</pubDate>
    <dc:creator>TomE</dc:creator>
    <dc:date>2020-10-29T08:54:15Z</dc:date>
    <item>
      <title>Bug in MCF54452 FEC broadcast reject function?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Bug-in-MCF54452-FEC-broadcast-reject-function/m-p/151042#M3934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,the following is my problem during MCF54452 FEC:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to reject broadcast frame accord to the flux of broadcast to avoid broadcast storm.So, I&amp;nbsp;enable fec&amp;nbsp;accept&amp;nbsp;broadcast in one millisecond and reject in next milliseond.At the same time,I&amp;nbsp; test fec with&amp;nbsp;PING request&amp;nbsp; and&amp;nbsp;UDP broadcast packet, soon&amp;nbsp;later fec stop and never&amp;nbsp;trigger&amp;nbsp;RXF interrupt and also MIB conunter stop,I read the MCF54452 manual carefully,no register can flag the fec stop.How can I monitor the&amp;nbsp;activity of FEC&amp;nbsp; and restart&amp;nbsp;FEC&amp;nbsp;?&amp;nbsp;My sample code as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/********************************************************************/&lt;/P&gt;&lt;P&gt;&amp;nbsp;unsigned long nld_rx_count=0;&lt;BR /&gt;int slt0_interrupt_handler (void* arg1, void* arg2) //slt0 trigger interrupt every one millisecond&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;(void)arg1;(void)arg2;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_PIT_PCSR(0)|=MCF_PIT_PCSR_PIF;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int mResult=0;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static unsigned bkt_enable=0;///////////for test&lt;/P&gt;&lt;P&gt;&amp;nbsp;nld_rx_count=MCF_FEC_RMON_R_OCTETS(0);&amp;nbsp; //accept broadcast frame&lt;BR /&gt;&amp;nbsp;if(bkt_enable)&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; bkt_enable=0;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; MCF_FEC_RCR(0)&amp;amp;=~MCF_FEC_RCR_BC_REJ; //reject broadcast frame&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;&amp;nbsp;else&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; bkt_enable=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; MCF_FEC_RCR(0)|=MCF_FEC_RCR_BC_REJ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return mResult;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;/********************************************************************/&lt;/P&gt;&lt;P&gt;////interrupt handler for FEC isr&lt;/P&gt;&lt;P&gt;int nld_fec_isr(void* arg1,void* arg2)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;(void)arg1;(void)arg2;&lt;BR /&gt;&amp;nbsp; unsigned char ch;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; unsigned long mEvent;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; NLD_FEC_DEV_PTR uptr=(NLD_FEC_DEV_PTR)arg1;&amp;nbsp;//retrieve fec from arg1&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ch=(unsigned char)uptr-&amp;gt;tag;//we use ch to select fec module,0-fec0 1-fec1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mEvent=MCF_FEC_EIR(ch);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///////&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_FEC_EIR(ch)=mEvent;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(mEvent&amp;amp;MCF_FEC_EIR_RXF)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; uptr-&amp;gt;fec_statics.rxf_ints++;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //we check for data receive&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nld_fec_rcv(uptr);&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 10:48:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Bug-in-MCF54452-FEC-broadcast-reject-function/m-p/151042#M3934</guid>
      <dc:creator>p123</dc:creator>
      <dc:date>2012-04-03T10:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in MCF54452 FEC broadcast reject function?</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Bug-in-MCF54452-FEC-broadcast-reject-function/m-p/151043#M3935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;26.4.10 Receive Control Registers (RCR0 &amp;amp; RCR1)RCRn controls the operational mode of the receive block and &lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;must be written only when ECRn[ETHER_EN] is cleared (initialization time).&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;You can't write to that register while the chip is running. No wonder the chip is stopping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You don't need to "monitor the FEC to restart it". Don't write to registers you're not allowed to write to and it won't stop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You probably don't want to shut down the entire chip in order to change that bit in that register, as you'll lose "real packets" while doing that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't take any CPU overhead to receive packet. The FEC is doing all that for you. So leave it to receive all packets and then simply ignore the ones you don't want in the receive code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; I need to reject broadcast frame accord to the flux of broadcast to avoid broadcast storm&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's not a good way to "avoid broadcast storms". There's only a "storm" if a device wrongly responds to broadcasts. You can get a "storm" if a buggy device responds to a broadcast packet with a broadcast response. That's a software bug. You find them and fix them (in your gear) or stop using devices from someone else that does that. Or you write your own code to ignore the packets at the software level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:54:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Bug-in-MCF54452-FEC-broadcast-reject-function/m-p/151043#M3935</guid>
      <dc:creator>TomE</dc:creator>
      <dc:date>2020-10-29T08:54:15Z</dc:date>
    </item>
  </channel>
</rss>

