Skip to content

Commit f50a6c0

Browse files
me-no-devigrr
authored andcommitted
Add support for 8 and 16 MB Flash (#2351)
Add to core dev config initially
1 parent b7c7bc0 commit f50a6c0

File tree

5 files changed

+31
-15
lines changed

5 files changed

+31
-15
lines changed

boards.txt

+19
Original file line numberDiff line numberDiff line change
@@ -1826,9 +1826,28 @@ coredev.menu.FlashSize.4M3M.build.flash_size=4M
18261826
coredev.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
18271827
coredev.menu.FlashSize.4M3M.build.spiffs_start=0x100000
18281828
coredev.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
1829+
coredev.menu.FlashSize.4M3M.build.spiffs_pagesize=256
18291830
coredev.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
18301831
coredev.menu.FlashSize.4M3M.upload.maximum_size=1044464
18311832

1833+
coredev.menu.FlashSize.8M7M=8M (7M SPIFFS)
1834+
coredev.menu.FlashSize.8M7M.build.flash_size=8M
1835+
coredev.menu.FlashSize.8M7M.build.flash_ld=eagle.flash.8m.ld
1836+
coredev.menu.FlashSize.8M7M.build.spiffs_start=0x100000
1837+
coredev.menu.FlashSize.8M7M.build.spiffs_end=0x7FB000
1838+
coredev.menu.FlashSize.8M7M.build.spiffs_pagesize=256
1839+
coredev.menu.FlashSize.8M7M.build.spiffs_blocksize=8192
1840+
coredev.menu.FlashSize.8M7M.upload.maximum_size=1044464
1841+
1842+
coredev.menu.FlashSize.16M15M=16M (15M SPIFFS)
1843+
coredev.menu.FlashSize.16M15M.build.flash_size=16M
1844+
coredev.menu.FlashSize.16M15M.build.flash_ld=eagle.flash.16m.ld
1845+
coredev.menu.FlashSize.16M15M.build.spiffs_start=0x100000
1846+
coredev.menu.FlashSize.16M15M.build.spiffs_end=0x17FB000
1847+
coredev.menu.FlashSize.16M15M.build.spiffs_pagesize=256
1848+
coredev.menu.FlashSize.16M15M.build.spiffs_blocksize=8192
1849+
coredev.menu.FlashSize.16M15M.upload.maximum_size=1044464
1850+
18321851
coredev.menu.ResetMethod.ck=ck
18331852
coredev.menu.ResetMethod.ck.upload.resetmethod=ck
18341853
coredev.menu.ResetMethod.nodemcu=nodemcu

cores/esp8266/Esp.cpp

+9-12
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,10 @@ uint32_t EspClass::magicFlashChipSize(uint8_t byte) {
249249
return (2_MB);
250250
case 0x4: // 32 MBit (4MB)
251251
return (4_MB);
252-
case 0x5: // 64 MBit (8MB)
252+
case 0x8: // 64 MBit (8MB)
253253
return (8_MB);
254-
case 0x6: // 128 MBit (16MB)
254+
case 0x9: // 128 MBit (16MB)
255255
return (16_MB);
256-
case 0x7: // 256 MBit (32MB)
257-
return (32_MB);
258256
default: // fail?
259257
return 0;
260258
}
@@ -363,19 +361,19 @@ bool EspClass::checkFlashConfig(bool needsEquals) {
363361

364362
String EspClass::getResetReason(void) {
365363
char buff[32];
366-
if (resetInfo.reason == REASON_DEFAULT_RST) { // normal startup by power on
364+
if (resetInfo.reason == REASON_DEFAULT_RST) { // normal startup by power on
367365
strcpy_P(buff, PSTR("Power on"));
368366
} else if (resetInfo.reason == REASON_WDT_RST) { // hardware watch dog reset
369367
strcpy_P(buff, PSTR("Hardware Watchdog"));
370-
} else if (resetInfo.reason == REASON_EXCEPTION_RST) { // exception reset, GPIO status won’t change
368+
} else if (resetInfo.reason == REASON_EXCEPTION_RST) { // exception reset, GPIO status won’t change
371369
strcpy_P(buff, PSTR("Exception"));
372-
} else if (resetInfo.reason == REASON_SOFT_WDT_RST) { // software watch dog reset, GPIO status won’t change
370+
} else if (resetInfo.reason == REASON_SOFT_WDT_RST) { // software watch dog reset, GPIO status won’t change
373371
strcpy_P(buff, PSTR("Software Watchdog"));
374-
} else if (resetInfo.reason == REASON_SOFT_RESTART) { // software restart ,system_restart , GPIO status won’t change
372+
} else if (resetInfo.reason == REASON_SOFT_RESTART) { // software restart ,system_restart , GPIO status won’t change
375373
strcpy_P(buff, PSTR("Software/System restart"));
376-
} else if (resetInfo.reason == REASON_DEEP_SLEEP_AWAKE) { // wake up from deep-sleep
374+
} else if (resetInfo.reason == REASON_DEEP_SLEEP_AWAKE) { // wake up from deep-sleep
377375
strcpy_P(buff, PSTR("Deep-Sleep Wake"));
378-
} else if (resetInfo.reason == REASON_EXT_SYS_RST) { // external system reset
376+
} else if (resetInfo.reason == REASON_EXT_SYS_RST) { // external system reset
379377
strcpy_P(buff, PSTR("External System"));
380378
} else {
381379
strcpy_P(buff, PSTR("Unknown"));
@@ -548,5 +546,4 @@ String EspClass::getSketchMD5()
548546
md5.calculate();
549547
result = md5.toString();
550548
return result;
551-
}
552-
549+
}

cores/esp8266/flash_utils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ typedef struct {
4242
/* SPI Flash Interface (0 = QIO, 1 = QOUT, 2 = DIO, 0x3 = DOUT) */
4343
unsigned char flash_mode;
4444

45-
/* High four bits: 0 = 512K, 1 = 256K, 2 = 1M, 3 = 2M, 4 = 4M,
45+
/* High four bits: 0 = 512K, 1 = 256K, 2 = 1M, 3 = 2M, 4 = 4M, 8 = 8M, 9 = 16M
4646
Low four bits: 0 = 40MHz, 1= 26MHz, 2 = 20MHz, 0xf = 80MHz */
4747
unsigned char flash_size_freq;
4848

tools/sdk/ld/eagle.flash.16m.ld

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ MEMORY
1212
}
1313

1414
PROVIDE ( _SPIFFS_start = 0x40300000 );
15-
PROVIDE ( _SPIFFS_end = 0x41200000 );
15+
PROVIDE ( _SPIFFS_end = 0x411FB000 );
1616
PROVIDE ( _SPIFFS_page = 0x100 );
1717
PROVIDE ( _SPIFFS_block = 0x2000 );
1818

tools/sdk/ld/eagle.flash.8m.ld

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ MEMORY
1212
}
1313

1414
PROVIDE ( _SPIFFS_start = 0x40300000 );
15-
PROVIDE ( _SPIFFS_end = 0x40A00000 );
15+
PROVIDE ( _SPIFFS_end = 0x409FB000 );
1616
PROVIDE ( _SPIFFS_page = 0x100 );
1717
PROVIDE ( _SPIFFS_block = 0x2000 );
1818

0 commit comments

Comments
 (0)