Skip to content

Commit 9e48d9f

Browse files
committed
fix(spi): Fix P4 SPI Pin definitions
Use GPIOs 36 or lower to avoid LDO power issues
1 parent ee1bc6b commit 9e48d9f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cores/esp32/esp32-hal-spi.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
#endif
6666

6767
struct spi_struct_t {
68-
spi_dev_t *dev;
68+
volatile spi_dev_t *dev;
6969
#if !CONFIG_DISABLE_HAL_LOCKS
7070
SemaphoreHandle_t lock;
7171
#endif

variants/esp32p4/pins_arduino.h

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ static const uint8_t RX = 38;
2222
static const uint8_t SDA = 7;
2323
static const uint8_t SCL = 8;
2424

25-
static const uint8_t SS = 27;
26-
static const uint8_t MOSI = 46;
27-
static const uint8_t MISO = 47;
28-
static const uint8_t SCK = 48;
25+
// Use GPIOs 36 or lower on the P4 DevKit to avoid LDO power issues with high numbered GPIOs.
26+
static const uint8_t SS = 26;
27+
static const uint8_t MOSI = 32;
28+
static const uint8_t MISO = 33;
29+
static const uint8_t SCK = 36;
2930

3031
static const uint8_t A0 = 16;
3132
static const uint8_t A1 = 17;

0 commit comments

Comments
 (0)