Using esp-idf 4.2 with latest FreeRTOS

We have a product we are developing based on the WROOM-32E and would like to implement the latest version of FreeRTOS in order to leverage the latest OTA and MQTT demos/libraries.

We found this IDF_4.2_uplevel branch of Amazon FreeRTOS and have tried to integrate it with our current project but are running into a bunch of CMake errors.

What we tried thus far:

  1. I git cloned the amazon freertos, switched to this rebased 4.2 uplevel: https://github.com/shubhamkulkarni97/amazon-freertos/tree/feature/idf_uplevel_v4.2_rebased
  2. Upgraded all of the submodules
  3. Dropped the entire amazon freertos folder into our project with the suggested folder structure.
  4. Added cmakelists suggestions found towards the end of this: https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html
  5. Tried to build

Tried the other modules for AFR_BOARD.
Tried pulling out the include.
Tried clearing IDF_PATH and using the version of esp-idf included in freertos under vendors.

heres the error I keep getting when I try to build:

Submodule path ‘vendors/cypress/MTB/libraries/retarget-io’: checked out ‘6eb547f3ac50cd436fecefc50cb93380011f21cc’
Submodule path ‘vendors/cypress/MTB/libraries/rgb-led’: checked out ‘432146fe700340767f46a588ae1787caa317c8ba’
Submodule path ‘vendors/cypress/MTB/libraries/serial-flash’: checked out ‘8558f203f1f20a81e96a9f5583da327d4b3f062d’
Submodule path ‘vendors/cypress/MTB/libraries/whd-bsp-integration’: checked out ‘a4fae4095fe1e86ea5c495219f262339bc7a7f68’
Submodule path ‘vendors/cypress/MTB/libraries/wifi-host-driver’: checked out ‘cd2e40856a7a4b7cbbdbdb854c028ebdac794155’
Submodule path ‘vendors/cypress/MTB/psoc6/psoc6cm0p’: checked out ‘c91fa25bc5895a94d4181a5b5958b9b9c38da40d’
Submodule path ‘vendors/cypress/MTB/psoc6/psoc6hal’: checked out ‘72abdecad39f41b326a74f65591af09ce6aec224’
Submodule path ‘vendors/cypress/MTB/psoc6/psoc6make’: checked out ‘2d3816c69361e60c22a72f4f4424569e46370959’
Submodule path ‘vendors/cypress/MTB/psoc6/psoc6pdl’: checked out ‘16fda1156edf67d72b1d4af3f72528d607a4d4e0’
Submodule path ‘vendors/cypress/MTB/psoc6/udb-sdio-whd’: checked out ‘c0f0dc862725399997dc20544d61c80239c1155a’
fatal: remote error: upload-pack: not our ref a7d7a402e386cd2edae27fcc697cbdcfae8f0135e-band side-band-64k ofs-delta shallow deepen-since deepen-not deepen-relative no-progress include-tag multi_ack_detailed allow-tip-sha1-in-want allow-reachable-sha1-in-want no-done symref=HEAD:refs/heads/release/v3.3 filter object-format=sha1 agent=git/github-gb13cc0c1a7bd
fatal: the remote end hung up unexpectedly
Fetched in submodule path ‘vendors/espressif/esp-idf’, but it did not contain a7d7a402e386cd2edae27fcc697cbdcfae8f0135. Direct fetching of that commit failed.
CMake Error at freertos/tools/cmake/afr.cmake:45 (message):
git submodule update --init failed with 1, please checkout submodules
Call Stack (most recent call first):
freertos/CMakeLists.txt:14 (include)

– Configuring incomplete, errors occurred!
See also “C:/Chili-wifi-firmware/Projects/ChiliWifi/build-directory/CMakeFiles/CMakeOutput.log”.

CMakeOutput.log:

The target system is: Generic - -
The host system is: Windows - 10.0.19041 - AMD64
Compiling the C compiler identification source file “CMakeCCompilerId.c” succeeded.
Compiler: C:/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc.exe
Build flags: -mlongcalls
Id flags:

The output was:
0

Compilation of the C compiler identification source “CMakeCCompilerId.c” produced “a.out”

The C compiler identification is GNU, found in “C:/Chili-wifi-firmware/Projects/ChiliWifi/build-directory/CMakeFiles/3.16.4/CompilerIdC/a.out”

Compiling the CXX compiler identification source file “CMakeCXXCompilerId.cpp” succeeded.
Compiler: C:/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++.exe
Build flags: -mlongcalls
Id flags:

The output was:
0

Compilation of the CXX compiler identification source “CMakeCXXCompilerId.cpp” produced “a.out”

The CXX compiler identification is GNU, found in “C:/Chili-wifi-firmware/Projects/ChiliWifi/build-directory/CMakeFiles/3.16.4/CompilerIdCXX/a.out”

Checking whether the ASM compiler is GNU using “–version” matched “(GNU assembler)|(GCC)|(Free Software Foundation)”:
xtensa-esp32-elf-gcc.exe (crosstool-NG esp-2020r3) 8.4.0
Copyright © 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.

I think I’ve tried just about every variation in my high level cmakelists file.

At this point, I want to try to build everything separately and remove the submodule references so it doesn’t try to redownload them and rebuild every time but I’m at a loss as to where to start on that.

Hey Andy,

it can be disabled with the cmake flag -DBUILD_CLONE_SUBMODULES=0 at (https://github.com/aws/amazon-freertos/blob/65b35035d608a77bb482c68cde0d1d8019bc148d/tools/cmake/afr.cmake#L38)

or you can comment out the following lines (38-47): https://github.com/aws/amazon-freertos/blob/65b35035d608a77bb482c68cde0d1d8019bc148d/tools/cmake/afr.cmake#L38

Some additional background for you:

We have been working closely with the Espressif team in terms of timeline of availability for IDFv4.2 which has just been released. The branch you are working with is currently on a developmental version of IDF from mid-July. We are currently review the PRs raised by the Espressif team (https://github.com/aws/amazon-freertos/pull/2893) for updating to the official release version.