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

SPI bus conflicts between Ethernet and MCP23S08 #2

Open
wildstray opened this issue Nov 4, 2022 · 2 comments
Open

SPI bus conflicts between Ethernet and MCP23S08 #2

wildstray opened this issue Nov 4, 2022 · 2 comments

Comments

@wildstray
Copy link

wildstray commented Nov 4, 2022

Hello, I'm an embedded developer for a company that made an industrial protocol bridges based on ESP32. We used you ProDinos but we're experiencing issues with SPI. With base Ethernet library (cannot compile the embedded one, moreover I cannot found what changes are justifying the embedded one) we had to disuse digital I/O and comment out all reference and initialization of MCP23S08 also in you library. This is the only way we found to have a stable behaviour of W5500.
Otherwise, if we try to use digital I/O or simply leave this library to init MCP23S08, we cannot read digital inputs (they are random), there are sporadic network errors (eg. corrupted web pages with EthernetWebServer) and the worst thing is that maybe the firmware crashes after Ethernet.begin() due to task watchdog when we power on the ProDino. If this issue happens, there is no way other than power off and power on. ESP.restart() don't reset W5500. I notice we can use in stable manner only MCP23S08 OR Ethernet.
I tried to lower SPI clock modifying w5100.h SPI_ETHERNET_SETTINGS define, to use your standalone KMP_MCP23S08 library into ProDinoESP32 library instead of embedded MCP23S08 one... no way...

@wildstray
Copy link
Author

wildstray commented Nov 4, 2022

PS: The power up lock of W5500 happens only with ProDino ESP32 EX and not with the old model.

@wildstray
Copy link
Author

PPS: Take a look on this issue... other developers are noticing issues with Ethernet and SPI and is seems likely an issue of ESP32 SPI library...
PaulStoffregen/Ethernet#39
Anyway, it must possibile to use all hardware features of your devices... so have you some tips to manage shared SPI?
I have seen some changes in the commits history just about MCP23S08, I noticed you tried to use a mutex and then you backtrack...
Might be actually the ESP32 board platform (and how to address the issue?), maybe both Ethernet and MCP23S08 need mutex and/or transactions, maybe the management of timings (but there are already right delays and introducing other delays doesn't help, already tried) and CS lines?

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

No branches or pull requests

1 participant