Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETH.end() doesn't allow begin again if IDF SPI host is used #9685

Closed
1 task done
JAndrassy opened this issue May 26, 2024 · 4 comments · Fixed by #9693
Closed
1 task done

ETH.end() doesn't allow begin again if IDF SPI host is used #9685

JAndrassy opened this issue May 26, 2024 · 4 comments · Fixed by #9693
Milestone

Comments

@JAndrassy
Copy link
Contributor

Board

ESP32 Dev Module

Device Description

Espressif Dev module

Hardware Configuration

Wiz850io wired to default SPI pins

Version

latest master (checkout manually)

IDE Name

Sloeber

Operating System

Linux Mint

Flash frequency

40

PSRAM enabled

yes

Upload speed

921600

Description

when IDF SPI host is used for ETH, new ETH.begin fails if ETH.end was invoked before.

Sketch

#define ETH_PHY_TYPE        ETH_PHY_W5500
#define ETH_PHY_ADDR        1
#define ETH_PHY_CS          5
#define ETH_PHY_IRQ         -1
#define ETH_PHY_RST         -1

#define ETH_PHY_SPI_HOST    SPI2_HOST
#define ETH_PHY_SPI_SCK     18
#define ETH_PHY_SPI_MISO    19
#define ETH_PHY_SPI_MOSI    23

#include <ETH.h>

void setup() {

  Serial.begin(115200);
  delay(500);

  ETH.begin();
  while (!ETH.hasIP()) {
    Serial.print('.');
    delay(1000);
  }

  Serial.println();
  Serial.println("end");
  ETH.end();

  ETH.begin();
  while (!ETH.hasIP()) {
    Serial.print('.');
    delay(1000);
  }
}

void loop() {
}

Debug Message

E (4670) spi: spi_bus_initialize(768): SPI bus already initialized.
[  3632][E][ETH.cpp:566] beginSPI(): SPI bus initialize failed: 259

Other Steps to Reproduce

I don't have a setup for ESP32 MAC with a PHY module yet so I can't test that

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.
@JAndrassy JAndrassy added the Status: Awaiting triage Issue is waiting for triage label May 26, 2024
@VojtechBartoska VojtechBartoska added Status: In Progress Issue is in progress and removed Status: Awaiting triage Issue is waiting for triage labels May 27, 2024
@VojtechBartoska VojtechBartoska added this to the 3.0.0 milestone May 27, 2024
@VojtechBartoska VojtechBartoska added Status: Solved and removed Status: In Progress Issue is in progress labels May 27, 2024
@JAndrassy
Copy link
Contributor Author

@me-no-dev I spotted one more end problem. it removes the even handler without checking if other instances are still active

@me-no-dev
Copy link
Member

can you elaborate a bit more? what other instances you mean?

@JAndrassy
Copy link
Contributor Author

JAndrassy commented May 28, 2024

instances of ETHClass
static ETHClass *_ethernets[3] = {NULL, NULL, NULL};

@me-no-dev
Copy link
Member

ok, I have a board with two ETH on it. Will give it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants