Hello friends,
Pls. give me advice or sample, how to add my custom board config into ESP-ADF project proper way?
I've tried to choose "Custom audio board" in "Audio HAL" section of SDK Config, and add "MyBoard" component in project "components" folder, with customized "board.h", "board.c", "board_defs" etc.
Component use basic CMakeLists.txt.
But, when i try to compile project, i get a lot of errors from other ESP-ADF components with the same reason: ".espressif/esp-adf/components/display_service/led_bar/led_bar_ws2812.c:27:10: fatal error: board.h: No such file or directory
#include "board.h""
As i guess, i could add my custom board definition in common storage ".espressif\esp-adf\components\audio_board", and edit CMakeLists.txt for this "component", but i'm not sure it's proper way to edit ESP-ADF config files. I suppose, should be a right way to add my own component without such modification, using predefined way.
Unfortunately, i can't find any docs about custom board implementation..
Could anyone show me this way, o give a link to sample project?
Thank you very much!
How to add custom board config?
Re: How to add custom board config?
Hi serjy1710,
The way I have done that is simply create new folder in your project components (such as "MyBoard"). Next copy content of one of supported boards (in ADF components/audio_board. Ex. lyrat_v4_3) and copy include folder from the same ADF source (with board_pins_config.h). Next you can copy or create CMakeLists.txt and component.mk files and make sure they will have if(CONFIG_AUDIO_BOARD_CUSTOM) statement. Examples below. I used ADF v2.1.
CMakeLists.txt
component.mk
At the end select "Custom audio board" in "Audio HAL" section of SDK Config. Please make sure that creating custom board component from existing one will compile and work and then you can modify your custom board code to your preferences.
Hope this will work for you
The way I have done that is simply create new folder in your project components (such as "MyBoard"). Next copy content of one of supported boards (in ADF components/audio_board. Ex. lyrat_v4_3) and copy include folder from the same ADF source (with board_pins_config.h). Next you can copy or create CMakeLists.txt and component.mk files and make sure they will have if(CONFIG_AUDIO_BOARD_CUSTOM) statement. Examples below. I used ADF v2.1.
CMakeLists.txt
Code: Select all
# Edit following two lines to set component requirements (see docs)
set(COMPONENT_REQUIRES)
set(COMPONENT_PRIV_REQUIRES audio_sal audio_hal esp_dispatcher esp_peripherals display_service)
if(CONFIG_AUDIO_BOARD_CUSTOM)
message(STATUS "Current board name is " CONFIG_AUDIO_BOARD_CUSTOM)
list(APPEND COMPONENT_ADD_INCLUDEDIRS .)
set(COMPONENT_SRCS "board.c" "board_pins_config.c")
endif()
register_component()
IF (IDF_VER MATCHES "v4.")
idf_component_get_property(audio_board_lib audio_board COMPONENT_LIB)
set_property(TARGET ${audio_board_lib} APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${COMPONENT_LIB})
ELSEIF (IDF_VER MATCHES "v3.")
set_property(TARGET idf_component_audio_board APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${COMPONENT_TARGET},INTERFACE_INCLUDE_DIRECTORIES>)
set(CFLAGS -std=c11 -Wall -Wextra -pedantic -Werror)
set(CXXFLAGS -std=c++11 -Wall -Wextra -pedantic -Werror)
ENDIF (IDF_VER MATCHES "v4.")
Code: Select all
ifdef CONFIG_AUDIO_BOARD_CUSTOM
COMPONENT_ADD_INCLUDEDIRS += .
COMPONENT_SRCDIRS += .
endif
Hope this will work for you
Re: How to add custom board config?
Tried following the instructions but for some reason, the board won't show up in menuconfig. I am using an ESP32 Audio Kit v2.2 3378 by Aithinker.
Appended the following to component.mk
Appended the following to CMakeLists.txt
Here is my board files path,
Here is the menuconfig audio board screen
Where am I going wrong? Any pointers please?
Appended the following to component.mk
Code: Select all
# Added AI THINKER V2.2 3378
ifdef CONFIG_ESP_AI_THINKER_V2_2_3378_BOARD
COMPONENT_ADD_INCLUDEDIRS += ./ai_thinker_v2_2_3378
COMPONENT_SRCDIRS += ./ai_thinker_v2_2_3378
endif
#
Code: Select all
# Added AI THINKER V2.2 3378
ifdef CONFIG_ESP_AI_THINKER_V2_2_3378_BOARD
COMPONENT_ADD_INCLUDEDIRS += ./ai_thinker_v2_2_3378
COMPONENT_SRCDIRS += ./ai_thinker_v2_2_3378
endif
#
Here is the menuconfig audio board screen
Where am I going wrong? Any pointers please?
Who is online
Users browsing this forum: No registered users and 20 guests