FAQ
The FAQ targets users who can already run BMGR normally but encounter problems. It consolidates troubleshooting approaches, files to inspect, and recommended actions for frequently reported errors. It is recommended to first identify the phase of the problem, then continue troubleshooting based on the specific error, rather than diving directly into business code.
Generation phase: Wrong board selection, incomplete YAML, incorrect dependency description, missing generated artifacts.
Compilation phase: Missing macros, missing components, missing generated files, link failure.
Runtime phase: Initialization order, power supply, callback, and configuration timing anomalies.
General troubleshooting order: first confirm the currently selected board and whether the most recent idf.py bmgr executed successfully; then check whether gen_board_*.c, board_manager.defaults, Kconfig.projbuild, and gen_board_metadata.yaml under components/gen_bmgr_codes are all present; then confirm whether the generated output actually participates in compilation and linking; finally troubleshoot runtime initialization, handle acquisition, power supply, and timing issues.
Generation Phase
idf.py bmgr or idf.py gen-bmgr-config Command Not Found
Possible Causes
ESP-IDF has not discovered
idf_ext.pyin theesp_board_managercomponent.In ESP-IDF versions before v6.0,
IDF_EXTRA_ACTIONS_PATHdoes not point to the correct path.The current shell has not reloaded the ESP-IDF environment.
Recommended Actions
Confirm that the main component manifest declares the
espressif/esp_board_managerdependency, and thatidf.py menuconfigoridf.py buildhas been run to let the component manager download the component tomanaged_components/.Restart the terminal session or re-run
source export.shto apply the ESP-IDF environment variables.ESP-IDF v6.0 and above uses the auto-discovery mechanism with the component’s own
idf_ext.py; the project must be able to recognize theesp_board_managercomponent. Versions below v6.0 requireIDF_EXTRA_ACTIONS_PATHto be set correctly.
esp_board_manager Component Path Not Found
Possible Causes
The main component manifest
idf_component.ymldoes not declare the dependency.No command has been run to trigger the component manager download after adding the dependency.
Recommended Actions
Check the project’s main
idf_component.ymland confirm it contains theespressif/esp_board_managerdependency.After adding the dependency, run
idf.py menuconfigoridf.py build; the component manager will downloadesp_board_managerto<project>/managed_components/.
Board Name Not Found or Misspelled
Possible Causes
The board name is not among those scanned in the current project.
The board directory name contains uppercase letters, hyphens, or other disallowed characters, and is ignored during the scan phase.
In the current version (0.5.x), official boards are built into BMGR and require no additional dependency declaration. Starting from 0.6, official boards have been migrated to independent components; some non-official boards require manual dependency declaration. See Board Reference for specific components.
Recommended Actions
Run
idf.py bmgr -lto view all boards actually recognized and their source labels.Board names must contain only lowercase letters, digits, and underscores, and must match the
boardfield inboard_info.yaml.To temporarily verify an external board directory, pass the path directly:
idf.py bmgr -b /abs/path/to/board.
Generated Result Unchanged After YAML Modification
Possible Causes
idf.py bmgr -b <board>has not been re-run; BMGR does not automatically regenerate due to YAML modifications.The file being modified is in an amend directory but is not listed under
apply:inboard_amend.yaml.The file being modified belongs to another board, the currently selected board is not that board, or the directory containing the modified file is overridden by a higher-priority board of the same name. See Board Source Directories and Scan Paths for priority rules.
Recommended Actions
Re-run
idf.py bmgr -b <board> [-a <amend>]and check whethercomponents/gen_bmgr_codeshas been refreshed.Check whether the amend
apply:list includes the modified file. Files not listed will only produce an INFO log and will not participate in the merge.Confirm the actual directory of the currently selected board via
idf.py bmgr -b <board>; see theBoard path: <path>information in the log.
Compilation Phase
undefined reference to g_esp_board_*
Typical symbols: g_esp_board_devices, g_esp_board_device_handles, g_esp_board_peripherals.
Possible Causes
idf.py bmgr -b <board>did not complete successfully;components/gen_bmgr_codesis missing required files. In addition to the generated.cand.hfiles, it must also containCMakeLists.txt(and usuallyidf_component.ymlandboard_manager.defaultsgenerated at the same time). If the directory only contains some.cfiles or is missingCMakeLists.txt, ESP-IDF will not register that directory as a component, the generated source will not be compiled, and this type of undefined reference will appear at link time.The project has enabled minimal or stripped builds, such as
idf_build_set_property(MINIMAL_BUILD ON)orset(COMPONENTS main). The former retains only minimal common components; the latter only builds explicitly listed components and their dependencies. In either case, ifgen_bmgr_codesis not explicitly included in the build scope, the board-level generated code will not be compiled.
Recommended Actions
First confirm that all files under
components/gen_bmgr_codesare present. The minimum set should include:gen_board_info.c,gen_board_device_config.c,gen_board_device_handles.c,gen_board_periph_config.c,gen_board_periph_handles.c,gen_board_device_custom.h,CMakeLists.txt,idf_component.yml,board_manager.defaults,Kconfig.projbuild.If any files are missing, re-run
idf.py bmgr -b <board>.In stripped build scenarios, explicitly add
gen_bmgr_codesto the build scope (add the component to theset(COMPONENTS ...)list, or confirm that the dependency chain can reach that component).
Header File, Macro, or Generated Symbol Not Found
Many BMGR issues are rooted not in the application layer, but in misaligned YAML, generated artifacts, or default configuration. It is recommended to check the following in order, rather than troubleshooting only in the business code:
Whether
components/gen_bmgr_codesis correctly generated and all files are present (same as above).gen_board_metadata.yaml: Whether the parsed devices and peripherals match expectations.gen_board_device_config.candgen_board_periph_config.c: Whether specific field values match expectations.board_manager.defaults: Whether capability macros such asCONFIG_ESP_BOARD_DEV_*_SUPPORTandCONFIG_ESP_BOARD_PERIPH_*_SUPPORTare all present.Kconfig.projbuild: WhetherCONFIG_ESP_BOARD_<BOARD>corresponding to the currently selected board is declared.sdkconfig: Whether the above capability macros are actually written into sdkconfig.
Component Dependency Resolution Failed / Version Solving Failed
Typical errors:
ERROR: Because project depends on xxxxx which
doesn't match any versions, version solving failed.
Failed to resolve component 'esp_board_manager' required by component
'gen_bmgr_codes': unknown name.
Possible Causes
The
idf_component.ymlingen_bmgr_codesfrom the last run still contains dependencies that are no longer applicable.The component name or version constraint in
dependencieswithin the YAML is incorrect.The dependency source (repository component, local component, private component) is inconsistent. For example, a dependency was originally a component repository package but has been replaced by a local path without cleaning the same-named dependency.
Recommended Actions
First use
idf.py bmgr -x(equivalent to the old commandidf.py gen-bmgr-config -xorpython gen_bmgr_config_codes.py -x) to clean generated artifacts. This command deletes the generated.cand.hfiles, resetsgen_bmgr_codes/CMakeLists.txtandidf_component.yml, and removesboard_manager.defaults.Then run
idf.py bmgr -b <board>to regenerate.If errors persist, refer to the IDF Component Manager Manifest documentation to check the syntax of the
dependenciesfield in the device YAML.
Runtime Phase
Abnormal Behavior or sdkconfig Inconsistency After Switching Boards
Possible Causes
The switch was performed via
idf.py menuconfigor by manually modifyingsdkconfig, without triggering cleanup and regeneration throughidf.py bmgr -b <board>.Capability macros from the previous board are still in
sdkconfig.CONFIG_ESP_BOARD_DEV_*_SUPPORTand other BMGR capability symbols were manually written into the project’ssdkconfig.defaults, interfering with the board-switching logic.
Recommended Actions
Switching boards must use
idf.py bmgr -b <other_board>or an equivalent script entry;idf.py menuconfigshould not be used for switching. BMGR automatically backs up the oldsdkconfigascomponents/gen_bmgr_codes/sdkconfig.bmgr_board.oldand deletes the original file when switching boards, preventing residualCONFIG_IDF_TARGETand device enable configurations from the old board.Do not manually write BMGR device or peripheral capability symbols into the project
sdkconfig.defaults; these symbols should come only from the BMGR-generatedboard_manager.defaults. Board-specific regular sdkconfig items (PSRAM, Flash, partition, etc.) should be placed insdkconfig.defaults.boardunder the board directory.To return to the current board’s default values, delete the project
sdkconfigand re-runidf.py buildto letboard_manager.defaultstake effect again.
No Runtime Change After YAML Modification
Possible Causes
idf.py bmgrhas not been run.The modification is to YAML versus runtime configuration; the two take effect at different phases.
The device has already been initialized; runtime modification of config usually requires a deinit followed by init to let the driver re-read the configuration.
Recommended Actions
First re-run
idf.py bmgr -b <board>and confirm thatcomponents/gen_bmgr_codeshas been refreshed.If the modification is to a runtime override, call
esp_board_manager_deinit_device_by_name()once for the relevant device, then callesp_board_manager_init_device_by_name().
Cannot Get Handle or Configuration at Runtime
Possible Causes
The current board has not enabled the device or peripheral; it is not declared in the YAML.
init_skip: truecauses BMGR to skip the device during the automatic initialization phase.esp_board_manager_init()did not execute successfully (a prior error or ESP_FAIL return).The
nameis misspelled and does not match the YAML.
Recommended Actions
Call
esp_board_manager_print()after startup to confirm that the expected devices and peripherals are all correctly registered and initialized.Check the startup log to confirm whether
esp_board_manager_init()returned successfully; any device initialization failure will leave an error log.For devices explicitly declared with
init_skip: true, callesp_board_manager_init_device_by_name()at the appropriate business timing before a handle can be obtained.
Device Malfunction (Power / Reset / Timing)
Possible Causes
The factory function or power-on sequence implementation in the board-level
setup_device.cis incorrect.The
power_ctrl_devicereference is wrong, causing the target device to not actually be powered before initialization.Key
[IO]or[TO_BE_CONFIRMED]fields in the YAML still use template default values instead of being filled in according to the schematic.
Recommended Actions
Cross-check the
[IO]and[TO_BE_CONFIRMED]fields in the YAML related to that device against the schematic and device datasheet.For devices requiring chip-specific timing (such as LCD displays, touchscreens, and cameras), confirm that the corresponding factory functions (
lcd_panel_factory_entry_t,lcd_touch_factory_entry_t, etc.) in the board-levelsetup_device.care correctly implemented.When a device is powered by another device, confirm that the device entry has
power_ctrl_devicecorrectly filled in, and that the referencedpower_ctrldevice itself can initialize successfully.