Creating new ESP32 Board Definition

I've been struggling to add a new board definition for my custom ESP32 module - I have gotten through creating the package_vintlabs_index.json fine, and I mostly understand the boards.txt and platform.txt files, however the issue I seem to have is that it does not inherit from the ESP32 core.

When I try to compile, I get:

/usr/share/arduino/arduino-builder -dump-prefs -logger=machine -hardware /usr/share/arduino/hardware -hardware /home/pvint/.arduino15/packages -hardware /home/pvint/Arduino/hardware -tools /usr/share/arduino/hardware/tools/avr -tools /home/pvint/.arduino15/packages -libraries /home/pvint/Arduino/libraries -fqbn=VintLabs:esp32:vintlabs-pwm-v1:FlashFreq=80,UploadSpeed=2000000,DebugLevel=none -ide-version=10807 -build-path /tmp/arduino_build_844554 -warnings=more -build-cache /tmp/arduino_cache_622886 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=/home/pvint/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=/home/pvint/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.esptool_py.path=/home/pvint/.arduino15/packages/esp32/tools/esptool_py/2.6.1 -prefs=runtime.tools.esptool_py-2.6.1.path=/home/pvint/.arduino15/packages/esp32/tools/esptool_py/2.6.1 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=/home/pvint/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=/home/pvint/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0 -verbose /home/pvint/Electronics/ESP32/i2c_scan/i2c_scan.ino
/usr/share/arduino/arduino-builder -compile -logger=machine -hardware /usr/share/arduino/hardware -hardware /home/pvint/.arduino15/packages -hardware /home/pvint/Arduino/hardware -tools /usr/share/arduino/hardware/tools/avr -tools /home/pvint/.arduino15/packages -libraries /home/pvint/Arduino/libraries -fqbn=VintLabs:esp32:vintlabs-pwm-v1:FlashFreq=80,UploadSpeed=2000000,DebugLevel=none -ide-version=10807 -build-path /tmp/arduino_build_844554 -warnings=more -build-cache /tmp/arduino_cache_622886 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.mkspiffs.path=/home/pvint/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.mkspiffs-0.2.3.path=/home/pvint/.arduino15/packages/esp32/tools/mkspiffs/0.2.3 -prefs=runtime.tools.esptool_py.path=/home/pvint/.arduino15/packages/esp32/tools/esptool_py/2.6.1 -prefs=runtime.tools.esptool_py-2.6.1.path=/home/pvint/.arduino15/packages/esp32/tools/esptool_py/2.6.1 -prefs=runtime.tools.xtensa-esp32-elf-gcc.path=/home/pvint/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0 -prefs=runtime.tools.xtensa-esp32-elf-gcc-1.22.0-80-g6c4433a-5.2.0.path=/home/pvint/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0 -verbose /home/pvint/Electronics/ESP32/i2c_scan/i2c_scan.ino
Using board 'vintlabs-pwm-v1' from platform in folder: /home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1
Using core 'esp32' from platform in folder: /home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3
Build options changed, rebuilding all
Detecting libraries used...
"/home/pvint/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/config" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/app_trace" "-
**cut**
I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/wpa_supplicant" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/xtensa-debug-module" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/esp-face" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/esp32-camera" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/esp-face" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/fb_gfx" -std=gnu++11 -fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -fno-rtti  -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10807 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DARDUINO_VARIANT="esp32:esp32"  -DESP32 -DCORE_DEBUG_LEVEL=0  "-I/home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3/cores/esp32" "-I/home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3/variants/esp32" "/tmp/arduino_build_844554/sketch/i2c_scan.ino.cpp" -o "/dev/null"
"/home/pvint/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-80-g6c4433a-5.2.0/bin/xtensa-esp32-elf-g++" -DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/config" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/app_trace" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/app_update" "-
**cut**
I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/esp32-camera" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/esp-face" "-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/fb_gfx" -std=gnu++11 -fno-exceptions -Os -g3 -Wpointer-arith -fexceptions -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -w -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -fno-rtti  -c -w -x c++ -E -CC -DF_CPU=240000000L -DARDUINO=10807 -DARDUINO_ESP32_DEV -DARDUINO_ARCH_ESP32 -DARDUINO_BOARD="ESP32_DEV" -DARDUINO_VARIANT="esp32:esp32"  -DESP32 -DCORE_DEBUG_LEVEL=0  "-I/home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3/cores/esp32" "-I/home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3/variants/esp32" "/tmp/arduino_build_844554/sketch/i2c_scan.ino.cpp" -o "/tmp/arduino_build_844554/preproc/ctags_target_for_gcc_minus_e.cpp"
In file included from /tmp/arduino_build_844554/sketch/i2c_scan.ino.cpp:1:0:
/home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3/cores/esp32/Arduino.h:32:31: fatal error: freertos/FreeRTOS.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board VintLabs ESP32 PWM Driver v1.

After reading this thread: Custom Board Profile in Newer Arduino IDE - Installation & Troubleshooting - Arduino Forum (Which is a VERY helpful discussion!), it seems to me that my issue is that it is not inheriting from the esp32 platform.txt, and thus is not specifying the correct include directories.

I see:

"-I/home/pvint/.arduino15/packages/VintLabs/hardware/esp32/1.0.1/tools/sdk/include/freertos"

What I expected to see:

"-I/home/pvint/.arduino15/packages/esp32/hardware/esp32/1.0.3/tools/sdk/include/freertos/freertos/FreeRTOS.h"

My platform.txt:

name=VintLabs ESP32 Boards
version=1.0.0

compiler.warning_flags=-w
compiler.warning_flags.none=-w
compiler.warning_flags.default=
compiler.warning_flags.more=-Wall
compiler.warning_flags.all=-Wall -Wextra

Relevant part of boards.txt:

vintlabs-pwm-v1.build.mcu=esp32
vintlabs-pwm-v1.build.core=esp32:esp32
vintlabs-pwm-v1.build.variant=esp32:esp32
vintlabs-pwm-v1.build.board=ESP32_DEV

Really hoping someone can shed some light on this and help point me in the right direction!

The full files are available at https://github.com/vintlabs/ESP32-Zip/raw/master/vintlabs-esp32-v1.0.1.tar.bz2 and https://github.com/vintlabs/ESP32-Zip/raw/master/package_vintlabs_index.json

this applies for the esp32 package too

Great info - thanks! This makes perfect sense now. Now to figure out how to get around it :wink:

Cheers
Paul