VS Code Path Problem

lukehoersten
Posts: 6
Joined: Mon Mar 08, 2021 1:32 am

VS Code Path Problem

Postby lukehoersten » Mon Mar 08, 2021 1:38 am

I've had this working with the normal CLI install.sh and export.sh scripts and now am trying to get it working with VS Code with no luck. The following are my settings and the resulting CMake error output.

settings.json

Code: Select all

{
  "C_Cpp.clang_format_style": "Visual Studio",
  "editor.formatOnSave": true,
  "[cpp]": {
    "editor.quickSuggestions": true
  },
  "[c]": {
    "editor.quickSuggestions": true
  },
  "C_Cpp.intelliSenseEngine": "Tag Parser",
  "files.associations": {
    "stdio.h": "c"
  },
  "idf.espIdfPath": "/Users/luke/Dev/code/esp32/esp-idf",
  "idf.customExtraPaths": "/Users/luke/Dev/code/esp32/esp-idf/components/esptool_py/esptool:/Users/luke/Dev/code/esp32/esp-idf/components/espcoredump:/Users/luke/Dev/code/esp32/esp-idf/components/partition_table:/Users/luke/Dev/code/esp32/esp-idf/components/app_update:/Users/luke/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin:/Users/luke/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin:/Users/luke/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/Users/luke/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/Users/luke/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin:/Users/luke/.espressif/python_env/idf4.2_py3.9_env/bin:/Users/luke/Dev/code/esp32/esp-idf/tools:/usr/local/sbin:/usr/local/opt/python@3.9/libexec/bin:/Users/luke/Library/Python/3.9/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
  "idf.pythonBinPath": "/Users/luke/.espressif/python_env/idf4.2_py3.9_env/bin/python",
  "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"/Users/luke/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/share/openocd/scripts\"}",
  "idf.openOcdConfigs": [
    "interface/ftdi/esp32_devkitj_v1.cfg",
    "board/esp32-wrover.cfg"
  ],
  "idf.adapterTargetName": "esp32",
  "idf.port": "/dev/cu.usbserial-31301",
  "git.ignoreLimitWarning": true
}
Build error output

Code: Select all

[main] Building folder: esp-homekit-door 
[main] Configuring folder: esp-homekit-door 
[proc] Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -H/Users/luke/Dev/code/esp32/projects/esp-homekit-door -B/Users/luke/Dev/code/esp32/projects/esp-homekit-door/build -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Found Git: /usr/local/bin/git (found version "2.30.1") 
[cmake] -- Unexpected file in components directory: /Users/luke/Dev/code/esp32/esp-idf/components/.DS_Store
[cmake] -- IDF_TARGET not set, using default target: esp32
[cmake] -- The C compiler identification is unknown
[cmake] -- The CXX compiler identification is unknown
[cmake] -- The ASM compiler identification is unknown
[cmake] -- Found assembler: xtensa-esp32-elf-gcc
[cmake] CMake Error at /Users/luke/Dev/code/esp32/esp-idf/tools/cmake/project.cmake:307 (__project):
[cmake]   The CMAKE_C_COMPILER:
[cmake] 
[cmake]     xtensa-esp32-elf-gcc
[cmake] 
[cmake]   is not a full path and was not found in the PATH.
[cmake] 
[cmake]   Tell CMake where to find the compiler by setting either the environment
[cmake]   variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
[cmake]   the compiler, or to the compiler name if it is in the PATH.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:12 (project)
[cmake] 
[cmake] 
[cmake] CMake Error at /Users/luke/Dev/code/esp32/esp-idf/tools/cmake/project.cmake:307 (__project):
[cmake]   The CMAKE_CXX_COMPILER:
[cmake] 
[cmake]     xtensa-esp32-elf-g++
[cmake] 
[cmake]   is not a full path and was not found in the PATH.
[cmake] 
[cmake]   Tell CMake where to find the compiler by setting either the environment
[cmake]   variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
[cmake]   to the compiler, or to the compiler name if it is in the PATH.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:12 (project)
[cmake] 
[cmake] 
[cmake] CMake Error at /Users/luke/Dev/code/esp32/esp-idf/tools/cmake/project.cmake:307 (__project):
[cmake]   The CMAKE_ASM_COMPILER:
[cmake] 
[cmake]     xtensa-esp32-elf-gcc
[cmake] 
[cmake]   is not a full path and was not found in the PATH.
[cmake] 
[cmake]   Tell CMake where to find the compiler by setting either the environment
[cmake]   variable "ASM" or the CMake cache entry CMAKE_ASM_COMPILER to the full path
[cmake]   to the compiler, or to the compiler name if it is in the PATH.
[cmake] Call Stack (most recent call first):
[cmake]   CMakeLists.txt:12 (project)
[cmake] 
[cmake] 
[cmake] -- Warning: Did not find file Compiler/-ASM
[cmake] -- Configuring incomplete, errors occurred!
[cmake] See also "/Users/luke/Dev/code/esp32/projects/esp-homekit-door/build/CMakeFiles/CMakeOutput.log".
[cmake] See also "/Users/luke/Dev/code/esp32/projects/esp-homekit-door/build/CMakeFiles/CMakeError.log".

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: VS Code Path Problem

