Hi Apologies if this is something stupid, I’ve been trying out the networking on the SCM20260D.
I’ve used the example code:
//Reset external phy.
var gpioController = GpioController.GetDefault();
var resetPin = gpioController.OpenPin(SC20260.GpioPin.PG3);
resetPin.SetDriveMode(GpioPinDriveMode.Output);
resetPin.Write(GpioPinValue.Low);
System.Threading.Thread.Sleep(100);
resetPin.Write(GpioPinValue.High);
System.Threading.Thread.Sleep(100);
_controller = NetworkController.FromName(SC20260.NetworkController.EthernetEmac);
var networkInterfaceSetting = new EthernetNetworkInterfaceSettings();
var networkCommunicationInterfaceSettings = new BuiltInNetworkCommunicationInterfaceSettings();
networkInterfaceSetting.MacAddress = new byte[] { 0x00, 0x4, 0x00, 0x00, 0x00, 0x00 };
networkInterfaceSetting.DhcpEnable = true;
_controller.SetInterfaceSettings(networkInterfaceSetting);
_controller.SetCommunicationInterfaceSettings(networkCommunicationInterfaceSettings);
_controller.SetAsDefaultController();
_controller.NetworkAddressChanged += NetworkController_NetworkAddressChanged;
_controller.NetworkLinkConnectedChanged += NetworkController_NetworkLinkConnectedChanged;
_controller.Enable();
When the Network Address changes with DHCP, the address is set but the DNS entries are set to 0.0.0.0:
Address changed: 0.0.0.0 DNS = 0.0.0.0
Network Link Connected Changed
Address changed: 169.254.1.0 DNS = 0.0.0.0
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
I’ve tried setting networkInterfaceSetting.DynamicDnsEnable = true and that didn’t make any difference. Also, it looks like the IP address that is set, isn’t in the normal range of 172.24.1.* for my network.
Any ideas?
Thanks for any help,
Jas