Giter Club home page Giter Club logo

Comments (9)

kstribrnAmzn avatar kstribrnAmzn commented on July 1, 2024

Taking a look. Getting my workspace setup for my mac. I'll reply when I have more information on your issue.

from amazon-freertos.

kstribrnAmzn avatar kstribrnAmzn commented on July 1, 2024

Some questions for you:

  1. How did you download the code? Did you check out aws/freertos from Github or did you use the AWS 'Device Software' page in the AWS console?
  2. Have you recursively checked out submodules? I checked out the code from the repo, synced my submodules, and am seeing the wifi_provisioning files under /vendors/espressif/esp-idf/components/wifi_provisioning/include/wifi_provisioning
  3. Have you tried building off of the existing BLE demo? You can select a demo following the instructions here

from amazon-freertos.

genie-ltran avatar genie-ltran commented on July 1, 2024
  1. How did you download the code? Did you check out aws/freertos from Github or did you use the AWS 'Device Software' page in the AWS console?

I checked it out it directly from the AWS github repo.

  1. Have you recursively checked out submodules? I checked out the code from the repo, synced my submodules, and am seeing the wifi_provisioning files under /vendors/espressif/esp-idf/components/wifi_provisioning/include/wifi_provisioning

It was recursively checked out. I can see the source. I just can’t reference certain files in the make process.

  1. Have you tried building off of the existing BLE demo? You can select a demo following the instructions here

Building individual demos works, but I need to combine features from multiple demos. That’s when I have problems.

from amazon-freertos.

kstribrnAmzn avatar kstribrnAmzn commented on July 1, 2024

Some further questions because I'm failing to set this up (or understand how it was setup).

You're directory structure looks something like the following, right?

|- CMakeLists.txt
|- src
|    |- main.c
|- freertos (amazon-freertos clone)
|    |-demos
|    |-freertos-kernel
|    |-(etc...)

Can you tell me more about how you've structured your project?


When I try this directory structure I'm greeted by 2 errors when I run cmake -B build -S .

This first error seems to stem from the fact that the IDF_PROJECT_EXECUTABLE is being added as an executable both in this top level CMakeLists.txt of yours and in the esp32 board CMakeLists.txt found here.

CMake Error at amazon-freertos/vendors/espressif/boards/esp32/CMakeLists.txt:434 (add_executable):
  add_executable cannot create target "afr_demo" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/Users/kstribrn/workspace/oncall".  See documentation
  for policy CMP0002 for more details.
Call Stack (most recent call first):
  amazon-freertos/CMakeLists.txt:78 (include)

This second error might stem from the first one.

CMake Error at amazon-freertos/vendors/espressif/esp-idf/components/esp32/project_include.cmake:21 (message):
  Internal error, toolchain has not been set correctly by project (or an
  invalid CMakeCache.txt file has been generated somehow)
Call Stack (most recent call first):
  amazon-freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:312 (include)
  amazon-freertos/vendors/espressif/esp-idf/tools/cmake/build.cmake:457 (__build_process_project_includes)
  amazon-freertos/vendors/espressif/boards/esp32/CMakeLists.txt:595 (idf_build_process)
  amazon-freertos/CMakeLists.txt:78 (include)

from amazon-freertos.

genie-ltran avatar genie-ltran commented on July 1, 2024

from amazon-freertos.

genie-ltran avatar genie-ltran commented on July 1, 2024

I structured my project where the amazon-freertos repo is brought in a submodule. The reason is keep my code separate from the amazon repo. I structured it this way based on the ticket linked here.

I then added my individual components in its own directory with a CMakeLists.txt file to reference include and source directories.

from amazon-freertos.

kstribrnAmzn avatar kstribrnAmzn commented on July 1, 2024

Thanks for linking to the amazon-freertos-examples repo. I dug around a bit and think I found what might be the source of your issue - though I don't have the solution just yet.

amazon-freertos-examples submodules this commit of amazon-freertos which in turn submodules Espressif's esp-idf (this commit).

This is important as it's the esp-idf 'wifi_provisioning' component which includes the wifi_provisioning/* header files your build is failing to find - see the wifi_provisioning component Cmake. The AWS 'ble_wifi_provisioning' module from AFR does not include these headers (from what I'm seeing). The 'ble_wifi_provisioning' module comes from the c-sdk which is independent of platform - see this Cmake.

As for how to fix this - I'm still figuring this out. The esp-idf documentation suggests that this component is available and included by default but this is clearly not the case.


As for why I think the component is available, below are some snippets from building the tgsong/amazon-freertos-examples...

-- Building for target esp32
-- Component names: soc log heap freertos vfs newlib esp_ringbuf driver esp_event ethernet mbedtls micro-ecc efuse bootloader_support partition_table app_update spi_flash nvs_flash lwip tcpip_adapter xtensa-debug-module app_trace pthread smartconfig_ack wpa_supplicant espcoredump esp32 cxx foo amazon-freertos-common secure_sockets bootloader nimble bt console esp_adc_cal nghttp esp_http_server esptool_py expat wear_levelling sdmmc fatfs freemodbus idf_test json mdns openssl protobuf-c protocomm spiffs ulp wifi_provisioning
-- Component paths: [some paths redacted for brevity];/Users/kstribrn/amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/wifi_provisioning
...
...
.espressif/tools/xtensa-esp32-elf/1.22.0-80-g6c4433a-5.2.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -DAFR_ESP_LWIP -DESP_PLATFORM -DGCC_NOT_5_2_0=0 -DHAVE_CONFIG_H [some more removed stuff] -I/Users/kstribrn//amazon-freertos-examples/freertos/vendors/espressif/esp-idf/components/wifi_provisioning/include

from amazon-freertos.

kstribrnAmzn avatar kstribrnAmzn commented on July 1, 2024

Played around some more and found a couple work arounds...

The simplest for me was to change your imports from using a backslash to a forward slash. This should fix your build. From what I found backslash support is a per-compiler thing. The xtensa compiler might just not handle them as you expect.

#include "wifi_provisioning/manager.h"
#include "wifi_provisioning/wifi_config.h"
#include "wifi_provisioning/scheme_ble.h"

Now the more involved thing you can try if this doesn't work is to copy aws-freertos-examples/freertos/vendors/espressif/esp-idf/components/wifi_provisioning/include/wifi_provisioning/* to a single level up (aka aws-freertos-examples/freertos/vendors/espressif/esp-idf/components/wifi_provisioning/include/*). This results in two copies of the header files. You'll also need to modify your imports in main.c to...

#include "manager.h"
#include "wifi_config.h"
//#include "scheme_ble.h" //commenting this out as the copy causes further path issues.

and build this. If this works but the forward slash didn't work then the issue could lie in the specific commit of esp-idf in Amazon FreeRTOS (though I'm doubtful of this).

from amazon-freertos.

kstribrnAmzn avatar kstribrnAmzn commented on July 1, 2024

I'm going to close this since there hasn't been further activity. Feel free to reopen this if your issue still exists.

from amazon-freertos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.