Ok, Arduino IDE 1.8.19 it is.
I swapped around the /AppData/Local/Arduino15 folders to make the 1.x one active.
Then I added
https://espressif.github.io/arduino-esp32/package_esp32_index.json to "Addtional Boards Manager URLs" and installed the ESP32 package v2.09,
started IDE 1.8.19, opened the projected that is attached above, selected "DOIT ESP32 DEVKIT V1" since that worked with the ESP32 WROOM-32 board when using PlatformIO.
I changed the pins again:
#if !defined(EVE_CS)
#define EVE_CS 13
#endif
#if !defined(EVE_PDN)
#define EVE_PDN 12
#endif
#if !defined(EVE_SCK)
#define EVE_SCK 18
#endif
#if !defined(EVE_MISO)
#define EVE_MISO 19
#endif
#if !defined(EVE_MOSI)
#define EVE_MOSI 23
#endif
And it compiles just fine.
I can not get it to upload to the board though, something about the serial connection or the drivers not working.
On the serial monitor I get this though when pushing the reset button:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xe
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x0,hd_drv:0x00,wp_drv:0x0
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13132
load:0x40080400,len:3036
entry 0x400805e4
And still:
A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13,
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
I hate it when crap like this happens.
For the chance that a different board might behave differently I am trying to buy a new ESP32 board.
But all the ESP32-WROVER boards I can find are using a CH340 USB/Serial chip like the Wroom32 board I already have.
Hmm, I had more boards but I can't find these anymore, like a ESP32-CAM but this one did not have USB at all.
Edit:
I got two new ESP32 boards and while one was advertised as "ESP32 WROVER Development Board" it turned out as WROOM32 board.
So I have two different new WROOM32 boards now.
My old WROOM32 board is still not working, same error, for whatever reason.
One of my new boards is using a CH340C, the other one is using a CP2102. I can upload to both of the new boards just fine.
And I learned something, never ever use "Sketch" / "Add File..." in Arduino IDE 1 in order to edit a file from a sub-folder that is otherwise not getting displayed.
I added EVE_target/EVE_target_Arduino_ESP32.h to change the pins.
And this opportunity to learn something did cost me a number of hours.
The seemingly exact same code worked fine when compiled with PlatformIO and resulted in a watchdog-reset when compiling it with Arduino IDE 1.8.19.
It hang in EVE_cpp_target.cpp / EVE_init_spi() when calling spi_bus_initialize().
And the problem in the end was that when adding the file the Arduino IDE actually copies it to the project folder.
I edited a copy of EVE_target_Arduino_ESP32.h that the code does not use while EVE_target/EVE_target_Arduino_ESP32.h remained untouched and therefore the I/O pins for the SPI were all wrong...ouch.
Now the code works from both the Arduino IDE 1.8.19 and PlatformIO with only a minute detail.
The code compiled with PlatformIO runs a little bit faster since I compile it with -O2 while the default is -Os.
And to my surprise, the Arduino version runs significantly faster now than the native version.
Using the same ESP-IDF based code.
It looks like the ESP-IDF SPI functions in arduino-esp32 are not the same, the pauses between single byte transfers when sending a couple of bytes are shorter.
The pauses are still ridiculously long for a controller running with 240MHz, I measure 9.9µs (PIO Arduino, -O2), 10.0µs (Arduino, -Os) and 13.2µs for (PIO ESP-IDF, -O2).
In contrast I measured 640ns with an ATSAMC21 running 48MHz and 280ns with an ATSAME51 running 120MHz but these are not burdened with a RTOS and my code writes directly to the SPI registers.
The screen update is done using DMA and while the transfer of the data takes the same 113.48µs, the times from CS down to start of the transfer and from end of the transfer to CS up are different.
CS down to start
Arduino: 20.3µs
ESP-IDF: 27.6µs
C21: 860ns
end of data to CS up
Arduino: 5µs
ESP-IDF: 8.4µs
C21: 780ns
I do wonder what is going on there with ESP32.
Another comparision, the 600MHz Teensy 4.1 has 225ns between two SPI.transfer() calls, so going thru the Arduino SPI class.