VSC installation BUG

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

VSC installation BUG

Postby Baldhead » Mon Dec 05, 2022 11:05 pm

Hi,

it's the end of 2022 and the visual studio code extension still doesn't work at first try(at least not on windows).
This is a pain in the ass for the developer.

I had to manually add the environment variables AGAIN and AGAIN and AGAIN in each new esp-idf installation, and it's still not working.

The project compiles with previous versions of cmake, now errors appear:
Component directory C:/projects/project_folder/components/communication does not contain a CMakeLists.txt file. No component will be added.
Component directory C:/projects/project_folder/components/ui does not contain a CMakeLists.txt file. No component will be added.

In Root project folder(C:/projects/project_folder/CMakeLists.txt) i have a CMakeLists.txt with:

Code: Select all

# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

set(EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/components/ui" "${CMAKE_SOURCE_DIR}/components/communication") 
#  ${CMAKE_SOURCE_DIR} -> project root folder.						 

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(project_name)


My folder organization(before the new installation it compiled normally):

Code: Select all

.project-folder
ª   CMakeLists.txt
ª   partitions.csv
ª   README.md
ª   sdkconfig
ª   sdkconfig.old
ª       
+---components
ª   +---communication
ª   ª   +---my_wifi
ª   ª   ª   ª   CMakeLists.txt
ª   ª   ª   ª   
ª   ª   ª   +---src
ª   ª   ª       ª   my_wifi.c
ª   ª   ª       ª   
ª   ª   ª       +---include
ª   ª   ª               my_wifi.h
ª   ª   ª               
ª   ª   +---my_server
ª   ª       ª   CMakeLists.txt
ª   ª       ª   
ª   ª       +---certs
ª   ª       ª       prvtkey.pem
ª   ª       ª       servercert.pem
ª   ª       ª       
ª   ª       +---src
ª   ª           ª   my_server.c
ª   ª           ª   
ª   ª           +---include
ª   ª                   my_server.h
ª   ª                   
ª   +---ui
ª       +---drv
ª       ª   ª   CMakeLists.txt
ª       ª   ª   
ª       ª   +---src
ª       ª       ª   my_drive.c
ª       ª       ª   
ª       ª       +---include
ª       ª               my_drive.h

NOTE:
Edition: Windows 11 Enterprise
Version: 21H2
OS Compilation: 22000.1219

esp-idf version: v5.0


Thank's for the help.

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

Re: VSC installation BUG

Postby Baldhead » Tue Dec 06, 2022 7:40 pm

I run "idf.py add-dependency espressif/mdns==1.0.3" in my project folder and, after compilation, appeared a lot of esp_log.h format errors.

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

Re: VSC installation BUG

Postby Baldhead » Wed Dec 07, 2022 5:34 am

Some suggestion on this "cmake error" please.

boarchuz
Posts: 604
Joined: Tue Aug 21, 2018 5:28 am

Re: VSC installation BUG

Postby boarchuz » Wed Dec 07, 2022 11:19 am

Baldhead wrote:
Mon Dec 05, 2022 11:05 pm
Component directory C:/projects/project_folder/components/communication does not contain a CMakeLists.txt file. No component will be added.
Component directory C:/projects/project_folder/components/ui does not contain a CMakeLists.txt file. No component will be added.
This error does look correct, in fairness. I'm surprised it was working before. Maybe the previous version searched EXTRA_COMPONENT_DIRS recursively?

You'll need to add each extra component within 'communication' and 'ui' individually.
Baldhead wrote: I run "idf.py add-dependency espressif/mdns==1.0.3" in my project folder and, after compilation, appeared a lot of esp_log.h format errors.
Is it related to this (from 5.0 release notes):
Format string warnings (-Wformat) are now enabled for Xtensa and RISC-V targets. This will result in warnings whenever uint32_t values are formatted using %u or %d format specifiers. The reason is that int32_t type is defined as long which was int in a past. The same is for uint32_t. To fix the warnings, do either one of the following: 1) Use PRIx32 specifier from inttypes.h instead of d or u. 2) Cast the values being formatted to unsigned int. 3) (Not recommended) add -Wno-format compiler flag to the files where this warning occurs using set_source_files_properties CMake function.

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

