Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
9eda352e
Commit
9eda352e
authored
Jul 02, 2015
by
Johny Mattsson
Browse files
Workaround for DIO mode leaving flash in write-protect.
parent
8394333c
Changes
1
Show whitespace changes
Inline
Side-by-side
tools/esptool.py
View file @
9eda352e
...
@@ -262,6 +262,15 @@ class ESPROM:
...
@@ -262,6 +262,15 @@ class ESPROM:
return
data
return
data
""" Abuse the loader protocol to force flash to be left in write mode """
def
flash_unlock_dio
(
self
):
# Enable flash write mode
self
.
flash_begin
(
0
,
0
)
# Reset the chip rather than call flash_finish(), which would have
# write protected the chip again (why oh why does it do that?!)
self
.
mem_begin
(
0
,
0
,
0
,
0x40100000
)
self
.
mem_finish
(
0x40000080
)
""" Perform a chip erase of SPI flash """
""" Perform a chip erase of SPI flash """
def
flash_erase
(
self
):
def
flash_erase
(
self
):
# Trick ROM to initialize SFlash
# Trick ROM to initialize SFlash
...
@@ -560,6 +569,9 @@ if __name__ == '__main__':
...
@@ -560,6 +569,9 @@ if __name__ == '__main__':
seq
+=
1
seq
+=
1
print
print
print
'
\n
Leaving...'
print
'
\n
Leaving...'
if
args
.
flash_mode
==
'dio'
:
esp
.
flash_unlock_dio
()
else
:
esp
.
flash_finish
(
False
)
esp
.
flash_finish
(
False
)
elif
args
.
operation
==
'run'
:
elif
args
.
operation
==
'run'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment