4 years, 5 months ago.

Ethernet static IP

Hi, I am running mbed OS 5.2 and am using the ethernet interface on a FRDM K64F. At the moment the network config is using DHCP, which is fine for development but the system will eventually need to use a static IP configuration. Here is a snippet of my current code...

EthernetInterface eth;

int main (void) { do { printf("\nConnecting to eth...\n"); } while(eth.connect() != 0);

printf("IP Address is %s\n", eth.get_ip_address()); printf("MAC Address is %s\n", eth.get_mac_address()); .... }

How is a static IP configuration coded. I have found example of this for other mbed versions, and even found other EthernetInterface classes in the mbed OS 5.2 source that at least have the API to do this. All attempts to use any of those have resulted in compile errors. Did mbed really release a DHCP only ethernet stack? Anyone?

1 Answer

4 years, 5 months ago.

Believe it our not they totally eliminated static ip.I had to revert to mbed 2. Supposedly a ticket for this feature add was created. Very frustrating