爱睡的阿肥 2023-05-18 21:13
浏览 27
已结题

arduino + stm32f7 lan8720A ping不通

问题:arduino + stm32f7 lan8720A 无法ping通

以下是我电路板网络部分的原理图

img

img

img

img

对应写于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();
}

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 5月26日
    • 创建了问题 5月18日

    悬赏问题

    • ¥20 c#使用NPOI向word表格中添加字段导致word有概率警告不可识别
    • ¥15 怎么使用hxe16进制编码器修改视频数据和图片一样!求教程!
    • ¥15 怎么用python模拟光的折射,反射,和全反射
    • ¥15 python打印机打印word和PDF文件出来的是乱码
    • ¥15 求达梦8数据库安装包
    • ¥15 YOLOv8模型网络结构更改后报错
    • ¥15 深度学习中梯度为None
    • ¥15 zynq烧写程序到flash后不运行
    • ¥15 裸板ESD问题的思考与实验
    • ¥15 electron+python