Build error

I was trying to install AWS FreeRTOS on my system. However, when I try to build it, I get the following error:

D:\Softwares\FreeRTOS\FreeRTOS>cmake -DVENDOR=espressif -DBOARD=esp32_plus_ecc608a_devkitc -DCOMPILER=xtensa-esp32 -GNinja -S . -B D:\Softwares\FreeRTOS\FreeRTOS\Build
– The C compiler identification is unknown
– The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:8 (project):
** No CMAKE_C_COMPILER could be found.**

** Tell CMake where to find the compiler by setting either the environment**
** variable “CC” or the CMake cache entry CMAKE_C_COMPILER to the full path to**
** the compiler, or to the compiler name if it is in the PATH.**

CMake Error at CMakeLists.txt:8 (project):
** No CMAKE_CXX_COMPILER could be found.**

** Tell CMake where to find the compiler by setting either the environment**
** variable “CXX” or the CMake cache entry CMAKE_CXX_COMPILER to the full path**
** to the compiler, or to the compiler name if it is in the PATH.**

– Configuring incomplete, errors occurred!
See also “D:/Softwares/FreeRTOS/FreeRTOS/Build/CMakeFiles/CMakeOutput.log”.
See also “D:/Softwares/FreeRTOS/FreeRTOS/Build/CMakeFiles/CMakeError.log”.

Please let me know what is the issue.

Thanks.

Hello @Vipul,

Where did you download your project from?

If you have downloaded https://github.com/aws/amazon-freertos or from the FreeRTOS Device Software page in the AWS IoT Core service, then please make sure you have all of the Espressif toolchain and tools installed and CMake version 3.13+:
https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html#setup-env-esspressif
The error you see above is typically seen from not having the Espressif toolchain installed properly.
Here are the Paths in my environment variables:
image
Run the cmake command from the root of the repo.

As you may already know, https://github.com/FreeRTOS/FreeRTOS does not have the espressif CMake project available.

Hello @SarenaAWS,

Thank you very much for the reply.

I checked the environment variables that you have added to your path. I can’t quite see the toolchain folder in my system.

How do I solve this…!?

Following is a screenshot of it.

Hello @Vipul,

Apologies for the late reply. I see that you have toolchains on your file system in the same location as me. You can add the same paths that I have shown you into your environment variables. I found a nice little document from Oracle on how to update the environment variables in Windows: https://docs.oracle.com/en/database/oracle/r-enterprise/1.5.1/oread/creating-and-modifying-environment-variables-on-windows.html#GUID-DD6F9982-60D5-48F6-8270-A27EC53807D0.

Hello, I’m having the same issue. I’m trying to build FreeRTOS:

C:\FreeRTOS>cmake -DVENDOR=espressif -DBOARD=esp32_wrover_kit -DCOMPILER=xtensa-esp32 -GNinja -S . -B C:\FreeRTOS\pgbuild
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:8 (project):
  The CMAKE_C_COMPILER:

    xtensa-esp32

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:8 (project):
  The CMAKE_CXX_COMPILER:

    xtensa-esp32

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "C:/FreeRTOS/pgbuild/CMakeFiles/CMakeOutput.log".
See also "C:/FreeRTOS/pgbuild/CMakeFiles/CMakeError.log".

I installed the Espressif toolchain properly and I have all the listed environment variables present. I’m able to build and flash all the example ESP-IDF projects fine so I’m not sure what’s going on.

It seems that xtensa-esp32 is not in your path. Would you please run the following command and see if it works:

 xtensa-esp32-elf-gcc.exe --version

If it does not, then you need to add the location of the xtensa-esp32-elf-gcc.exe to your PATH variable.

Thanks.