Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 4a72294

Browse files
author
Paul Sokolovsky
committed
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.
1 parent 5d0d615 commit 4a72294

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

esp8266/modules/flashbdev.py

-15
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,6 @@ def set_bl_flash_size(real_size):
4646
esp.flash_erase(0)
4747
esp.flash_write(0, buf)
4848

49-
# If bootloader size ID doesn't correspond to real Flash size,
50-
# fix bootloader value and reboot.
51-
size = esp.flash_id() >> 16
52-
# Check that it looks like realistic power of 2 for flash sizes
53-
# commonly used with esp8266
54-
if 22 >= size >= 18:
55-
size = 1 << size
56-
if size != esp.flash_size():
57-
import machine
58-
import time
59-
print("Bootloader Flash size appear to have been set incorrectly, trying to fix")
60-
set_bl_flash_size(size)
61-
machine.reset()
62-
while 1: time.sleep(1)
63-
6449
size = esp.flash_size()
6550
if size < 1024*1024:
6651
bdev = None

0 commit comments

Comments
 (0)