Re: VSC installation BUG

Postby Baldhead » Wed Dec 07, 2022 1:49 pm

boarchuz wrote:
Wed Dec 07, 2022 11:19 am
Baldhead wrote:
Mon Dec 05, 2022 11:05 pm
Component directory C:/projects/project_folder/components/communication does not contain a CMakeLists.txt file. No component will be added.
Component directory C:/projects/project_folder/components/ui does not contain a CMakeLists.txt file. No component will be added.
This error does look correct, in fairness. I'm surprised it was working before. Maybe the previous version searched EXTRA_COMPONENT_DIRS recursively?

You'll need to add each extra component within 'communication' and 'ui' individually.
A: I do this and not worked.
how exactly am i supposed to do this?
Baldhead wrote: I run "idf.py add-dependency espressif/mdns==1.0.3" in my project folder and, after compilation, appeared a lot of esp_log.h format errors.
Is it related to this (from 5.0 release notes):
Format string warnings (-Wformat) are now enabled for Xtensa and RISC-V targets. This will result in warnings whenever uint32_t values are formatted using %u or %d format specifiers. The reason is that int32_t type is defined as long which was int in a past. The same is for uint32_t. To fix the warnings, do either one of the following: 1) Use PRIx32 specifier from inttypes.h instead of d or u. 2) Cast the values being formatted to unsigned int. 3) (Not recommended) add -Wno-format compiler flag to the files where this warning occurs using set_source_files_properties CMake function.
A: i think this problem is from mdns library, so it makes no sense for me to have to change the entire mdns library(esp-idf library or third party library).
Thanks for the suggestions @boarchuz.

boarchuz
Posts: 604
Joined: Tue Aug 21, 2018 5:28 am

Re: VSC installation BUG

Postby boarchuz » Wed Dec 07, 2022 3:41 pm

Baldhead wrote:
Wed Dec 07, 2022 1:49 pm
A: I do this and not worked.
how exactly am i supposed to do this?

Code: Select all

set(EXTRA_COMPONENT_DIRS
    "${CMAKE_SOURCE_DIR}/components/ui/drv"
    "${CMAKE_SOURCE_DIR}/components/communication/my_wifi"
    "${CMAKE_SOURCE_DIR}/components/communication/my_server"
)
Remember to do a fullclean. I might be off the mark if that doesn't work, hopefully someone else can see what's wrong. Your updated CMakeLists.txt and build log would be helpful.
Baldhead wrote: A: i think this problem is from mdns library, so it makes no sense for me to have to change the entire mdns library(esp-idf library or third party library).
5.0 was only released a few days ago, give them some time.

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

Re: VSC installation BUG

Postby Baldhead » Wed Dec 07, 2022 7:35 pm

Hi,

The mdns dependency is to stay in the main is correct ?
I am using mdns in another file inside components folder: "C:\esp32-Proj\WSS_SERVER_AND_UI_INTEGRATION_S3_16-05-2022\components\communication\my_wss_server".

PS C:\esp32-Proj\WSS_SERVER_AND_UI_INTEGRATION_S3_16-05-2022> idf.py add-dependency espressif/mdns==1.0.3
Executing action: add-dependency
Created "c:\esp32-proj\wss_server_and_ui_integration_s3_16-05-2022\main\idf_component.yml"
Successfully added dependency "espressif/mdns==1.0.3" for component "main"
Done

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

Re: VSC installation BUG

Postby Baldhead » Wed Dec 07, 2022 7:53 pm

boarchuz wrote:
Wed Dec 07, 2022 3:41 pm
Baldhead wrote:
Wed Dec 07, 2022 1:49 pm
A: I do this and not worked.
how exactly am i supposed to do this?

Code: Select all

set(EXTRA_COMPONENT_DIRS
    "${CMAKE_SOURCE_DIR}/components/ui/drv"
    "${CMAKE_SOURCE_DIR}/components/communication/my_wifi"
    "${CMAKE_SOURCE_DIR}/components/communication/my_server"
)
Remember to do a fullclean. I might be off the mark if that doesn't work, hopefully someone else can see what's wrong. Your updated CMakeLists.txt and build log would be helpful.
Baldhead wrote: A: i think this problem is from mdns library, so it makes no sense for me to have to change the entire mdns library(esp-idf library or third party library).
5.0 was only released a few days ago, give them some time.
Hi @boarchuz,

