I am currently using PlatformIO via Visual Studio Code on Windows, using the latest esp32 frameworks (1.0.2, see below for an output of pio update), and currently cannot get the aws_iot files to compile / link / copy for my projects anymore… I do not see the aws_iot folder with the object files copied to the project directory, and while the project appears to build, it cannot link as it cannot find the references that would be present if the object files were present.
Now, this was working prior to the update, however no amount of updating the sdkconfig.h file appears to help? I am at the least adding
#define CONFIG_AWS_IOT_SDK 1
to the sdkconfig.h file with no luck…
You can reproduce this issue with a new project using the IDF and create a main.c file simply containing
Note this code does ‘nothing’ however it reproduces the same error / effect with my project, resulting in
.pioenvs\esp32dev\src\main.o:(.literal.app_main+0x0): undefined reference to aws_iot_mqtt_autoreconnect_set_status
Is there a new / different way to add aws_iot to my project, or am I missing something simple(hopefully!)
Not quite - while it is compiling and copying the aws_iot folder object files if i change this, I now am getting some compile errors regarding defines missing with the sdkconfig.h file that comes with a New Project.
specifically,
brownout.c:34:45: error: ‘CONFIG_BROWNOUT_DET_RESETDELAY’ undeclared (first use in this function)
so I’ve addressed this by changing #define CONFIG_BROWNOUT_DET 0
which then yields
error: ‘CONFIG_BTDM_CONTROLLER_RUN_CPU’ undeclared
which is addressed by adding #define CONFIG_BTDM_CONTROLLER_RUN_CPU 0
to sdkconfig.h
resulting in
error: ‘CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX’ undeclared
, addressed with #define CONFIG_LWIP_THREAD_LOCAL_STORAGE_INDEX 0
At this point I’m reasonably certain that platformio.ini change requires a different sdkconfig.h file - as it’s now ‘building’, however linking results in a syntax error:
Linking .pioenvs\esp32dev\firmware.elf
c:/users/hammondeggs/.platformio/packages/toolchain-xtensa32@1.50200.2/bin/…/lib/gcc/xtensa-esp32-elf/5.2.0/…/…/…/…/xtensa-esp32-elf/bin/ld.exe:esp32_out.ld:23: syntax error
collect2.exe: error: ld returned 1 exit status
Ok, with the platform = espressif32@<1 change in platform.ini, deleting the sdkconfig.h does cause it to be recreated however it does not appear to use the ‘older’ sdkconfig.h (as I still need to make those changes I mentioned above) -
However…
I do know what caused this particular error now, and I’m not sure if this is related to platformio or the toolchain…
The error in the esp32_out.ld file was in my case being caused by the sdkconfig.h file having a commented out line in it.
For instance, in sdkconfig.h
… #define CONFIG_LOG_DEFAULT_LEVEL_INFO 1
//#define CONFIG_BT_RESERVE_DRAM 0x10000 #define CONFIG_FATFS_FS_LOCK 0
…
This //define above here was causing the issue, but note you may have to perform a clean before it occurs, where it will continue to do so. On opening the esp32_out.ld file you see
…
Automatically generated file; DO NOT EDIT.
Espressif IoT Development Framework Configuration
/
//#define CONFIG_BT_RESERVE_DRAM 0x10000
MEMORY
{
/ All these values assume the flash cache is on, and have the blocks this uses subtracted from the length
of the various regions. The ‘data access port’ dram/drom regions map to the same iram/irom regions but
are connected to the data port of the CPU and eg allow bytewise access. */
…etc
Right above “MEMORY” the commented out #define is for some reason copied to the .ld file, causing this error.
So it appears this error was being caused by commenting out defines in the sdkconfig.h. Removing these or setting them to 0 where appropriate is likely the best course of action. The issue however with the latest version does not work with aws_iot remains however.
@ivankravets that was helpful. I have one problem. My DCONFIG_WIFI_SSID is two words, so
DCONFIG_WIFI_SSID=“first’s part” and I am getting parsing errors.
i have tried to do multiple slashes
DCONFIG_WIFI_SSID=“first’s"part” similar to this: “hello"world”, but it still fails.
Suggestions?
If I don’t have the leading and trailing , i get parsing errors and random character errors, but neither the\ or \\ works for me.
It doesn’t like the apostrophe either. If I remove the ', it works fine.
_start'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0x1c): undefined reference to `_binary_src_certificate_pem
_crt_start'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0x20): undefined reference to `_binary_src_private_pem_key
_start'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0x8c): undefined reference to `aws_iot_mqtt_init'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0x90): undefined reference to `aws_iot_mqtt_connect'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0x94): undefined reference to `aws_iot_mqtt_subscribe'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0x98): undefined reference to `aws_iot_mqtt_yield'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0xa0): undefined reference to `aws_iot_mqtt_publish'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.aws_iot_task+0xa4): undefined reference to `aws_iot_mqtt_autoreconnect_
set_status'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.disconnectCallbackHandler+0x14): undefined reference to `aws_iot_is_aut
oreconnect_enabled'
.pioenvs\esp32dev\src\subscribe_publish_sample.o:(.literal.disconnectCallbackHandler+0x18): undefined reference to `aws_iot_mqtt_a
ttempt_reconnect'
.pioenvs\esp32dev\src\subscribe_publish_sample.o: In function `aws_iot_task':
subscribe_publish_sample.c:(.text.aws_iot_task+0x91): undefined reference to `aws_iot_mqtt_init'
subscribe_publish_sample.c:(.text.aws_iot_task+0xf5): undefined reference to `aws_iot_mqtt_connect'
subscribe_publish_sample.c:(.text.aws_iot_task+0x165): undefined reference to `aws_iot_mqtt_subscribe'
subscribe_publish_sample.c:(.text.aws_iot_task+0x1c2): undefined reference to `aws_iot_mqtt_yield'
subscribe_publish_sample.c:(.text.aws_iot_task+0x207): undefined reference to `aws_iot_mqtt_publish'
subscribe_publish_sample.c:(.text.aws_iot_task+0x238): undefined reference to `aws_iot_mqtt_publish'
subscribe_publish_sample.c:(.text.aws_iot_task+0x286): undefined reference to `aws_iot_mqtt_autoreconnect_set_status'
.pioenvs\esp32dev\src\subscribe_publish_sample.o: In function `disconnectCallbackHandler':
subscribe_publish_sample.c:(.text.disconnectCallbackHandler+0x1d): undefined reference to `aws_iot_is_autoreconnect_enabled'
subscribe_publish_sample.c:(.text.disconnectCallbackHandler+0x4d): undefined reference to `aws_iot_mqtt_attempt_reconnect'
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\esp32dev\firmware.elf] Error 1
Got same problem. ESP32 projects not compiling anymore.
.platformio\packages\framework-espidf\components\aws_iot\aws-iot-device-sdk-embedded-C\src\aws_iot_mqtt_client.c:43:
D:/users/ad/.platformio/packages/framework-espidf/components/aws_iot/include/aws_iot_config.h:40:33: error: ‘CONFIG_AWS_IOT_MQTT_TX_BUF_LEN’ undeclared here (not in a function)
What can i do? How to use your patch?
Latest PIO installed now (Home 1.0.2·Core 3.6.0)