Amazon FreeRTOS ESP32 Demo Project make error: missing hwcrypto/aes.h

EugeneDV wrote on April 04, 2019:

I am trying to compile Amzon FreeRTOS ESP32 Demo Project, but I get a +warning and an error+.
I followed all the steps from:
[https://docs.aws.amazon.com/freertos/latest/userguide/getting_started_espressif.html]
Everything described there loaded and installed fine.
My OS is Ubuntu 16.04.
Here is the make command I used:

me@pc:~/amazon-freertos/demos/espressif/esp32_devkitc_esp_wrover_kit/make$ make flash

Here is the make response:


Toolchain path: /home/me/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a
Compiler version: 5.2.0
Python requirements from /home/me/esp/esp-idf/requirements.txt are satisfied.

CC build/amazon-freertos-common/lib/tls/aws_tls.o
In file included from /home/me/amazon-freertos/demos/espressif/esp32_devkitc_esp_wrover_kit/common/config_files/FreeRTOSConfig.h:40:0,
                 from /home/me/amazon-freertos/lib/include/FreeRTOS.h:56,
                 from /home/me/amazon-freertos/lib/tls/aws_tls.c:27:
/home/me/esp/esp-idf/components/esp32/include/rom/ets_sys.h:1:2: warning: #warning rom/ets_sys.h is deprecated, please use esp32/rom/ets_sys.h instead [-Wcpp]
 #warning rom/ets_sys.h is deprecated, please use esp32/rom/ets_sys.h instead
  ^
In file included from /home/me/amazon-freertos/lib/third_party/mbedtls/include/mbedtls/aes.h:111:0,
                 from /home/me/amazon-freertos/lib/third_party/mbedtls/include/mbedtls/ctr_drbg.h:36,
                 from /home/me/amazon-freertos/lib/tls/aws_tls.c:40:
/home/me/amazon-freertos/demos/espressif/esp32_devkitc_esp_wrover_kit/common/application_code/espressif_code/mbedtls/port/include/aes_alt.h:31:26: fatal error: hwcrypto/aes.h: No such file or directory
compilation terminated.
/home/me/esp/esp-idf/make/component_wrapper.mk:289: recipe for target 'lib/tls/aws_tls.o' failed
make[1]: *** [lib/tls/aws_tls.o] Error 1
/home/me/esp/esp-idf/make/project.mk:578: recipe for target 'component-amazon-freertos-common-build' failed
make: *** [component-amazon-freertos-common-build] Error 2

What am I doing wrong?

Edited by: EugeneFromDigiVac on Apr 4, 2019 8:14 PM

Edited by: EugeneDV on Apr 5, 2019 5:57 AM

abhijit-AWS wrote on April 08, 2019:

Hello EugeneDV!

Can you please check if IDF_PATH is set somewhere in your source tree? If it is, it will not point to lib/third_party/mcu_vendor/espressif/esp-idf
In makefile for demos: (demos/espressif/esp32_devkitc_esp_wrover_kit/make/Makefile) we define IDF_PATH as follows:

ifndef IDF_PATH 
export IDF_PATH := $(AMAZON_FREERTOS_PATH)/lib/third_party/mcu_vendor/espressif/esp-idf 
endif 

So if you have IDF_PATH defined somewhere else, you will start seeing compilation problems.
We are using latest master to make sure build works.
Thanks.

Arunmishra wrote on June 13, 2019:

I am experiencing following error while building mqtt demo project for esp32. I tried clearing IDF_PATH by unset IDF_PATH millions of times :frowning: . Any insight ?

Building partitions from /d/amfrtos/demos/espressif/esp32_devkitc_esp_wrover_kit/make/partitions_example.csv…
CC build/amazon-freertos-common/lib/mqtt/aws_mqtt_agent.o
In file included from D:/amfrtos/lib/mqtt/aws_mqtt_agent.c:47:0:
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c: In function ‘prvSetupConnection’:
D:/amfrtos/lib/include/aws_secure_sockets.h:339:37: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
#define socketsAWS_IOT_ALPN_MQTT “x-amzn-mqtt-ca”
^
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c:859:27: note: in expansion of macro ‘socketsAWS_IOT_ALPN_MQTT’
char * ppcAlpns[] = { socketsAWS_IOT_ALPN_MQTT };
^
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c: In function ‘MQTT_AGENT_Init’:
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c:1907:25: error: implicit declaration of function ‘xQueueCreateStatic’ [-Werror=implicit-function-declaration]
xCommandQueue = xQueueCreateStatic( mqttCOMMAND_QUEUE_LENGTH, sizeof( MQTTEventData_t ), ucQueueStorageArea, &xStaticQueue );
^
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c:1907:23: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
xCommandQueue = xQueueCreateStatic( mqttCOMMAND_QUEUE_LENGTH, sizeof( MQTTEventData_t ), ucQueueStorageArea, &xStaticQueue );
^
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c:1910:27: error: implicit declaration of function ‘xTaskCreateStatic’ [-Werror=implicit-function-declaration]
xMQTTTaskHandle = xTaskCreateStatic( prvMQTTTask, “MQTT”, mqttconfigMQTT_TASK_STACK_DEPTH, NULL, mqttconfigMQTT_TASK_PRIORITY, xStack, &xStaticTask );
^
D:/amfrtos/lib/mqtt/aws_mqtt_agent.c:1910:25: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
xMQTTTaskHandle = xTaskCreateStatic( prvMQTTTask, “MQTT”, mqttconfigMQTT_TASK_STACK_DEPTH, NULL, mqttconfigMQTT_TASK_PRIORITY, xStack, &xStaticTask );
^
cc1.exe: some warnings being treated as errors
make[1]: *** [/d/amfrtos/lib/third_party/mcu_vendor/espressif/esp-idf/make/component_wrapper.mk:286: lib/mqtt/aws_mqtt_agent.o] Error 1
make: *** [/d/amfrtos/demos/espressif/esp32_devkitc_esp_wrover_kit/make/…/…/…/…/lib/third_party/mcu_vendor/espressif/esp-idf/make/project.mk:477: component-amazon-freertos-common-build] Error 2

DanG-AWS wrote on August 16, 2019:

Hello, regarding the two errors, the symbol is defined here xQueueCreateStatic https://github.com/aws/amazon-freertos/blob/master/freertos_kernel/include/queue.h#L232. Can you please confirm that aws_mqtt_agent.c includes queue.h and that the latter is in your include path when compiling that module?

If you are still in the prototyping stage, please consider upgrading to the latest Amazon FreeRTOS in GitHub master. The MQTT library has been rewritten since your original post.