ESP-12F intermittent problems

resca:
I used bot the real python script in Linux and the .exe version with windows. Bot are V2.3.1.
Yes, i guess esptool detects the correct amount of flash:

C:\Source\Arduino>esptool.py --chip esp8266 --baud 230400 --port COM10 flash_id

esptool.py v2.3.1
Connecting....
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 230400
Changed.
Manufacturer: e0
Device: 4016
Detected flash size: 4MB
Hard resetting via RTS pin...

C:\Source\Arduino>esptool.py --chip esp8266 --baud 230400 --port COM10 erase_flash
esptool.py v2.3.1
Connecting....
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 230400
Changed.
Erasing flash (this may take a while)...
Chip erase completed successfully in 9.9s
Hard resetting via RTS pin...

yes, it is as it should be.

the Espressif Flash Download Tool has a page for internal esp8266 settings. They are uploaded in esp-init.bin.

The arduino package has settings hardcoded and the settings are joined to sketch bin.