Page 1 of 1

ESP ADF and IDF in one Project

Posted: Mon Apr 03, 2023 1:30 pm
by EasySuccess
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

Re: ESP ADF and IDF in one Project

Posted: Mon Aug 07, 2023 2:34 pm
by weitzj
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)
```

Re: ESP ADF and IDF in one Project

Posted: Fri Aug 11, 2023 2:01 am
by tempo.tian
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.