Hello,
just a short Question: From my understanding the ADF extends the IDF. Is there a "best practise" to use the IDF and the ADF inside the same Project?
Or is it just: Install both, update all paths and include the required Files and start Coding?
Best regards
ESP ADF and IDF in one Project
Re: ESP ADF and IDF in one Project
I use git submodules:
I create my project like so:
# create project
mkdir myproject
cd myproject
git init .
touch .gitignore
git add .gitignore
git commit -m "initial commit"
# now add esp-adf as a submodule
# esp-adf has esp-idf as a submodule
git submodule add https://github.com/espressif/esp-adf.git esp-adf
cd esp-adf
# get the latest tag
git checkout v2.5
cd ../
# fetch the pinned esp-idf inside esp-adf
git submodule update --init --recursive
Then edit your CakeLists.txt:
vi myproject/CMakeLists.txt
```
cmake_minimum_required(VERSION 3.16)
if(DEFINED ENV{IDF_PATH})
set(IDF_PATH $ENV{IDF_PATH})
else()
set(IDF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf/esp-idf)
endif(DEFINED ENV{IDF_PATH})
if(DEFINED ENV{ADF_PATH})
set(ADF_PATH $ENV{ADF_PATH})
else()
set(ADF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf)
endif(DEFINED ENV{ADF_PATH})
set(EXTRA_COMPONENT_DIRS
${IDF_PATH}/components
${ADF_PATH}/components)
set(PROJECT_VER "1.0")
include(${ADF_PATH}/CMakeLists.txt)
include(${IDF_PATH}/tools/cmake/project.cmake)
project(myproject)
```I use git submodules:
I create my project like so:
# create project
mkdir myproject
cd myproject
git init .
touch .gitignore
git add .gitignore
git commit -m "initial commit"
# now add esp-adf as a submodule
# esp-adf has esp-idf as a submodule
git submodule add https://github.com/espressif/esp-adf.git esp-adf
cd esp-adf
# get the latest tag
git checkout v2.5
cd ../
# fetch the pinned esp-idf inside esp-adf
git submodule update --init --recursive
Then edit your CakeLists.txt:
vi myproject/CMakeLists.txt
```
cmake_minimum_required(VERSION 3.16)
if(DEFINED ENV{IDF_PATH})
set(IDF_PATH $ENV{IDF_PATH})
else()
set(IDF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf/esp-idf)
endif(DEFINED ENV{IDF_PATH})
if(DEFINED ENV{ADF_PATH})
set(ADF_PATH $ENV{ADF_PATH})
else()
set(ADF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf)
endif(DEFINED ENV{ADF_PATH})
set(EXTRA_COMPONENT_DIRS
${IDF_PATH}/components
${ADF_PATH}/components)
set(PROJECT_VER "1.0")
include(${ADF_PATH}/CMakeLists.txt)
include(${IDF_PATH}/tools/cmake/project.cmake)
project(myproject)
```
I create my project like so:
# create project
mkdir myproject
cd myproject
git init .
touch .gitignore
git add .gitignore
git commit -m "initial commit"
# now add esp-adf as a submodule
# esp-adf has esp-idf as a submodule
git submodule add https://github.com/espressif/esp-adf.git esp-adf
cd esp-adf
# get the latest tag
git checkout v2.5
cd ../
# fetch the pinned esp-idf inside esp-adf
git submodule update --init --recursive
Then edit your CakeLists.txt:
vi myproject/CMakeLists.txt
```
cmake_minimum_required(VERSION 3.16)
if(DEFINED ENV{IDF_PATH})
set(IDF_PATH $ENV{IDF_PATH})
else()
set(IDF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf/esp-idf)
endif(DEFINED ENV{IDF_PATH})
if(DEFINED ENV{ADF_PATH})
set(ADF_PATH $ENV{ADF_PATH})
else()
set(ADF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf)
endif(DEFINED ENV{ADF_PATH})
set(EXTRA_COMPONENT_DIRS
${IDF_PATH}/components
${ADF_PATH}/components)
set(PROJECT_VER "1.0")
include(${ADF_PATH}/CMakeLists.txt)
include(${IDF_PATH}/tools/cmake/project.cmake)
project(myproject)
```I use git submodules:
I create my project like so:
# create project
mkdir myproject
cd myproject
git init .
touch .gitignore
git add .gitignore
git commit -m "initial commit"
# now add esp-adf as a submodule
# esp-adf has esp-idf as a submodule
git submodule add https://github.com/espressif/esp-adf.git esp-adf
cd esp-adf
# get the latest tag
git checkout v2.5
cd ../
# fetch the pinned esp-idf inside esp-adf
git submodule update --init --recursive
Then edit your CakeLists.txt:
vi myproject/CMakeLists.txt
```
cmake_minimum_required(VERSION 3.16)
if(DEFINED ENV{IDF_PATH})
set(IDF_PATH $ENV{IDF_PATH})
else()
set(IDF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf/esp-idf)
endif(DEFINED ENV{IDF_PATH})
if(DEFINED ENV{ADF_PATH})
set(ADF_PATH $ENV{ADF_PATH})
else()
set(ADF_PATH ${CMAKE_CURRENT_LIST_DIR}/esp-adf)
endif(DEFINED ENV{ADF_PATH})
set(EXTRA_COMPONENT_DIRS
${IDF_PATH}/components
${ADF_PATH}/components)
set(PROJECT_VER "1.0")
include(${ADF_PATH}/CMakeLists.txt)
include(${IDF_PATH}/tools/cmake/project.cmake)
project(myproject)
```
-
- Posts: 40
- Joined: Wed Jun 22, 2022 12:10 pm
Re: ESP ADF and IDF in one Project
If you already have a used IDF version which is compatiable with current ADF(4.4-5.1).
You do not need to use the IDF project in ADF submodules, you can use the IDF you already has, it also works well.
You do not need to use the IDF project in ADF submodules, you can use the IDF you already has, it also works well.
Who is online
Users browsing this forum: No registered users and 36 guests