ESP ADF and IDF in one Project

EasySuccess
Posts: 5
Joined: Fri Sep 10, 2021 7:10 am

ESP ADF and IDF in one Project

Postby EasySuccess » Mon Apr 03, 2023 1:30 pm

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

weitzj
Posts: 2
Joined: Thu Nov 03, 2022 7:55 pm

Re: ESP ADF and IDF in one Project

Postby weitzj » Mon Aug 07, 2023 2:34 pm

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)
```

tempo.tian
Posts: 39
Joined: Wed Jun 22, 2022 12:10 pm

Re: ESP ADF and IDF in one Project

Postby tempo.tian » Fri Aug 11, 2023 2:01 am

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.

Who is online

Users browsing this forum: No registered users and 59 guests