Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

ESP-IDF release v4.2 upgrade and support for ESP32-S2 #2285

Closed

Conversation

shubhamkulkarni97
Copy link
Contributor

Description

  • Update ESP-IDF submodule to release/v4.2.
  • Changes in Amazon FreeRTOS port for compatibility with ESP-IDF v4.2.
  • Move port files and extra components to a common directory shared by all boards.
  • Add support for ESP32-S2 in Amazon FreeRTOS.

Note: ESP-IDF v4.2 release requires updated toolchain (xtensa-esp32-elf-gcc 8.2.0) and is not compatible with older toolchain used in Amazon FreeRTOS(xtensa-esp32-elf-gcc 5.2.0).

Steps to update the toolchain:
1. Navigate to esp-idf directory (cd ./vendors/espressif/esp-idf)
2. Run install.sh script which installs required tools (./install.sh)
3. Run export.sh to add required tools to environment PATH (. ./export.sh)

To verify toolchain version, please run xtensa-esp32-elf-gcc --version.
Output should look like:

xtensa-esp32-elf-gcc (crosstool-NG esp-2020r2) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Command to build application for ESP32-S2:
cmake -DVENDOR=espressif -DBOARD=esp32s2_saola_1 -DCOMPILER=xtensa-esp32s2 -S . -B build -GNinja

Checklist:

  • I have tested my changes. No regression in existing tests.
  • My code is Linted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@lundinc2
Copy link
Contributor

Hello Shubham,

Please let me know if I can assist you in getting this merged.

Thanks,

Carl

@shubhamkulkarni97
Copy link
Contributor Author

Hi @lundinc2,

Can you please help resolve build failures with this PR?
To fix these issues, environment needs to be upgraded according to the steps mentioned in description.

Thanks
Shubham

@lundinc2 lundinc2 marked this pull request as ready for review July 28, 2020 20:13
@lundinc2
Copy link
Contributor

Hello @shubhamkulkarni97,

Sorry for the delay. I have begun preparations for updating our environment.

Could you separate this PR into two different ones? One for the IDF change and one for the new board? I'll make sure to cherry-pick the kernel changes into our kernel convergence branch.

Thanks,

Carl

@shubhamkulkarni97
Copy link
Contributor Author

shubhamkulkarni97 commented Jul 29, 2020

Hi @lundinc2,

ESP32-S2 support is based on IDF v4.2 release.
I think we should keep same PR for ESP32-S2 support as well because it dependency on other commits in this PR.

Thanks,
Shubham

@shubhamkulkarni97
Copy link
Contributor Author

Hi @lundinc2,

Can you please help with review and merge for this PR?

Thanks,
Shubham

@lundinc2
Copy link
Contributor

Hi @shubhamkulkarni97,

This is ready, I am still waiting on a decision regarding the new board. Sorry for the delay.

@yourslab
Copy link
Contributor

Hello,

Please resolve the merge conflicts in this PR.

@shubhamkulkarni97 shubhamkulkarni97 force-pushed the feature/idf_uplevel_v4.2 branch from e3da164 to 5697615 Compare August 12, 2020 15:14
@shubhamkulkarni97
Copy link
Contributor Author

@yourslab Have resolved merge conflicts and rebased branch to latest master.

@lundinc2
Copy link
Contributor

@shubhamkulkarni97 we will host this as a feature branch for now, while the v4.2 beta is ongoing.

I created a feature branch based of this PR here: https://github.com/aws/amazon-freertos/tree/feature/idf_uplevel_v4.2.

Please let me know if you have any questions / feedback. If not I'll close this this PR for now.

@shubhamkulkarni97
Copy link
Contributor Author

Hi @lundinc2, our intention was of merging these changes to master branch. We have run entire qualification tests for both the boards with IDT v3.0 and no failures were observed.

  • If we maintain this as a feature branch, we'll have to rebase this branch and might also have to re-run entire qualification tests.

  • Regarding IDF v4.2, it is already forked as a release branch and available on GitHub. This branch also passes our internal QA and no major changes will be added. Once beta tag is available we can go forward.

I'm also attaching DQP results for both the boards.

Note: For sanity we have also run DQP for ESP32-S2 with IDT v3.1 (latest version).
There are two failing test cases in WiFi test suite and one failing test case in OTA test suite, but these failures are observed on master branch as well (failures are not related to this change).

ESP32_DQP.zip
ESP32_S2_DQP.zip

There is one test failure in both the results due to network issue.

