Skip to content

Commit

Permalink
Merge pull request #1244 from MaBecker/master
Browse files Browse the repository at this point in the history
ESP8266: Enable unaligned reads for ESP8266_4MB (fix #1240,#837)
  • Loading branch information
gfwilliams committed Sep 15, 2017
2 parents ef8f608 + 7b6d253 commit f9079ce
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions boards/ESP8266_4MB.py
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions libs/network/esp8266/jswrap_esp8266_network.c
Expand Up @@ -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));
Expand All @@ -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));
}
Expand Down
5 changes: 5 additions & 0 deletions make/family/ESP8266.make
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion targets/esp8266/jshardware.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit f9079ce

Please sign in to comment.