From 4a72294d7d494ae3231e7bad74f57baaa4da088c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 5 Jan 2017 22:26:23 +0300 Subject: [PATCH] esp8266/modules/flashbdev: Remove code to patch bootloader flash size. This code is no longer pertinent for some time - since switchover to SDK2.0, there must be correct flash size set for bootloader, or there's a risk of flash data corruption. And indeed, the correct flash size is by default auto-detected by esptool.py 1.2. --- esp8266/modules/flashbdev.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/esp8266/modules/flashbdev.py b/esp8266/modules/flashbdev.py index 64f0363f96..68cb3afe82 100644 --- a/esp8266/modules/flashbdev.py +++ b/esp8266/modules/flashbdev.py @@ -46,21 +46,6 @@ def set_bl_flash_size(real_size): esp.flash_erase(0) esp.flash_write(0, buf) -# If bootloader size ID doesn't correspond to real Flash size, -# fix bootloader value and reboot. -size = esp.flash_id() >> 16 -# Check that it looks like realistic power of 2 for flash sizes -# commonly used with esp8266 -if 22 >= size >= 18: - size = 1 << size - if size != esp.flash_size(): - import machine - import time - print("Bootloader Flash size appear to have been set incorrectly, trying to fix") - set_bl_flash_size(size) - machine.reset() - while 1: time.sleep(1) - size = esp.flash_size() if size < 1024*1024: bdev = None