From fee987d5cf22c297fb2de53c6623e8a49653d5f9 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Sat, 7 May 2016 18:33:43 +1000 Subject: [PATCH] Startup code: Move user_start_phase2 to irom section This saves 1020 bytes from the text (IRAM) section by preventing inlining of user_start_phase2() (and dump_flash_config_sectors() as well) into the IRAM function sdk_user_start(). --- core/app_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app_main.c b/core/app_main.c index 2f4f7f1..19bf73e 100644 --- a/core/app_main.c +++ b/core/app_main.c @@ -411,7 +411,7 @@ extern void (*__init_array_start)(void); extern void (*__init_array_end)(void); // .Lfunc009 -- .irom0.text+0x5b4 -static void user_start_phase2(void) { +static __attribute__((noinline)) void user_start_phase2(void) { uint8_t *buf; uint8_t *phy_info; @@ -483,7 +483,7 @@ static void dump_flash_sector(uint32_t start_sector, uint32_t length) { } // .Lfunc011 -- .irom0.text+0x790 -static void dump_flash_config_sectors(uint32_t start_sector) { +static __attribute__((noinline)) void dump_flash_config_sectors(uint32_t start_sector) { printf("system param error\n"); // Note: original SDK code didn't dump PHY info printf("phy_info:\n");