It would be great if we can merge this PR.

Please let me know your views on this.

Thanks,
Shubham

@lundinc2 lundinc2 self-assigned this Aug 14, 2020
@bhusang
Copy link

bhusang commented Aug 18, 2020

@shubhamkulkarni97 (sorry for the long message and apologies if this is not the correct place to raise this issue)

While I would really appreciate this pull request being merged to fully support the ESP32S2, I seem to have a problem with building against this particular branch. Here's what I did:

  1. Start with amazon-freertos-examples (https://github.com/tgsong/amazon-freertos-examples) - just so that I can have freertos as a library but this step is optional
  2. Update to the latest release for freertos (which references 202007 in the freertos component) and then checkout the freertos branch feature/idf_uplevel_v4.2
    $ git status [18:16:17]
    On branch feature/idf_uplevel_v4.2
    Your branch is up to date with 'origin/feature/idf_uplevel_v4.2'.
  3. Ensure that the esp-idf is correct using the instructions in the README.md
    1. Navigate to esp-idf directory (cd ./vendors/espressif/esp-idf)
    2. Run install.sh script which installs required tools (./install.sh)
      ** there is an error in the script because the origin repo does not have any tags set for the 4.2 release.

git remote -v [18:24:54]
origin https://github.com/espressif/esp-afr-sdk.git (fetch)
origin https://github.com/espressif/esp-afr-sdk.git (push)
git status [18:24:57]
HEAD detached at 6ca07b6c1
nothing to commit, working tree clean
./install.sh [18:25:30]
Installing ESP-IDF tools
Installing tools: xtensa-esp32-elf, xtensa-esp32s2-elf, esp32ulp-elf, esp32s2ulp-elf, openocd-esp32
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Skipping [email protected] (already installed)
Installing Python environment and packages
fatal: No tags can describe '6ca07b6c101c870d634fa80df44ca714ac7ff098'.
Try --always, or create some tags.
WARNING: Git describe was unsuccessul: Command '['git', 'describe', '--tags']' returned non-zero exit status 128

Installing Python packages from /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/requirements.txt
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Ignoring None: markers 'sys_platform == "win32"' don't match your environment
Requirement already satisfied: .......<SKIPPED>
Requirement already satisfied: python-engineio>=3.13.0 in /Users/bgupta/.espressif/python_env/idf4.2_py2.7_env/lib/python2.7/site-packages (from python-socketio>=1.6.1->Flask-SocketIO<3.0,>=2.9->gdbgui>=0.13.2.0->-r /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/requirements.txt (line 14)) (3.13.1)
All done! You can now run:
. ./export.sh
3. Run export.sh
. ./export.sh [18:25:35]
Adding ESP-IDF tools to PATH...
fatal: No tags can describe '6ca07b6c101c870d634fa80df44ca714ac7ff098'.
Try --always, or create some tags.
WARNING: Git describe was unsuccessul: Command '['git', 'describe', '--tags']' returned non-zero exit status 128
Using Python interpreter in /Users/bgupta/.espressif/python_env/idf4.2_py2.7_env/bin/python
Checking if Python packages are up to date...
Python requirements from /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/requirements.txt are satisfied.
Updated PATH variable:
/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/esptool_py/esptool:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/espcoredump:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/partition_table:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/app_update:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/esptool_py/esptool:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/espcoredump:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/partition_table:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/app_update:/Users/bgupta/.espressif/python_env/idf4.2_py2.7_env/bin/python:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/tools:/Users/bgupta/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200420/openocd-esp32/bin:/Users/bgupta/.espressif/python_env/idf4.2_py2.7_env/bin:/Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/tools:/Users/bgupta/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin:/Users/bgupta/.espressif/tools/xtensa-esp32s2-elf/esp-2020r2-8.2.0/xtensa-esp32s2-elf/bin:/Users/bgupta/.espressif/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/Users/bgupta/.espressif/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/Users/bgupta/.espressif/tools/openocd-esp32/v0.10.0-esp32-20200709/openocd-esp32/bin:/Users/bgupta/.espressif/python_env/idf4.3_py2.7_env/bin:/Users/bgupta/src/leaksentinel/esp/esp-idf/tools:/usr/local/opt/openssl/bin:/Users/bgupta/src/flutter/bin:/usr/local/opt/qt/bin:/Users/bgupta/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/sbin
Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build
To verify toolchain version, please run xtensa-esp32-elf-gcc --version.
my output:
xtensa-esp32-elf-gcc --version [15:38:05]
xtensa-esp32-elf-gcc (crosstool-NG esp-2020r2) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Command to build application for ESP32-S2:
cmake -DVENDOR=espressif -DBOARD=esp32s2_saola_1 -DCOMPILER=xtensa-esp32s2 -S . -B build -GNinja
This command runs but errors with the following snippet:
-- Submodule update
-- Component directory /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/mbedtls does not contain a CMakeLists.txt file. No component will be added
-- Component directory /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/unity does not contain a CMakeLists.txt file. No component will be added
-- Checking Python dependencies...
Python requirements from /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/requirements.txt are satisfied.
Loading defaults file /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/build/sdkconfig.defaults...
/var/folders/nh/p3xs3b3j72d4c6w8wxqsvww00000gn/T/confgen_tmpOte3ay:1 line was updated to CONFIG_ESP_INT_WDT=n
/var/folders/nh/p3xs3b3j72d4c6w8wxqsvww00000gn/T/confgen_tmpOte3ay:2 line was updated to CONFIG_ESP_TASK_WDT=n
-- App "freertos_examples" version: 1
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.ld
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.libgcc.ld
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-data.ld
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.newlib-funcs.ld
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp_rom/esp32s2/ld/esp32s2.rom.spiflash.ld
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos-examples/build/esp-idf/esp32s2/esp32s2_out.ld
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp32s2/ld/esp32s2.project.ld.in
-- Adding linker script /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/components/esp32s2/ld/esp32s2.peripherals.ld
CMake Error at /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:468 (set_property):
set_property could not find TARGET aws_demos. Perhaps it has not yet been
created.
Call Stack (most recent call first):
freertos/vendors/espressif/boards/esp32s2/CMakeLists.txt:467 (idf_build_executable)
freertos/CMakeLists.txt:70 (include)
====================Configuration for FreeRTOS====================
Version: 202007.00
Git version: 201910.00-1145-g569761515
Target microcontroller:
vendor: Espressif
board: ESP32S2-Saola-1
description: Development board produced by Espressif that comes in two
variants either with ESP32-S2-WROOM or ESP32-S2-WROVER module
family: ESP32S2
data ram size: 320KB
program memory size: 4MB
Host platform:
OS: Darwin-19.6.0
Toolchain: xtensa-esp32
Toolchain path: /Users/bgupta/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.
0/xtensa-esp32-elf
CMake generator: Ninja
FreeRTOS modules:
Modules to build: common, crypto, defender, dev_mode_key_provisioning,
greengrass, https, kernel, mqtt, ota, pkcs11, pkcs11_
implementation, platform, secure_sockets, serializer, shadow,
tls, wifi
Enabled by user: defender, greengrass, https, mqtt, ota, pkcs11, pkcs11_
implementation, platform, secure_sockets, shadow, wifi
Enabled by dependency: common, crypto, demo_base, dev_mode_key_provisioning,
freertos, kernel, ota_http, ota_mqtt, pkcs11_mbedtls,
serializer, tls, utils
3rdparty dependencies: http_parser, jsmn, mbedtls, pkcs11, tinycbor
Available demos: demo_defender, demo_greengrass_connectivity, demo_https,
demo_mqtt, demo_ota, demo_shadow, demo_tcp
Available tests:
=========================================================================

@shubhamkulkarni97
Copy link
Contributor Author

Hi @bhusang,

All done! You can now run:
. ./export.sh

This print shows that install.sh is successful.

Done! You can now compile ESP-IDF projects.
Go to the project directory and run:
idf.py build

This print shows that export.sh is successful.

xtensa-esp32-elf-gcc (crosstool-NG esp-2020r2) 8.2.0

Xtensa toolchain version also seems correct.

Project configuration is also correct, can you try running following commands to run the application:

  • ./vendors/espressif/esp-idf/tools/idf.py build to build the application.
  • export ESPPORT=<serial-port-of-esp32>
  • ./vendors/espressif/esp-idf/tools/idf.py flash monitor to flash and display output on console.

Hope this helps.

Thanks,
Shubham

@bhusang
Copy link

bhusang commented Aug 18, 2020

@shubhamkulkarni97

Thanks for the feedback. I think that the open issues are as follows:

  1. The appropriate tag does not exist in the https://github.com/espressif/esp-afr-sdk.git repo for the 4.2 release. The only tags are related to the 3.3 release. You may think that the missing tag will not affect the script, but it would be good to fix this before the merge happens.

  2. The command that you list in the README:
    cmake -DVENDOR=espressif -DBOARD=esp32s2_saola_1 -DCOMPILER=xtensa-esp32s2 -S . -B build -GNinja
    does not work. It results in the issue of the aws_demos not being found:

CMake Error at /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:468 (set_property):
set_property could not find TARGET aws_demos. Perhaps it has not yet been
created.
Call Stack (most recent call first):
freertos/vendors/espressif/boards/esp32s2/CMakeLists.txt:467 (idf_build_executable)
freertos/CMakeLists.txt:70 (include)

Even if I use the command that you suggest:
./freertos/vendors/espressif/esp-idf/tools/idf.py build (from the root of amazon-freertos)
I get the following error:

CMake Error at /Users/bgupta/src/LeakSentinel/esp/compare/amazon-freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:468 (set_property):
set_property could not find TARGET aws_demos. Perhaps it has not yet been
created.
Call Stack (most recent call first):
freertos/vendors/espressif/boards/esp32s2/CMakeLists.txt:467 (idf_build_executable)
freertos/CMakeLists.txt:70 (include)

@bhusang
Copy link

bhusang commented Aug 18, 2020

@shubhamkulkarni97

Some more (hopefully helpful) feedback, the cmake file here:
freertos/vendors/espressif/boards/esp32s2/CMakeLists.txt

has the following section:
if(AFR_IS_TESTING)
set(exe_target aws_tests)
else()
set(exe_target aws_demos)
endif()

where exe_target is set to aws_demos. Line 467 of the same file calls idf_build_executable(${exe_target})

which requires aws_demos to be a valid target in vendors/espressif/esp-idf/tools/cmake/build.cmake but this is not the case.

Bottom line, as far as I can tell, I cannot build an executable using this branch. I am likely doing something wrong but I was able to build for the standard esp32 using this strategy before. All I did was to move to this branch and update the esp-idf version and corresponding tools appropriately.

@shubhamkulkarni97
Copy link
Contributor Author

@bhusang, We have pushed a tag, fetching the branch again should solve the issue.

In the logs provided above, there is issue with toolchain and toolchain path:

Toolchain: xtensa-esp32
Toolchain path: /Users/bgupta/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.
0/xtensa-esp32-elf

Here esp32-s2 specific toolchain should be used.

Can you try running xtensa-esp32s2-elf-gcc and check if toolchain is correctly added in PATH?

Also, can you verify cmake version?

@bhusang
Copy link

bhusang commented Aug 18, 2020

@shubhamkulkarni97

Ok, I started with a clean environment and carefully ran the commands (and logged the results in the attachment). The compilation still fails with the same error as above. In the attachment, I describe the steps including verifying tool versions. Please take a look as I would appreciate your feedback to solve the problem and allow me to compile successfully for the ESP32S2 target in the AFR repo.

typescript.txt

@YTvW
Copy link

YTvW commented Aug 19, 2020

I am encountering the same issue, using this branch compiling for esp32 is also failing on target aws_demo not found

@shubhamkulkarni97
Copy link
Contributor Author

shubhamkulkarni97 commented Aug 19, 2020

@bhusang @YTvW , I checked amazon-freertos-examples repository. Firstly, CMake APIs used in this repo are based on IDF v3.3 build system. Also, CMake command to generate build directory specified in this repo uses ESP32 specific toolchain. Due to this, amazon-freertos-examples will not work (on ESP32-S2 and ESP32 as well) for sure.

Can you try running aws_demos application in AFR?

I also think some commands are missing while setting up the environment. Can you follow steps mentioned below:

  • cd $AMAZON_FREERTOS_ROOT_DIR/vendors/espressif/esp-idf
  • ./install.sh
  • . ./export.sh
  • cd $AMAZON_FREERTOS_ROOT_DIR
  • unset IDF_PATH
  • export ESPPORT=<esp32_serial_port>
  • rm -rf build (Remove previous build directory if exists)
  • cmake -DVENDOR=espressif -DBOARD=esp32s2_saola_1 -DCOMPILER=xtensa-esp32s2 -S . -B build -GNinja
  • ./vendors/espressif/esp-idf/tools/idf.py build flash monitor

Note: Environment set up using . ./export.sh will work only in same terminal window.

Thanks,
Shubham

@bhusang
Copy link

bhusang commented Aug 19, 2020

Hi @shubhamkulkarni97,

You instructions worked well when building in the amazon-freertos dir. So thank you for the instructions. Now on to the getting the amazon-freertos-examples repo to work for the ESP32S2. Thanks.

@Rjblaauboer
Copy link

HI @shubhamkulkarni97,

Thanks for putting this PR up, it's very helpful. While I've succeeded in building the amazon freertos ESP32 demo projects with ESP-IDF v4.2, it doesn't work as well when using amazon-freertos as a library in another project.
(as explained here https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html under "Using FreeRTOS in your own CMake project for ESP32")

I've created a simple repo to demonstrate the issue here. The error message is as follows:
CMake Error at freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:468 (set_property): set_property could not find TARGET aws_demos. Perhaps it has not yet been created. Call Stack (most recent call first): freertos/vendors/espressif/boards/esp32/CMakeLists.txt:540 (idf_build_executable) freertos/CMakeLists.txt:70 (include)

I'm not yet sure what's causing the issue but it would be great if we get closer to fixing this as I'd really like to use the latest IDF version with the amazon freertos. Thanks.

@bhusang
Copy link

bhusang commented Aug 24, 2020

@shubhamkulkarni97

Ok, @tgsong has given some feedback that the issue might very well be in the CMakeLists.txt that you have in the esp32s2 directory. Please take a careful look at this comment: tgsong/amazon-freertos-examples#6 (comment)

Could we modify vendors/espressif/boards/esp32s2/CMakeLists.txt like this?

# If external project is set do not link IDF components to aws target
if (IDF_PROJECT_EXECUTABLE)
    set(exe_target ${IDF_PROJECT_EXECUTABLE})
else()
     if(AFR_IS_TESTING)
         set(exe_target aws_tests)
     else()
         set(exe_target aws_demos)
     endif()
endif()

I agree with @Rjblaauboer that the instructions (https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html) "Using FreeRTOS in your own CMake project for ESP32" need to be also correct for the esp32s2 branch to be useful.

I think that the issue is back to you to take a good look at.

@Rjblaauboer
Copy link

@bhusang @shubhamkulkarni97
Thanks for that tip. The build now continues for a bit longer, however it now runs into the following problem.

-- Configuring done CMake Error at freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:489 (add_dependencies): The dependency target "__idf_build_target" of target "my_app" does not exist. Call Stack (most recent call first): freertos/vendors/espressif/boards/esp32/CMakeLists.txt:544 (idf_build_executable) freertos/CMakeLists.txt:70 (include)

And as far as I can tell both __idf_build_target and my_app both exist at that point so I'm not sure what the actual issue is.

Btw, after this fix I had to fix a bug in the python requirements because of the following bug: espressif/esp-idf#5782 (comment)

Thanks.

system

Remove linker flags from toolchain specific files

iot_wifi.c: Use esp_netif APIs

Fix warnings in WiFi port layer

Change smartconfig implementation

extras.c: Add stack overflow hook in freertos component

Remove secure_sockets layer in ports directory and use AFR secure_socket
layer

iot_pkcs11_pal.c: Change ESP_LOGx to ESP_EARLY_LOGx in initialize_nvs_partition
Add mbedtls specific config options in sdkconfig.defaults

Disable ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER in sdkconfig to fix IP issue with WiFi reconnection

Sync freertos component Kconfig with IDF

Update linker fragment for freertos component

Update sdkconfig.defaults to disable GCC8 warnings and remove corresponding CFLAGS from Makefile
all boards.

Remove mbedTLS port files and use ESP-IDF provided files.

Changes in CMakeLists for mbedTLS  to support ESP32-S2.
@shubhamkulkarni97
Copy link
Contributor Author

Hi @bhusang @YTvW @Rjblaauboer, apologies for late response.

I have updated this branch to fix issues when using freertos in external CMake project. To use this branch with external CMake project, some changes are also required in build system of external project.

I have pushed feature/idf_v4.2 branch in fork of amazon-freertos-examples where you can successfully build applications for ESP32 as well as ESP32-S2.

For now, I'll close this PR as support for common-io needs to be added with ESP-IDF v4.2. You can use feature/idf_uplevel_v4.2 branch from my personal fork till these changes are merged upstream.

I'll reopen this PR when changes can be merged to master.

Hope this helps for you!

Thanks,
Shubham

@sarenameas
Copy link
Contributor

Could you please make a new PR when you are ready? Thank you!

@shubhamkulkarni97
Copy link
Contributor Author

@sarenameas, I'll create a new PR when the changes are ready and beta tag is available for ESP-IDF v4.2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants