ESP-12F intermittent problems

I used bot the real python script with Linux and the .exe version with windows. Both are V2.3.1.
Yes, esptool detects the correct amount of flash.

Update: I had two problems!

First of all, the old and working sketches no longer work due the lwip 2.0 problem you pointed out. So, I managed to see those sketches working smoothly on the new chips. Problem solved!

At that point I focused on the new sketch, still not working, and I discovered where the problem is!

Should I call analogRead(A0), WiFi crashes. Solid problem: remove that line and the sketch works fine, insert it and WiFi ceases to work. Of course, I placed ADC_MODE(ADC_TOUT) in front of any functions.

I made several "variations": analogRead(0), analogRead(17), system_adc_read(): always the same problem. Finally I grounded the ADC pin (it was floating) with no better results.

Just as a useless (for me) final test, I set ADC_MODE(ADC_VCC) and, once I call ESP.getVcc() I have the usual crash of WiFi.

This may be a known problem?