It looks like ESP-IDF Arduino Core have been updated again with other issue. This has been tested on Arduino Nano Esp32.
The issue is macro digitalWrite() that return error if Arduino IDE is configure to use Arduino pin.
ex.
The LED_BUILTIN is the number 13 or D13 for Arduino pin.
The GPIO for ESP-IDF Arduino core is 48
So by changing in Arduino IDE to use legacy GPIO
Now we could compile without error, but if we still use pin 13 it will not work.
From the log we could see: #warning The Arduino API will use GPIO numbers for this build.
So if we change to pin to 48, everything will work again as normal.
I do not know if this change is temporary but it will effect OpenPLC hals.json
One way to inform a user could be to include
#if defined(BOARD_HAS_PIN_REMAP) && !defined(BOARD_USES_HW_GPIO_NUMBERS)
#error This library is not compatible with pin remapping. Please disable it by choosing "Tools" -> "Pin Numbering" -> "By GPIO number (legacy)" in the Arduino IDE.
#endif
More info could be find here
By using this command we could get more info from the arduino-cli
-> arduino-cli board details --fqbn esp32:esp32:nano_nora
We could then use
--board-options "<menu ID>=<option ID>"
ex.
arduino-cli compile --fqbn esp32:esp32:nano_nora --board-options "PinNumbers=byGPIONumber"
This change apply to version ESP-IDF Arduino core 3.1.2 and 3.1.3, version 3.1.1 and older still use Arduino pin
I'm not sure what approach OpenPLC will take but I will create other Esp32 entry for Arduino Nano Esp32 on my machine.
Here is quick update of the hals.json if any one have issues with ESP-IDF Arduino core version 3.1.2 and 3.1.3, and use Arduino Nano Esp32
"Arduino Nano ESP32 GPIO": {
"core": "esp32:esp32",
"default_ain": "1, 2, 3, 4, 11, 12",
"default_aout": "18, 21, 38",
"default_din": "5, 6, 7, 8, 9",
"default_dout": "10, 17, 47, 48",
"define": [
"BOARD_PORTENTA"
],
"last_update": 1738616962.0045238,
"platform": "esp32:esp32:nano_nora:PinNumbers=byGPIONumber",
"source": "esp32.cpp",
"version": "3.1.3"
},