Page 1 of 1

ESP32 custom component with ULP: Link failure

Posted: Fri Apr 09, 2021 9:33 pm
by cbaurtx
I created a custom ESP32 component to poll some buttons and a knob with a rotary encoder. Polling and debouncing and decoding is carried out by the ULP. Unfortunately my codes does not link.
https://github.com/cbaurtx/ESP32_keypad_rotdecode

The directory structure is like this:
main
components/keypad_rotdecode
components/keypad_rotdecode/include
components/keypad_rotdecode/ulp
build

Root CMakeLists.txt

Code: Select all

cmake_minimum_required(VERSION 3.5)

set(SUPPORTED_TARGETS esp32)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(keypad_rotdecode)
components/keypad_rotdecode/CMakeLists.txt

Code: Select all

idf_component_register(SRCS "keypad_rotdecode.c"
                    INCLUDE_DIRS "include"
                    REQUIRES ulp)

set(ulp_app_name "ulp_debounce_decode")
set(ulp_s_sources "ulp/debounce_decode.S")
set(ulp_exp_dep_srcs "keypad_rotdecode.c")
ulp_embed_binary(${ulp_app_name} "${ulp_s_sources}" "${ulp_exp_dep_srcs}")
When building the project I this as first error:
Linking CXX executable keypad_rotdecode.elf
FAILED: keypad_rotdecode.elf
and later missing symbols defined in the header of the component include file.

This may be a similar case:
https://forums.freertos.org/t/integrati ... rtos/11822

I am clueless....

Re: ESP32 custom component with ULP: Link failure

Posted: Sat Apr 10, 2021 6:51 pm
by cbaurtx
I did some digging...
It seems that the command ulp_embed_binary creates executables only. So no code for libraries :cry: