问题:arduino + stm32f7 lan8720A 无法ping通
以下是我电路板网络部分的原理图
对应写于MCU的arduino 的 DhcpChatServer.ino 代码如下
#include "Arduino.h"
#include <SPI.h>
#include <LwIP.h>
#include <STM32Ethernet.h>
#define PIN_LED1 PB0
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
IPAddress myDns(192, 168, 1, 1);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
if (Ethernet.linkStatus() == LinkOFF) {
Serial.println("Ethernet cable is not connected.");
}
// initialize the Ethernet device not using DHCP:
Ethernet.begin(mac, ip, myDns, gateway, subnet);
// print your local IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
// pinMode(PIN_LED1, OUTPUT);
}
void loop() {
// wait for a new client:
// digitalWrite(PIN_LED1, HIGH); // turn the LED on (HIGH is the voltage level)
// delay(1000); // wait for a second
// digitalWrite(PIN_LED1, LOW); // turn the LED off by making the voltage LOW
// delay(1000); // wait for a second
Ethernet.schedule();
}