From b0683b0bb4c22bd98aa4805ed933773fa7d8dae8 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 15 Sep 2016 02:37:54 +0800 Subject: [PATCH] components/esp32,bootloader: fix build esp32: use new register name in cpu_start bootloader: EXTRA_CFLAGS don't work any more, set global CFLAGS in Makefile.projbuild --- components/bootloader/Makefile.projbuild | 3 +++ components/bootloader/src/Makefile | 4 ++-- components/esp32/cpu_start.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/components/bootloader/Makefile.projbuild b/components/bootloader/Makefile.projbuild index cf8b05673f..d45cf144e7 100644 --- a/components/bootloader/Makefile.projbuild +++ b/components/bootloader/Makefile.projbuild @@ -45,4 +45,7 @@ $(COMPONENT_PATH)/src/sdkconfig: $(PROJECT_PATH)/sdkconfig bootloader-flash: $(BOOTLOADER_BIN) $(MAKE) -C $(BOOTLOADER_COMPONENT_PATH)/src flash MAKEFLAGS= V=$(V) +else +CFLAGS += -D BOOTLOADER_BUILD=1 -I $(IDF_PATH)/components/esp32/include + endif diff --git a/components/bootloader/src/Makefile b/components/bootloader/src/Makefile index 065593ccbf..f30e314a5f 100644 --- a/components/bootloader/src/Makefile +++ b/components/bootloader/src/Makefile @@ -11,7 +11,7 @@ COMPONENTS := esptool_py bootloader log # IS_BOOTLOADER_BUILD tells the component Makefile.projbuild to be a no-op IS_BOOTLOADER_BUILD := 1 -#We cannot include the esp32 component directly but we need its includes. This is fixed by -EXTRA_CFLAGS := -D BOOTLOADER_BUILD=1 -I $(IDF_PATH)/components/esp32/include +#We cannot include the esp32 component directly but we need its includes. +#This is fixed by adding CFLAGS from Makefile.projbuild include $(IDF_PATH)/make/project.mk diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index 4bf812238a..cb31fbd462 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -67,7 +67,7 @@ static bool app_cpu_started = false; void IRAM_ATTR call_user_start_cpu0() { //Kill wdt - REG_CLR_BIT(RTC_WDTCONFIG0, RTC_CNTL_WDT_FLASHBOOT_MOD_EN); + REG_CLR_BIT(RTC_CNTL_WDTCONFIG0_REG, RTC_CNTL_WDT_FLASHBOOT_MOD_EN); REG_CLR_BIT(0x6001f048, BIT(14)); //DR_REG_BB_BASE+48 cpu_configure_region_protection();