Commit 4a72294d authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

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.
parent 5d0d6158
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment