SPI.h got an error when complied by Platform IO

geraffe
Posts: 2
Joined: Mon Apr 12, 2021 12:23 am

SPI.h got an error when complied by Platform IO

Postby geraffe » Mon Apr 12, 2021 12:46 am

Hi forum,

I'm a newbe just transfer from Arduino to ESP32 and found out this board is awesome!! However, when I tested SPI function to the board I met a problem:

I use the "arduino-esp32/libraries/" library from Github (https://github.com/espressif/arduino-es ... /libraries) and compiled it by PLTFORM IO in Visual Studio Code.

Even the example code cannot go through. It always shows the error message of

"src\SPI.cpp: In member function 'void SPIClass::transferBytes(const uint8_t*, uint8_t*, uint32_t)':
src\SPI.cpp:253:43: error: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
spiTransferBytes(_spi, data, out, size);"

But when I tried Arduino IDE, it works and nothing wrong.

I've already put 3 days on searching the solution and feel more than frustrating. So I just wondering if anyone meet the same problem? or does anyone know what's going on with the SPI.h?

Appreciation for ANY help!!
Bests,

G

Who is online

Users browsing this forum: No registered users and 102 guests