How to add custom board config?
Posted: Wed Apr 14, 2021 2:31 pm
by serjy1710
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!
Re: How to add custom board config?
Posted: Thu Apr 29, 2021 9:39 am
by quenolio
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
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.")
component.mk
Code: Select all
ifdef CONFIG_AUDIO_BOARD_CUSTOM
COMPONENT_ADD_INCLUDEDIRS += .
COMPONENT_SRCDIRS += .
endif
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

Re: How to add custom board config?
Posted: Sun Jan 23, 2022 2:03 pm
by werty37
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
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
#
Appended the following to CMakeLists.txt
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 my board files path,
Here is the menuconfig audio board screen
Where am I going wrong? Any pointers please?
Re: How to add custom board config?
Posted: Tue Jul 07, 2026 3:55 pm
by johnnyh
Hi, i have spent hours and hours on this but finally succeeded (with help)
create a custom board folder in esp-asdf/components/audio_board, add within this folder board.c, board.h, board_def.h and board_pins_config.c files. these depend on your board version, pinout etc.
add to components/audio_board cmakelists file, after all the other boards are listed/defined in this file, put the code required to allow it to choose your board, when custom board is selected in menuconfig.
Choose custom board in menuconfig. I don't know how to put a special name for your board in menuconfig, I was choosing the option "custom board".