syok_2001 发表于 2012-10-31 16:24:45

关于STM32与ENC28J60问题的解决

前段时间做STM32+ENC28J60的网络产品,发现接入公司局域网后ping,回应也来越慢的问题.(分析是局域网中ARP包过多造成的,使用的是0.34版本)
这几天查找了一下原因发现函数struct pbuf *enc28j60_rx(rt_device_t dev)中spi_write_op(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC)的位置改变以下就不出现变慢现象.
...............................
pk_counter = spi_read(EPKTCNT);
if (pk_counter)
    {
       ...................
       ...................
      // Move the RX read pointer to the start of the next received packet
      // This frees the memory we just read out
      spi_write(ERXRDPTL, (NextPacketPtr));
      spi_write(ERXRDPTH, (NextPacketPtr)>>8);
      spi_write_op(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC);//新位置      // decrement the packet counter indicate we are done with this packet

    }
else
{
.................
.................
}
                //spi_write_op(ENC28J60_BIT_FIELD_SET, ECON2, ECON2_PKTDEC);//原来位置

163fit 发表于 2012-11-1 17:43:07

{:smile:}{:smile:}

3050311118 发表于 2012-11-3 22:14:27

为什么呢                  

林州 发表于 2012-11-14 16:51:37

新版本已经解决过了。可以下载新版的
页: [1]
查看完整版本: 关于STM32与ENC28J60问题的解决