#include "soc/timer_group_struct.h"
#include "soc/timer_group_reg.h"
#include "esp_app_trace.h"
-#include "esp_dbg_stubs.h"
+#include "esp_private/dbg_stubs.h"
#if CONFIG_ESP32_GCOV_ENABLE
"in by the parent build process.")
endif()
-set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc soc main efuse)
+set(COMPONENTS bootloader esptool_py esp32 partition_table soc bootloader_support log spi_flash micro-ecc main efuse)
set(BOOTLOADER_BUILD 1)
add_definitions(-DBOOTLOADER_BUILD=1)
-set(COMPONENT_REQUIRES_COMMON esp_rom log esp32 soc)
+set(COMPONENT_REQUIRES_COMMON log esp32 soc esp_rom esp_common)
include("${IDF_PATH}/tools/cmake/project.cmake")
project(bootloader)
CFLAGS =
CXXFLAGS =
-#We cannot include the esp32 and esp_rom component directly but we need their includes.
+#We cannot include the esp32, esp_rom, esp_common component directly but we need their includes.
CFLAGS += -I $(IDF_PATH)/components/esp32/include
CFLAGS += -I $(IDF_PATH)/components/esp_rom/include
+CFLAGS += -I $(IDF_PATH)/components/esp_common/include
# The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.
#
"uart.c")
set(COMPONENT_ADD_INCLUDEDIRS "include")
set(COMPONENT_PRIV_INCLUDEDIRS "include/driver")
-
set(COMPONENT_REQUIRES esp_ringbuf)
register_component()
#include "esp_event.h"
#include "esp_spi_flash.h"
#include "esp_ipc.h"
-#include "esp_crosscore_int.h"
#include "esp32/dport_access.h"
+#include "esp_private/crosscore_int.h"
#include "esp_log.h"
#include "esp_vfs_dev.h"
#include "esp_newlib.h"
#include "esp_panic.h"
#include "esp_core_dump.h"
#include "esp_app_trace.h"
-#include "esp_dbg_stubs.h"
+#include "esp_private/dbg_stubs.h"
#include "esp_efuse.h"
#include "esp32/spiram.h"
#include "esp_clk_internal.h"
#include "esp32/rom/ets_sys.h"
#include "soc/uart_reg.h"
#include "soc/io_mux_reg.h"
-#include "esp_gdbstub.h"
+#include "esp_private/gdbstub.h"
#include "esp_panic.h"
#include "driver/gpio.h"
#include "freertos/FreeRTOS.h"
#include "soc/rtc.h"
#include "soc/rtc_wdt.h"
-#include "esp_gdbstub.h"
+#include "esp_private/gdbstub.h"
#include "esp_panic.h"
#include "esp_attr.h"
#include "esp_err.h"
#include "esp_err.h"
#include "esp_pm.h"
#include "esp_log.h"
-#include "esp_crosscore_int.h"
#include "esp32/clk.h"
+#include "esp_private/crosscore_int.h"
#include "soc/rtc.h"
-set(COMPONENT_SRCS
- "src/dbg_stubs.c"
- "src/esp_err_to_name.c"
- "src/esp_timer.c"
- "src/ets_timer_legacy.c"
- "src/pm_locks.c"
- "src/stack_check.c")
-set(COMPONENT_ADD_INCLUDEDIRS "include")
-set(COMPONENT_PRIV_INCLUDEDIRS)
-set(COMPONENT_REQUIRES)
-# dbg_stubs.c needs eri.h from xtensa-debug-module
-set(COMPONENT_PRIV_REQUIRES "xtensa-debug-module")
-register_component()
-
-set_source_files_properties(
- "src/stack_check.c"
- PROPERTIES COMPILE_FLAGS
- -fno-stack-protector)
+if(BOOTLOADER_BUILD)
+ # For bootloader, all we need from esp_common is headers
+ set(COMPONENT_ADD_INCLUDEDIRS include)
+ set(COMPONENT_REQUIRES ${IDF_COMPONENTS})
+ set(COMPONENT_SRCS )
+ register_component()
+else()
+ # Regular app build
+ set(COMPONENT_SRCS
+ "src/dbg_stubs.c"
+ "src/esp_err_to_name.c"
+ "src/esp_timer.c"
+ "src/ets_timer_legacy.c"
+ "src/pm_locks.c"
+ "src/stack_check.c")
+ set(COMPONENT_ADD_INCLUDEDIRS "include")
+ set(COMPONENT_PRIV_INCLUDEDIRS)
+ set(COMPONENT_REQUIRES)
+ # dbg_stubs.c needs eri.h from xtensa-debug-module
+ set(COMPONENT_PRIV_REQUIRES "xtensa-debug-module")
+ register_component()
+ set_source_files_properties(
+ "src/stack_check.c"
+ PROPERTIES COMPILE_FLAGS
+ -fno-stack-protector)
+endif()
#include "eri.h"
#include "xtensa-debug-module.h"
-#include "esp_dbg_stubs.h"
+#include "esp_private/dbg_stubs.h"
#include "esp_attr.h"
#if CONFIG_ESP32_DEBUG_STUBS_ENABLE
esp_rom/include \
soc/esp32/include \
esp32/include \
+ esp_common/include \
bootloader_support/include \
app_update/include \
spi_flash/include \
#include <xtensa/config/core.h>
#include <xtensa/config/system.h> /* required for XSHAL_CLIB */
#include <xtensa/xtruntime.h>
-#include "esp_crosscore_int.h"
+#include "esp_private/crosscore_int.h"
#include "esp_timer.h" /* required for FreeRTOS run time stats */
#include "esp_panic.h"
#include "esp_heap_caps.h"
-#include "esp_crosscore_int.h"
+#include "esp_private/crosscore_int.h"
#include "esp_intr_alloc.h"
#include "esp_log.h"
) \
$(addprefix ../../../components/, \
esp_rom/include \
+ esp_common/include \
soc/esp32/include \
esp32/include \
bootloader_support/include \
newlib/lock.c \
esp32/crc.cpp \
esp32/esp_random.c \
- bootloader_support/src/bootloader_common.c
+ bootloader_support/src/bootloader_common.c
INCLUDE_DIRS := \
../include \
sdmmc/include \
vfs/include \
$(addprefix ../../../../components/, \
+ esp_common/include \
soc/esp32/include \
esp32/include \
bootloader_support/include \
) \
$(addprefix ../../../components/, \
esp_rom/include \
+ esp_common/include \
soc/esp32/include \
esp32/include \
bootloader_support/include \
) \
$(addprefix ../../../components/, \
esp_rom/include \
+ esp_common/include \
soc/esp32/include \
esp32/include \
bootloader_support/include \
../../components/esp32/include/esp_intr_alloc.h \
## Watchdogs
## NOTE: for two lines below header_file.inc is not used
- ../../components/esp32/include/esp_int_wdt.h \
- ../../components/esp32/include/esp_task_wdt.h \
+ ../../components/esp_common/include/esp_int_wdt.h \
+ ../../components/esp_common/include/esp_task_wdt.h \
## Hooks
../../components/esp32/include/esp_freertos_hooks.h \
## Inter-Processor Call
../../components/log/include/esp_log.h \
## Base MAC address
## NOTE: for line below header_file.inc is not used
- ../../components/esp32/include/esp_system.h \
+ ../../components/esp_common/include/esp_system.h \
##
## ULP Coprocessor - API Guides
##
##
../../components/app_trace/include/esp_app_trace.h \
### Power management
- ../../components/esp32/include/esp_pm.h \
+ ../../components/esp_common/include/esp_pm.h \
../../components/esp32/include/esp32/pm.h \
### esp_timer, High Resolution Timer
- ../../components/esp32/include/esp_timer.h \
+ ../../components/esp_common/include/esp_timer.h \
### esp_event, Event Loop Library
../../components/esp_event/include/esp_event.h \
../../components/esp_event/include/esp_event_base.h \
### Ringbuffer
../../components/esp_ringbuf/include/freertos/ringbuf.h \
### Helper functions for error codes
- ../../components/esp32/include/esp_err.h \
+ ../../components/esp_common/include/esp_err.h \
### System APIs
- ../../components/esp32/include/esp_system.h \
+ ../../components/esp_common/include/esp_system.h \
### Modbus controller component header file
../../components/freemodbus/modbus_controller/mbcontroller.h
set_default(IDF_COMPONENT_DIRS "${IDF_EXTRA_COMPONENT_DIRS} ${IDF_PATH}/components")
set_default(IDF_COMPONENTS "")
- set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc")
+ set_default(IDF_COMPONENT_REQUIRES_COMMON "cxx ${IDF_TARGET} newlib freertos heap log soc esp_rom esp_common")
set(IDF_PROJECT_PATH "${CMAKE_SOURCE_DIR}")