I did this and yet not worked.

Root CMakeLists.txt

Code: Select all

# The following lines of boilerplate have to be in your project's CMakeLists
# in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

# (Not part of the boilerplate)
# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
#set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common)


#set(EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/components/ui" "${CMAKE_SOURCE_DIR}/components/ui/global_conf" "${CMAKE_SOURCE_DIR}/components/communication")   # add components "drv" "lvgl" and "global_conf". "global_conf" folder contain only *.h global files. 
#  ${CMAKE_SOURCE_DIR} -> project root folder.						 
  
set(EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/components/ui/drv" "${CMAKE_SOURCE_DIR}/components/ui/global_conf" "${CMAKE_SOURCE_DIR}/components/ui/lvgl" "${CMAKE_SOURCE_DIR}/components/ui/ui_images" "${CMAKE_SOURCE_DIR}/components/communication/my_wifi" "${CMAKE_SOURCE_DIR}/components/communication/my_wss_server")

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(wss_server)
In annex is a compilation_log.
Attachments
compilation_log.txt
(528.88 KiB) Downloaded 339 times

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: VSC installation BUG

Postby chegewara » Wed Dec 07, 2022 10:50 pm

Now it seems you have all CMakeLists configured, but there is different king of error. Its really easy to used CTRL + F to find "error" keyword.
C:/esp-idf/components/log/include/esp_log.h:265:27: error: format '%d' expects argument of type 'int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
Here is clue/answer:
boarchuz wrote: Is it related to this (from 5.0 release notes):
Format string warnings (-Wformat) are now enabled for Xtensa and RISC-V targets. This will result in warnings whenever uint32_t values are formatted using %u or %d format specifiers. The reason is that int32_t type is defined as long which was int in a past. The same is for uint32_t. To fix the warnings, do either one of the following: 1) Use PRIx32 specifier from inttypes.h instead of d or u. 2) Cast the values being formatted to unsigned int. 3) (Not recommended) add -Wno-format compiler flag to the files where this warning occurs using set_source_files_properties CMake function.
And more about it:
https://github.com/espressif/esp-idf/issues/9511

Baldhead
Posts: 465
Joined: Sun Mar 31, 2019 5:16 am

Re: VSC installation BUG

Postby Baldhead » Thu Dec 08, 2022 1:26 am

chegewara wrote:
Wed Dec 07, 2022 10:50 pm
Now it seems you have all CMakeLists configured, but there is different king of error. Its really easy to used CTRL + F to find "error" keyword.
C:/esp-idf/components/log/include/esp_log.h:265:27: error: format '%d' expects argument of type 'int', but argument 7 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
Here is clue/answer:
boarchuz wrote: Is it related to this (from 5.0 release notes):
Format string warnings (-Wformat) are now enabled for Xtensa and RISC-V targets. This will result in warnings whenever uint32_t values are formatted using %u or %d format specifiers. The reason is that int32_t type is defined as long which was int in a past. The same is for uint32_t. To fix the warnings, do either one of the following: 1) Use PRIx32 specifier from inttypes.h instead of d or u. 2) Cast the values being formatted to unsigned int. 3) (Not recommended) add -Wno-format compiler flag to the files where this warning occurs using set_source_files_properties CMake function.
And more about it:
https://github.com/espressif/esp-idf/issues/9511
Hi @chegewara,

Sorry, but you dont read the full post.

See the attached log.
My components were not included in the compilation, even changing how @boarchuz said(see in the first lines of attached log file).
In all previous esp-idf versions, that i used, the components compiled correctly.

And, the lib mdns is not my lib.
The mdns lib is third party or espressif fork.
is no sense i change this lib.
And esp_log is espressif lib, but i think that compiler show this esp_log errors because mdns lib needs to be fixed.

"Its really easy to used CTRL + F to find "error" keyword."
I always do this.

Who is online

Users browsing this forum: No registered users and 38 guests