diff --git a/ChangeLog b/ChangeLog index 3a6e59c050..800e4bfe7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ Add `E.errorFlag` event to allow JS to respond to internal errors Use Esc[J VT100 code when cycling through command history (much faster REPL on low bandwidth connections) ESP8266: Remove debugger again as it will never work on 8266 + ESP8266: Enable unaligned reads for ESP8266_4MB (fix #1240,#837) + ESP8266: move code save section to fist partition for memory mapping for ESP8266_4MB (fix #1240) ESP8266: Add GPIO16 as D16 without watch (#1206) but soft PWM/I2C/SPI/etc 1v94 : Allow Espruino boards to reset straight out of the DFU Bootloader diff --git a/boards/ESP8266_4MB.py b/boards/ESP8266_4MB.py index d82e5b57b4..65b399a6ac 100644 --- a/boards/ESP8266_4MB.py +++ b/boards/ESP8266_4MB.py @@ -51,8 +51,8 @@ 'adc' : 1, 'dac' : 0, 'saved_code' : { - # 0x300000 + 4096 * (256 - 16save - 1wifi -4reserved) - 'address' : 0x3EB000, # first page is used for wifi save + # 0x000000 + 4096 * (256 - 16save - 1wifi -4reserved) + 'address' : 0x0EB000, # first page is used for wifi save 'page_size' : 4096, 'pages' : 16, 'flash_available' : 940, # firmware can be up to this size diff --git a/libs/network/esp8266/jswrap_esp8266_network.c b/libs/network/esp8266/jswrap_esp8266_network.c index 272229308b..30094c4b60 100644 --- a/libs/network/esp8266/jswrap_esp8266_network.c +++ b/libs/network/esp8266/jswrap_esp8266_network.c @@ -842,8 +842,8 @@ void jswrap_wifi_save(JsVar *what) { conf->crc = crc32((uint8_t*)flashBlock, sizeof(flashBlock)); DBG("Wifi.save: len=%d vers=%d crc=0x%08lx\n", conf->length, conf->version, (long unsigned int) conf->crc); if (map == 6 ) { - jshFlashErasePage( 0x3FB000); - jshFlashWrite(conf,0x3FB000, sizeof(flashBlock)); + jshFlashErasePage( 0x0FB000); + jshFlashWrite(conf,0x0FB000, sizeof(flashBlock)); } else { jshFlashErasePage(0x7B000); jshFlashWrite(conf, 0x7B000, sizeof(flashBlock)); @@ -858,7 +858,7 @@ void jswrap_wifi_restore(void) { os_memset(flashBlock, 0, sizeof(flashBlock)); uint32_t map = system_get_flash_size_map(); if (map == 6 ) { - jshFlashRead(flashBlock, 0x3FB000, sizeof(flashBlock)); + jshFlashRead(flashBlock, 0x0FB000, sizeof(flashBlock)); } else { jshFlashRead(flashBlock, 0x7B000, sizeof(flashBlock)); } diff --git a/make/family/ESP8266.make b/make/family/ESP8266.make index 6c16eca09f..8871a0577e 100644 --- a/make/family/ESP8266.make +++ b/make/family/ESP8266.make @@ -66,6 +66,11 @@ CFLAGS+= -fno-builtin \ -Wno-parentheses -Wno-type-limits -Wno-unused-function -Wno-unused-value \ -Wl,EL -Wl,--gc-sections -nostdlib -mlongcalls -mtext-section-literals +# only use mfore-l32 if 4MB board for now +ifdef FLASH_4MB +CFLAGS += -mforce-l32 +endif + # # The Root of the ESP8266_SDK distributed by Espressif # This must be supplied as a Make environment variable. diff --git a/targets/esp8266/jshardware.c b/targets/esp8266/jshardware.c index 8bd2d5f0a1..59c2678b13 100644 --- a/targets/esp8266/jshardware.c +++ b/targets/esp8266/jshardware.c @@ -1340,7 +1340,7 @@ JsVar *jshFlashGetFree() { addFlashArea(jsFreeFlash, 0x300000, 0x40000); addFlashArea(jsFreeFlash, 0x340000, 0x40000); addFlashArea(jsFreeFlash, 0x380000, 0x40000); - addFlashArea(jsFreeFlash, 0x3C0000, 0x40000-0x15000); + addFlashArea(jsFreeFlash, 0x3C0000, 0x40000); return jsFreeFlash; }