Postby ESP_bignacio » Mon Mar 08, 2021 6:59 am

How are you building ?

Are you using the extension commands to build ? Press menu View -> Command Palette -> type ESP-IDF: Build your project

Please review Vscode extension commands

lukehoersten
Posts: 6
Joined: Mon Mar 08, 2021 1:32 am

Re: VS Code Path Problem

Postby lukehoersten » Mon Mar 08, 2021 1:30 pm

The extension's build was broken for me until I followed the fix here:
https://github.com/espressif/vscode-esp ... issues/339

Now I'm still not able to get the esp-homekit-sdk linked but the build process actually finds the compilers and works.

Should this not be enough?:

Makefile

Code: Select all

HOMEKIT_PATH ?= $(abspath $(IDF_PATH)/../../esp-homekit-sdk)
COMMON_COMPONENT_PATH ?= $(HOMEKIT_PATH)/examples/common

PROJECT_NAME := esp-homekit-door
EXTRA_COMPONENT_DIRS += $(HOMEKIT_PATH)/components
EXTRA_COMPONENT_DIRS += $(HOMEKIT_PATH)/components/homekit
EXTRA_COMPONENT_DIRS += $(COMMON_COMPONENT_PATH)

include $(IDF_PATH)/make/project.mk
CMakeLists.txt

Code: Select all

cmake_minimum_required(VERSION 3.5)

if(DEFINED ENV{HOMEKIT_PATH})
  set(HOMEKIT_PATH $ENV{HOMEKIT_PATH})
else()
  set(HOMEKIT_PATH ${CMAKE_CURRENT_LIST_DIR}/../..)
endif(DEFINED ENV{HOMEKIT_PATH})

set(EXTRA_COMPONENT_DIRS ${HOMEKIT_PATH}/components ${HOMEKIT_PATH}/components/homekit ${CMAKE_CURRENT_LIST_DIR}/../common)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(esp-homekit-door)

ESP_bignacio
Posts: 229
Joined: Wed May 02, 2018 12:12 pm

Re: VS Code Path Problem

Postby ESP_bignacio » Mon Mar 08, 2021 2:17 pm

Hi @ lukehoersten sorry about the build issue.

With regards to your problem, means you can't add the HomeKit_path to your build ? Where are you defining the HOMEKIT_PATH variable ? is it a global system environment variable or extension specific env variable ?

Is there any error in the build output ?

lukehoersten
Posts: 6
Joined: Mon Mar 08, 2021 1:32 am

Re: VS Code Path Problem

Postby lukehoersten » Mon Mar 08, 2021 2:30 pm

It's defined in the Makefile:

Code: Select all

HOMEKIT_PATH ?= $(abspath $(IDF_PATH)/../esp-homekit-sdk)

lukehoersten
Posts: 6
Joined: Mon Mar 08, 2021 1:32 am

Re: VS Code Path Problem

Postby lukehoersten » Mon Mar 08, 2021 11:33 pm

Got it working. Once I fixed the ESP specific build, I had to regenerate my CMAKE from my Makefile now it all works. Thanks for you help!

Yomiquesh
Posts: 1
Joined: Thu Apr 08, 2021 5:37 pm

Re: VS Code Path Problem

Postby Yomiquesh » Thu Apr 08, 2021 5:43 pm

lukehoersten wrote:
Mon Mar 08, 2021 11:33 pm
Got it working. Once I fixed the ESP specific build, I had to regenerate my CMAKE from my Makefile now it all works. Thanks for you help!
How did you solved the problem, can you be more especific?
I have a similar problem.
Image
Thanks.
Attachments
114069527-619f8b80-989f-11eb-8ce3-e470c83658b4.png
114069527-619f8b80-989f-11eb-8ce3-e470c83658b4.png (64.95 KiB) Viewed 11799 times

Who is online

Users browsing this forum: No registered users and 45 guests