9 years, 5 months ago.

UIPEthernet library dose not work with ST-Nucleo-F411RE

Hi,When i use the UIPEthernet(https://developer.mbed.org/users/hudakz/code/UIPEthernet/) library with my ST-Nucleo-F411RE board,it dose not work.Here is my demo code:

  1. include "mbed.h"
  2. include <UIPEthernet.h> const uint8_t MY_MAC[6] = { 0xDD,0xDD,0xDD,0x00,0x00,0x01 }; IP address must be also unique and compatible with your network. Change as appropriate. const IPAddress MY_IP(192, 168, 1, 194); const IPAddress MY_GW(192, 168, 1, 1); const IPAddress MY_SUB(255, 255, 0, 0); const IPAddress MY_DNS(202, 96, 128, 86);

UIPEthernetClass UIPEthernet(D11, D12, D13, D10);

DigitalOut led(LED1); Serial pc(USBTX, USBRX); int main() { pc.baud(115200); pc.printf("ethernet card begin....\r\n"); UIPEthernet.begin(MY_MAC); IPAddress ip = UIPEthernet.localIP(); pc.printf("ip:%d.%d.%d.%d\r\n", ip[0], ip[1], ip[2], ip[3]); IPAddress gw = UIPEthernet.gatewayIP(); pc.printf("gw:%d.%d.%d.%d\r\n", gw[0], gw[1], gw[2], gw[3]); IPAddress sb = UIPEthernet.subnetMask(); pc.printf("sb:%d.%d.%d.%d\r\n", sb[0], sb[1], sb[2], sb[3]); while (1) { led = !led; wait(1); } }

it always return : ethernet card begin.... ip:0.0.0.0 gw:0.0.0.0 sb:0.0.0.0

it's there something wrong?

2 Answers

7 years, 10 months ago.

Hi!

You can download another (version) UIPEthernet from: https://github.com/UIPEthernet/UIPEthernet If You have any question don't hesitate.

Best Regards

7 years, 10 months ago.

Hello Jenson,
Sorry for late answer. The code you attached seems to be neither a Server nor a Client. I'd recommend you to try one of the following demos:

https://developer.mbed.org/users/hudakz/code/HTTPServer_Echo_ENC28J60/

https://developer.mbed.org/users/hudakz/code/WebSwitch_ENC28J60/

https://developer.mbed.org/users/hudakz/code/TcpServer_ENC28J60/

https://developer.mbed.org/users/hudakz/code/TcpClient_ENC28J60/

EDITING TIPS: To format a text as code, when editing a question or wiki page, it helps enclosing it with <<code>> <</code>> tags as below (for more details see also the link to Editing tips at the bottom of your edit box).

<<code>>
int max(int x, int y) {
    return (x > y) ? x : y;
}
<</code>>