Skip to content

Commit

Permalink
esp8266/modules/flashbdev: Remove code to patch bootloader flash size.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Paul Sokolovsky committed Jan 5, 2017
1 parent 5d0d615 commit 4a72294
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions esp8266/modules/flashbdev.py
Expand Up @@ -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
Expand Down

4 comments on commit 4a72294

@robert-hh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the function set_bl_flash_size() seems also to be obsolete.

@dpgeorge
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does. @pfalcon any reason to keep this function?

@pfalcon
Copy link
Contributor Author

@pfalcon pfalcon commented on 4a72294 Jan 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dpgeorge : Feel free to remove if you have a minute, or I'll get to it when I have one.

@dpgeorge
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in cc7e48f.

Please sign in to comment.