andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers
http://www.andybrown.me.uk
Other
745 stars 224 forks source link

ARP lookup failure #233

Closed alec-g closed 3 years ago

alec-g commented 3 years ago

Hi all, i am trying to setup a simple static ethernet connection to a PC, the application will include UDP communication and ICMP ping tests. I am currently recieving arp lookup failures:

Error Provider: 49, Code: 6 (ARP, Timeout)
Error Provider: 50, Code 3  (IP, ARP lookup failed)

This is my current network stack setup

  typedef stm32plus::Rtc<
    stm32plus::RtcLsiClockFeature<stm32plus::Rtc32kHzLsiFrequencyProvider>,
    stm32plus::RtcSecondInterruptFeature> MyRtc;
  MyRtc* rtc_;

  typedef stm32plus::net::PhysicalLayer<stm32plus::net::DP83848C> MyPhysicalLayer;
  typedef stm32plus::net::DatalinkLayer<MyPhysicalLayer,
    stm32plus::net::DefaultRmiiInterface,
    stm32plus::net::Mac> MyDatalinkLayer;
  typedef stm32plus::net::NetworkLayer<MyDatalinkLayer,
    stm32plus::net::DefaultIp,
    stm32plus::net::Arp> MyNetworkLayer;
  typedef stm32plus::net::TransportLayer<MyNetworkLayer,
    stm32plus::net::Udp, stm32plus::net::Icmp> MyTransportLayer;
  typedef stm32plus::net::ApplicationLayer<MyTransportLayer,
    stm32plus::net::StaticIpClient, stm32plus::net::Ping> MyApplicationLayer;
  typedef stm32plus::net::NetworkStack<MyApplicationLayer> Stack;

using parameters:

  params_.base_rtc = rtc_;
  params_.staticip_address = 192.168.181.2;
  params_.staticip_subnetMask = 255.255.255.0;
  params_.staticip_defaultGateway = 192.168.181.1;

The target PC has a static IP configured to 192.168.181.1. I am using an XCore407I (stm32f407) with a DP83848VV-VBI ethernet PHY

The network stack passes both initialise() and startup() methods, however after attempting a ping test to the target PC, the above lookup failures are presented.

I have had a look at the traffic using wireshark on the target PC, i cannot see any "arp" messages come through when resetting the controller, i do see a couple of ICMPv6 messages immediately after the controller resets. wireshark

Any ideas what may be causing this?

alec-g commented 3 years ago

Fixed! Had to use the RemapRmiiInterface rather than the DefaultRmiiInterface