summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-12-20 22:57:51 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-12-20 22:57:51 +0300
commitc1e94b77a4b869b1198176910227d21e87d46664 (patch)
tree72fd9494b49473041686e7c140cf3cbe520c6791 /esp8266
parent5d06a743035d942e9fbde924f85dd56992d97419 (diff)
downloadmicropython-c1e94b77a4b869b1198176910227d21e87d46664.tar.gz
micropython-c1e94b77a4b869b1198176910227d21e87d46664.zip
esp8266/modesp: flash_user_start(): Support configuration with yaota8266.
It's pretty rough way to detect yaota8266 being used, but otherwise allows to have a filesystem in such config.
Diffstat (limited to 'esp8266')
-rw-r--r--esp8266/modesp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index 4403dfde4b..1cd231f79f 100644
--- a/esp8266/modesp.c
+++ b/esp8266/modesp.c
@@ -629,7 +629,13 @@ STATIC mp_obj_t esp_flash_size(void) {
STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_size_obj, esp_flash_size);
STATIC mp_obj_t esp_flash_user_start(void) {
- return MP_OBJ_NEW_SMALL_INT(0x90000);
+ if ((*(uint32_t*)0x40200000 & 0xff00) == 0x100) {
+ // If there's just 1 loadable segment at the start of flash,
+ // we assume there's a yaota8266 bootloader.
+ return MP_OBJ_NEW_SMALL_INT(0x3c000 + 0x90000);
+ } else {
+ return MP_OBJ_NEW_SMALL_INT(0x90000);
+ }
}
STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_flash_user_start_obj, esp_flash_user_start);