Description
Board
WT32-ETH01
Device Description
WT32-ETH01
Hardware Configuration
#define VSPI_MISO -1
#define VSPI_CS 12
#define VSPI_SCLK 14
#define VSPI_MOSI 15
Version
v2.0.4
IDE Name
Platformio
Operating System
Mac OS 11.6
Flash frequency
40Mhz
PSRAM enabled
yes
Upload speed
96100
Description
Code worked when Platformio Development environment is set to [env:esp32dev] but when changed to [env:wt32-eth01]
code fails with:
platformio/packages/framework-arduinoespressif32/libraries/SPI/src/SPI.cpp: In member function 'void SPIClass::begin(int8_t, int8_t, int8_t, int8_t)':
/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src/SPI.cpp:64:37: error: 'SCK' was not declared in this scope
_sck = (_spi_num == VSPI) ? SCK : 14;
It appears that the:
espressif/arduino-esp32/blob/master/variants/wt32-eth01/pins_arduino.h
Does not contain the same elements as the other library:
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
Sketch
#include <Arduino.h>
#include <SPI.h>
#define VSPI_MISO -1
#define VSPI_CS 12
#define VSPI_SCLK 14
#define VSPI_MOSI 15
SPIClass *vspi = NULL;
void setup(){
vspi = new SPIClass(VSPI); //create spi
vspi->begin(VSPI_SCLK, VSPI_MISO, VSPI_MOSI, VSPI_CS); //SCLK, MISO, MOSI, SS
pinMode(VSPI_CS, OUTPUT); //VSPI SS
digitalWrite(VSPI_CS, HIGH); //pull ss high t
}
void loop()
{
delay(1);
}
Debug Message
platformio/packages/framework-arduinoespressif32/libraries/SPI/src/SPI.cpp: In member function 'void SPIClass::begin(int8_t, int8_t, int8_t, int8_t)':
/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src/SPI.cpp:64:37: error: 'SCK' was not declared in this scope
_sck = (_spi_num == VSPI) ? SCK : 14;
Other Steps to Reproduce
https://community.platformio.org/t/wt32-eth01-spi-issue/28132/2
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Activity
SuGlider commentedon Aug 21, 2022
@P-R-O-C-H-Y - I think that this is a case simillar to #6737
Actually, it lacks SPI pin definition in
pins_arduino.h
forwt32-eth01
board.But we should think about a schema similar to HardwareSerial, where we check if
RX1, TX1
are defined inpins_arduino.h
, otherwise it just uses some default definition.P-R-O-C-H-Y commentedon Aug 29, 2022
@wmarchewka The author of the board doesn't declare the default SPI pins. Adding the same pins as default ones for ESP32 to the pins_arduino.h can conflict with Ethernet pins.