I'm programming an ENC28J60 driver at the moment, and have encountered something odd when attempting to receive packets. More specifically, unicast packets.

According to the datasheet, when the unicast filter is enabled, any unicast packet with a destination MAC address not matching the MAC address stored in the registers gets discarded.

I've written the following filters to ERXFCON:

  • UCEN
  • BCEN
  • MCEN

That means it should allow unicasts with a matching MAC, broadcasts, multicasts, while rejecting packets that don't have a matching CRC.

I plug the ENC into the router I have, and all is well - I'm receiving broadcasts. Nice! Then I attempt to start DHCP. The DHCPDISCOVER packet gets sent. Nice!

... But where's the DHCPOFFER?

Looking at wireshark shows the router has tried to send it, at least. I've plugged my computer into a mirrored port. The destination MAC of the unicast DHCPOFFER packet is indeed matching the MAC address I've written into the registers. And yet ENC decides to reject it. Of course this isn't an issue if I disable these filters entirely, but then I have to let my software handle it, and why should I do that when the hardware is capable of doing that?

In short, I'm not sure why the ENC is rejecting unicode packets when everything seems in order.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.