Confused on how to embed files and what directory to place them
Posted: Tue Sep 28, 2021 8:48 pm
I am working on the ESP-IDF with the ESP-AT command set.
I have an existing project (modified set of AT commands) that works/compiles and flashes fine.
I now want to embed 2 files into
\esp-idf\esp-at\main\interface\uart\at_uart_task.c
These 2 files are an SSL file (.pem) and a binary file .hex.
the names are ca_certs.pem and firmware.hex
I have tried various ways of putting the files via COMPONENT_EMBED_TXTFILES and EMBED_FILES into CMAKELISTS.txt and component.mk TO NO AVAIL.
I can't get the project to compile because presumably it's not finding the 2 files above (or I am putting them in the wrong location).
Where do I place these two files in the directory structure and what code do I put in the CMAKELISTS.txt or COMPONENT.MK to make these load and compile?
I have tried multiple ways of doing this such as:
idf_component_register(SRCS ${app_sources} EMBED_FILES "ca_cert.pem" "firmware.hex") (cmakelists.txt)
and
COMPONENT_EMBED_TXTFILES := ca_cert.pem
COMPONENT_EMBED_TXTFILES += firmware.hex
but each time I compile I get these errors and it won't compile.
c:/users/zzz/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(at_uart_task.c.obj):(.literal.fw_test1+0x24): undefined reference to `_binary_ca_cert_pem_start'
c:/users/zzz/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(at_uart_task.c.obj):(.literal.fw_test1+0x28): undefined reference to `firmware_hex_length'
Thanks in advance!
I have an existing project (modified set of AT commands) that works/compiles and flashes fine.
I now want to embed 2 files into
\esp-idf\esp-at\main\interface\uart\at_uart_task.c
These 2 files are an SSL file (.pem) and a binary file .hex.
the names are ca_certs.pem and firmware.hex
I have tried various ways of putting the files via COMPONENT_EMBED_TXTFILES and EMBED_FILES into CMAKELISTS.txt and component.mk TO NO AVAIL.
I can't get the project to compile because presumably it's not finding the 2 files above (or I am putting them in the wrong location).
Where do I place these two files in the directory structure and what code do I put in the CMAKELISTS.txt or COMPONENT.MK to make these load and compile?
I have tried multiple ways of doing this such as:
idf_component_register(SRCS ${app_sources} EMBED_FILES "ca_cert.pem" "firmware.hex") (cmakelists.txt)
and
COMPONENT_EMBED_TXTFILES := ca_cert.pem
COMPONENT_EMBED_TXTFILES += firmware.hex
but each time I compile I get these errors and it won't compile.
c:/users/zzz/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(at_uart_task.c.obj):(.literal.fw_test1+0x24): undefined reference to `_binary_ca_cert_pem_start'
c:/users/zzz/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(at_uart_task.c.obj):(.literal.fw_test1+0x28): undefined reference to `firmware_hex_length'
Thanks in advance!