ESP32 Dev Board Ardupilot Setup

Hey everyone, this is my first time with ardupilot. I’m trying to set arduplane up on an esp32 dev board.
I have folllowed the build steps and everything is installed (mavproxy, gcc-arm, cygwin and all its packages along with the whole devel package). I have cloned the ardupilot repo from git and installed extra python packages.

I have referred to these webpages:

when i run waf configure, it says:

$ waf configure
-bash: waf: command not found

when i run python waf configure, it gives this output:

$ python waf configure
Setting top to                           : /home/Paarth/ardupilot
Setting out to                           : /home/Paarth/ardupilot/build
Autoconfiguration                        : enabled
Checking for program 'python'            : /usr/bin/python
Checking for python version >= 3.6.9     : 3.9.16
Setting board to                         : sitl
Using toolchain                          : native
Checking for 'g++' (C++ compiler)        : /usr/bin/g++
Checking for 'gcc' (C compiler)          : /usr/bin/gcc
Checking for c flags '-MMD'              : yes
Checking for cxx flags '-MMD'            : yes
CXX Compiler                             : g++ 11.4.0
Checking for need to link with librt     : not necessary
Checking for feenableexcept              : no
Enabling -Werror                         : yes
Enabled OpenDroneID                      : no
Enabled firmware ID checking             : no
GPS Debug Logging                        : no
Enabled custom controller                : yes
Checking for HAVE_CMATH_ISFINITE         : yes
Checking for HAVE_CMATH_ISINF            : yes
Checking for HAVE_CMATH_ISNAN            : yes
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISINF_STD_NAMESPACE    : yes
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE    : yes
Checking for header endian.h                   : yes
Checking for header byteswap.h                 : yes
Checking for HAVE_MEMRCHR                      : no
Configured VSCode Intellisense:                : no
DC_DSDL compiler                               : /home/Paarth/ardupilot/modules/DroneCAN/dronecan_dsdlc/dronecan_dsdlc.py
Source is git repository                       : yes
Update submodules                              : yes
Checking for program 'git'                     : /usr/bin/git
Checking for program 'size'                    : /usr/bin/size
Benchmarks                                     : disabled
Unit tests                                     : enabled
Scripting                                      : maybe
Scripting runtime checks                       : enabled
Debug build                                    : disabled
Coverage build                                 : disabled
Force 32-bit build                             : disabled
Checking for program 'rsync'                   : /usr/bin/rsync
'configure' finished successfully (14.798s)

but when i run python waf configure --board esp32diy --debug, it says:

Setting top to                           : /home/Paarth/ardupilot
Setting out to                           : /home/Paarth/ardupilot/build
Autoconfiguration                        : enabled
Checking for program 'python'            : /usr/bin/python
Checking for python version >= 3.6.9     : 3.9.16
Setting board to                         : esp32diy
Using toolchain                          : xtensa-esp32-elf
Checking for 'g++' (C++ compiler)        : not found
could not configure a C++ compiler!
(complete log in /home/Paarth/ardupilot/build/config.log)

i tried installing cygwin and gcc compiler again but I am not able to fix the issue…
i feel i am missing something but not able to figure it out…

i tried python waf plane and it says:

$ python waf plane
Waf: Entering directory `/home/Paarth/ardupilot/build/sitl'
Embedding file locations.txt:Tools/autotest/locations.txt
Embedding file models/Callisto.json:Tools/autotest/models/Callisto.json
Embedding file models/plane-3d.parm:Tools/autotest/models/plane-3d.parm
Embedding file models/plane.parm:Tools/autotest/models/plane.parm
Embedding file models/xplane_heli.json:Tools/autotest/models/xplane_heli.json
Embedding file models/xplane_plane.json:Tools/autotest/models/xplane_plane.json
you need to install pexpect with 'python -m pip install pexpect'

instead waf you must run ./waf

right now it says:

$ ./waf configure --board esp32empty --debug
Setting top to                           : /home/Paarth/ardupilot
Setting out to                           : /home/Paarth/ardupilot/build
Autoconfiguration                        : enabled
Checking for program 'python'            : /usr/bin/python3
Checking for python version >= 3.6.9     : 3.9.16
Setting board to                         : esp32empty
Using toolchain                          : xtensa-esp32-elf
Checking for 'g++' (C++ compiler)        : /cygdrive/d/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-g++
Checking for 'gcc' (C compiler)          : /cygdrive/d/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc
Checking for c flags '-MMD'              : yes
Checking for cxx flags '-MMD'            : yes
CXX Compiler                             : g++ 13.2.0
Checking for program 'cmake'             : /usr/bin/cmake
Checking for program 'ninja, ninja-build' : /usr/bin/ninja
USING EXPRESSIF IDF:D:\Espressif
USING DEFAULT_PARAMETERS:/home/Paarth/ardupilot/libraries/AP_HAL_ESP32/boards/defaults.parm
Enabled OpenDroneID                       : no
Enabled firmware ID checking              : no
GPS Debug Logging                         : no
Enabled custom controller                 : no
Checking for HAVE_CMATH_ISFINITE          : yes
Checking for HAVE_CMATH_ISINF             : yes
Checking for HAVE_CMATH_ISNAN             : yes
Checking for NEED_CMATH_ISFINITE_STD_NAMESPACE : yes
Checking for NEED_CMATH_ISINF_STD_NAMESPACE    : yes
Checking for NEED_CMATH_ISNAN_STD_NAMESPACE    : yes
Checking for header endian.h                   : not found
Checking for header byteswap.h                 : not found
Checking for HAVE_MEMRCHR                      : no
Configured VSCode Intellisense:                : no
DC_DSDL compiler                               : /home/Paarth/ardupilot/modules/DroneCAN/dronecan_dsdlc/dronecan_dsdlc.py
Source is git repository                       : yes
Update submodules                              : yes
Checking for program 'git'                     : /usr/bin/git
Checking for program 'xtensa-esp32-elf-size'   : /cygdrive/d/Espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin/xtensa-esp32-elf-size
Benchmarks                                     : disabled
Unit tests                                     : enabled
Scripting                                      : maybe
Scripting runtime checks                       : enabled
Debug build                                    : enabled
Coverage build                                 : disabled
Force 32-bit build                             : disabled
Checking for program 'rsync'                   : /usr/bin/rsync
'configure' finished successfully (4.682s)

i had added the esp idf bin to the path environment variable and it worked yesterday but it said configure was finished but when i tried to close the Cygwin terminal, it said some processes were running… so i opened another cygwin ternimal and ran ./waf plane

`Paarth@DeepBlue ~/ardupilot
$ ./waf plane
Waf: Entering directory `/home/Paarth/ardupilot/build/esp32empty'
[2/3] CMake Build esp-idf showinc
No such file or directory
CMake Error: Generator: execution of make failed. Make command was:  showinc &&

Waf: Leaving directory `/home/Paarth/ardupilot/build/esp32empty'
Build failed
 -> task in 'esp-idf_showinc' failed (exit status 1):
        {task 123145293383488: cmake_build_task  -> includes.list}
 (run with -v to display more information)

Paarth@DeepBlue ~/ardupilot
`

@Archer_DeepBlue I think you have to run ./waf clean before you can run a new configuration. It’s noted here in the dev setup