You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
esptool.py v4.8.1
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 18:fe:34:ef:20:e5
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
WARNING: Could not auto-detect Flash size (FlashID=0x1841f, SizeID=0x1), defaulting to 4MB
Traceback (most recent call last):
File "/nix/store/cczavcnzjxdihxzaibhlab2zaag79bsk-esptool-4.8.1/bin/.esptool.py-wrapped", line 38, in<module>esptool._main()
File "/nix/store/cczavcnzjxdihxzaibhlab2zaag79bsk-esptool-4.8.1/lib/python3.12/site-packages/esptool/__init__.py", line 1314, in _main
main()
File "/nix/store/cczavcnzjxdihxzaibhlab2zaag79bsk-esptool-4.8.1/lib/python3.12/site-packages/esptool/__init__.py", line 1036, in main
operation_func(esp, args)
File "/nix/store/cczavcnzjxdihxzaibhlab2zaag79bsk-esptool-4.8.1/lib/python3.12/site-packages/esptool/cmds.py", line 491, in write_flash
if set_flash_size and set_flash_size > flash_end:
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'int' and 'NoneType'
More Information
The same error occurs even when passing an explicit flash size with --flash_size 512KB. I also noticed that flash_id shows the detected flash size as Unknown:
esptool.py -p /dev/ttyUSB0 flash_id
esptool.py v4.8.1
Serial port /dev/ttyUSB0
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 18:fe:34:ef:20:e5
Uploading stub...
Running stub...
Stub running...
Manufacturer: 1f
Device: 8401
Detected flash size: Unknown
Hard resetting via RTS pin...
Other Steps to Reproduce
No response
I Have Read the Troubleshooting Guide
I confirm I have read the troubleshooting guide.
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Exception when writing to ESP8266; flash size unknown, unable to set explicitly
Exception when writing to ESP8266; flash size unknown, unable to set explicitly (ESPTOOL-981)
Dec 24, 2024
This is caused by the flash memory chip of the Sparkfun Thing. I looked into this, the chip is Adesto AT25SF041. Esptool correctly reads the ID of the chip as Manufacturer: 1f (Adesto) Device: 8401.
Esptool detects the flash size from the Device field. Virtually all common flash memory chips manufacturers follow a common convention of storing the chip density information in the same format:
For some reason, this manufacturer reports the density code as 0x04 (see in the screenshot above) instead of the expected 0x13 for 512KB.
Nevertheless, esptool should be able to continue even if flash size is not detected correctly. The error message TypeError: '>' not supported between instances of 'int' and 'NoneType' can be patched, we will fix this.
We will also look at the possibility of adding Adesto-flavored chip memory density codes to esptool.
As a temporary solution for you, I can recommend installing esptool in development mode and disabling the failing check in the cmds.py source file (if set_flash_size and set_flash_size > flash_end).
Sorry for the inconvenience, let me know if I can help you with adding the temporary patch.
Operating System
NixOS 24.11
Esptool Version
4.8.1
Python Version
3.12.7
Chip Description
ESP8266
Device Description
Sparkfun ESP8266 Thing, using a separate Sparkfun FTDI programming board.
Hardware Configuration
No response
How is Esptool Run
No IDE, PlatformIO and manually invoked CLI
Full Esptool Command Line that Was Run
esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/ttyUSB0 --chip esp8266 write_flash -z --flash_size detect 0x0 .esphome/build/thing/.pioenvs/thing-oven/firmware.bin
Esptool Output
More Information
The same error occurs even when passing an explicit flash size with
--flash_size 512KB
. I also noticed thatflash_id
shows the detected flash size asUnknown
:Other Steps to Reproduce
No response
I Have Read the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: