From c7c88feae4195f63e37277bca7844a7188c2f726 Mon Sep 17 00:00:00 2001 From: HuangRui Date: Wed, 11 Feb 2015 21:01:57 +0800 Subject: [PATCH 1/2] Add 8M and 16M fixed flash size options. --- app/include/user_config.h | 2 ++ app/platform/cpu_esp8266.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/app/include/user_config.h b/app/include/user_config.h index b62fd87b..6eaebe1b 100644 --- a/app/include/user_config.h +++ b/app/include/user_config.h @@ -13,6 +13,8 @@ // #define FLASH_1M // #define FLASH_2M // #define FLASH_4M +// #define FLASH_8M +// #define FLASH_16M #define FLASH_AUTOSIZE // #define DEVELOP_VERSION #define FULL_VERSION_FOR_USER diff --git a/app/platform/cpu_esp8266.h b/app/platform/cpu_esp8266.h index 6e98e18a..75a238dc 100644 --- a/app/platform/cpu_esp8266.h +++ b/app/platform/cpu_esp8266.h @@ -25,6 +25,10 @@ #define FLASH_SEC_NUM 0x200 #elif defined(FLASH_4M) #define FLASH_SEC_NUM 0x400 +#elif defined(FLASH_8M) +#define FLASH_SEC_NUM 0x800 +#elif defined(FLASH_16M) +#define FLASH_SEC_NUM 0x1000 #elif defined(FLASH_AUTOSIZE) #define FLASH_SEC_NUM (flash_get_sec_num()) #else From 5d9caf23b614c7626c2ef818f5cff453e068be66 Mon Sep 17 00:00:00 2001 From: HuangRui Date: Wed, 11 Feb 2015 21:16:48 +0800 Subject: [PATCH 2/2] Support 64Mbit and 128Mbit flash size auto detection. --- app/platform/flash_api.c | 6 ++++++ app/platform/flash_api.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/app/platform/flash_api.c b/app/platform/flash_api.c index f98621ab..3fde416b 100644 --- a/app/platform/flash_api.c +++ b/app/platform/flash_api.c @@ -56,6 +56,12 @@ uint32_t flash_get_size_byte(void) case SIZE_32MBIT: // 32Mbit, 4MByte flash_size = 4 * 1024 * 1024; + case SIZE_64MBIT: + // 64Mbit, 8MByte + flash_size = 8 * 1024 * 1024; + case SIZE_128MBIT: + // 128Mbit, 16MByte + flash_size = 16 * 1024 * 1024; break; default: // Unknown flash size, fall back mode. diff --git a/app/platform/flash_api.h b/app/platform/flash_api.h index 929ca998..82d681e3 100644 --- a/app/platform/flash_api.h +++ b/app/platform/flash_api.h @@ -52,6 +52,8 @@ typedef struct SIZE_8MBIT = 2, SIZE_16MBIT = 3, SIZE_32MBIT = 4, + SIZE_64MBIT = 5, + SIZE_128MBIT = 6, } size : 4; } ICACHE_STORE_TYPEDEF_ATTR SPIFlashInfo;