From f9c65b945c60ac17a66880ecbd76ec84e4d4ec3f Mon Sep 17 00:00:00 2001 From: Johny Mattsson Date: Wed, 22 Jun 2016 18:58:25 +1000 Subject: [PATCH] Disabled -Wl,--gc-sections for SDK libs. Running without interrupt vectors not considered all that useful... Disabled flash-size-byte-setting and SPIFFS formatting on ESP32, for now at least, as both of these appeared to corrupt the flash and prevent subsequent boots. Disabled UART init on ESP32 until the driver gets updated. This now gets us to a banner on ESP32, but not yet a prompt. --- app/.gitignore | 2 +- app/Makefile | 9 ++++++--- app/user/user_main.c | 10 ++++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/app/.gitignore b/app/.gitignore index c6d8ed75..9c0b7d03 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1,3 +1,3 @@ *.output* -mapfile +mapfile* !.gitignore diff --git a/app/Makefile b/app/Makefile index bf80decd..1416bc12 100644 --- a/app/Makefile +++ b/app/Makefile @@ -106,7 +106,7 @@ USED_SDK_LIBS= \ LINKFLAGS_eagle.app.v6 = \ -Wl,--gc-sections \ - -Wl,-Map=mapfile \ + -Wl,-Map=mapfile.$(TARGET) \ -nostdlib \ -T$(LD_FILE) \ -Wl,@$(LDDIR)/defsym.rom \ @@ -116,10 +116,13 @@ LINKFLAGS_eagle.app.v6 = \ $(TARGET_LDFLAGS) \ $(addprefix -u , $(SELECTED_MODULE_SYMS)) \ -Wl,--start-group \ - -lhal \ - $(addprefix -l,$(USED_SDK_LIBS)) \ $(DEP_LIBS_eagle.app.v6) \ -Wl,--end-group \ + -Wl,--no-gc-sections \ + -Wl,--start-group \ + $(addprefix -l,$(USED_SDK_LIBS)) \ + -lhal \ + -Wl,--end-group \ DEPENDS_eagle.app.v6 = \ $(LD_FILE) \ diff --git a/app/user/user_main.c b/app/user/user_main.c index 3e17b362..2d233483 100644 --- a/app/user/user_main.c +++ b/app/user/user_main.c @@ -43,6 +43,7 @@ void system_soft_wdt_feed (void) extern void call_user_start (void); +#if defined(__ESP8266__) /* Note: the trampoline *must* be explicitly put into the .text segment, since * by the time it is invoked the irom has not yet been mapped. This naturally * also goes for anything the trampoline itself calls. @@ -56,9 +57,10 @@ void TEXT_SECTION_ATTR user_start_trampoline (void) #endif /* The first thing call_user_start() does is switch the interrupt vector - * base, which enables our 8/16bit load handler. */ + * base, which enables our 8/16bit load handler on the ESP8266. */ call_user_start (); } +#endif // +================== New task interface ==================+ static void start_lua(task_param_t param, task_prio_t prio) { @@ -95,7 +97,8 @@ void nodemcu_init(void) return; } -#if defined(FLASH_SAFE_API) +// FIXME: this breaks horribly on the ESP32 at the moment; possibly all flash writes? +#if defined(FLASH_SAFE_API) && defined(__ESP8266__) if( flash_safe_get_size_byte() != flash_rom_get_size_byte()) { NODE_ERR("Self adjust flash size.\n"); // Fit hardware real flash size. @@ -151,10 +154,13 @@ void user_init(void) rtctime_late_startup (); #endif +#if !defined(__ESP32__) + // FIXME - need UART driver for ESP32 UartBautRate br = BIT_RATE_DEFAULT; input_sig = task_get_id(handle_input); uart_init (br, br, input_sig); +#endif #ifndef NODE_DEBUG system_set_os_print(0);