diff --git a/cores/esp32/esp32-hal-spi.c b/cores/esp32/esp32-hal-spi.c index af3fd7b5f..809283096 100644 --- a/cores/esp32/esp32-hal-spi.c +++ b/cores/esp32/esp32-hal-spi.c @@ -65,7 +65,7 @@ #endif struct spi_struct_t { - spi_dev_t *dev; + volatile spi_dev_t *dev; #if !CONFIG_DISABLE_HAL_LOCKS SemaphoreHandle_t lock; #endif diff --git a/variants/esp32p4/pins_arduino.h b/variants/esp32p4/pins_arduino.h index 980e7bdb5..792146f5c 100644 --- a/variants/esp32p4/pins_arduino.h +++ b/variants/esp32p4/pins_arduino.h @@ -22,10 +22,11 @@ static const uint8_t RX = 38; static const uint8_t SDA = 7; static const uint8_t SCL = 8; -static const uint8_t SS = 27; -static const uint8_t MOSI = 46; -static const uint8_t MISO = 47; -static const uint8_t SCK = 48; +// Use GPIOs 36 or lower on the P4 DevKit to avoid LDO power issues with high numbered GPIOs. +static const uint8_t SS = 26; +static const uint8_t MOSI = 32; +static const uint8_t MISO = 33; +static const uint8_t SCK = 36; static const uint8_t A0 = 16; static const uint8_t A1 = 17;