kentaylor/EraseEsp8266Flash

Testing your Flash Eraser

pieman64 opened this issue · 5 comments

@kentaylor does the Serial Monitor details below look ok for the output from a WeMos D1 Mini (4M)? The device wasn't bricked before running your sketch, I just wanted to test your sketch and all seems ok.

Starting...
SDK version:1.5.2(7eee54f4)
64
j = 0
addressSucceed: 0 - 0x0
j = 1
addressSucceed: 4096 - 0x1000
j = 2
addressSucceed: 8192 - 0x2000
j = 3
addressSucceed: 12288 - 0x3000
j = 4
addressSucceed: 16384 - 0x4000
j = 5
addressSucceed: 20480 - 0x5000
j = 6
addressSucceed: 24576 - 0x6000
j = 7
addressSucceed: 28672 - 0x7000
j = 8
addressSucceed: 32768 - 0x8000
j = 9
addressSucceed: 36864 - 0x9000
j = 10
addressSucceed: 40960 - 0xa000
j = 11
addressSucceed: 45056 - 0xb000
j = 12
addressSucceed: 49152 - 0xc000
j = 13
addressSucceed: 53248 - 0xd000
j = 14
addressSucceed: 57344 - 0xe000
j = 15
addressSucceed: 61440 - 0xf000
j = 16
addressSucceed: 65536 - 0x10000
j = 17
addressSucceed: 69632 - 0x11000
j = 18
addressSucceed: 73728 - 0x12000
j = 19
addressSucceed: 77824 - 0x13000
j = 20
addressSucceed: 81920 - 0x14000
j = 21
addressSucceed: 86016 - 0x15000
j = 22
addressSucceed: 90112 - 0x16000
j = 23
addressSucceed: 94208 - 0x17000
j = 24
addressSucceed: 98304 - 0x18000
j = 25
addressSucceed: 102400 - 0x19000
j = 26
addressSucceed: 106496 - 0x1a000
j = 27
addressSucceed: 110592 - 0x1b000
j = 28
addressSucceed: 114688 - 0x1c000
j = 29
addressSucceed: 118784 - 0x1d000
j = 30
addressSucceed: 122880 - 0x1e000
j = 31
addressSucceed: 126976 - 0x1f000
j = 32
addressSucceed: 131072 - 0x20000
j = 33
addressSucceed: 135168 - 0x21000
j = 34
addressSucceed: 139264 - 0x22000
j = 35
addressSucceed: 143360 - 0x23000
j = 36
addressSucceed: 147456 - 0x24000
j = 37
addressSucceed: 151552 - 0x25000
j = 38
addressSucceed: 155648 - 0x26000
j = 39
addressSucceed: 159744 - 0x27000
j = 40
addressSucceed: 163840 - 0x28000
j = 41
addressSucceed: 167936 - 0x29000
j = 42
addressSucceed: 172032 - 0x2a000
j = 43
addressSucceed: 176128 - 0x2b000
j = 44
addressSucceed: 180224 - 0x2c000
j = 45
addressSucceed: 184320 - 0x2d000
j = 46
addressSucceed: 188416 - 0x2e000
j = 47
addressSucceed: 192512 - 0x2f000
j = 48
addressSucceed: 196608 - 0x30000
j = 49
addressSucceed: 200704 - 0x31000
j = 50
addressSucceed: 204800 - 0x32000
j = 51
addressSucceed: 208896 - 0x33000
j = 52
addressSucceed: 212992 - 0x34000
j = 53
addressSucceed: 217088 - 0x35000
j = 54
addressSucceed: 221184 - 0x36000
j = 55
addressSucceed: 225280 - 0x37000
j = 56
addressSucceed: 229376 - 0x38000
j = 57
addressSucceed: 233472 - 0x39000
j = 58
addressSucceed: 237568 - 0x3a000
j = 59
addressSucceed: 241664 - 0x3b000
j = 60
addressSucceed: 245760 - 0x3c000
j = 61
addressSucceed: 249856 - 0x3d000
j = 62
addressSucceed: 253952 - 0x3e000
j = 63
addressSucceed: 258048 - 0x3f000

Exception (0):
epc1=0x40210704 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys 
sp: 3ffffca0 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffffe40:  ffffffff 04080000 001c110c 01010000  
3ffffe50:  ffffffff 00000003 ffffff00 ffffffff  
3ffffe60:  ffffffff ffffffff ffffffff ffffffff  
3ffffe70:  4020b035 ffffffff ffffffff ffff0064  
3ffffe80:  00000000 3ffe939c ffffffd6 3ffe93ac  
3ffffe90:  3ffec550 00000036 00000001 4020f5b8  
3ffffea0:  00000001 3ffefdbc 3ffe939c 00000000  
3ffffeb0:  00000000 ffffffff ffffffff ffffffff  
3ffffec0:  ffffffff ffffffff ffffffff ffffffff  
3ffffed0:  00000000 00310101 00640100 00000000  
3ffffee0:  3ffe93c0 00000094 00000000 3ffe93b4  
3ffffef0:  00000000 3ffe93c0 3ffe93d0 3ffe93e0  
3fffff00:  00000000 00000000 3ffe93e6 3ffe943a  
3fffff10:  3ffe93fc 3ffe9418 00000000 00000000  
3fffff20:  00000000 00000000 00000036 00000000  
3fffff30:  3fff053c 4020f083 3ffec550 3ffefdbc  
3fffff40:  00000000 00000000 3ffec550 3ffe939c  
3fffff50:  00000000 000000bc 00000000 00000036  
3fffff60:  00000000 ffffffff 40204493 3ffec550  
3fffff70:  3ffe9390 3fffdcc0 3ffe8b10 3ffe8b10  
3fffff80:  00000050 3ffec550 3fffdab0 00000000  
3fffff90:  40203dbb 3fffdab0 00000000 40202537  
3fffffa0:  3ffe8b10 40000f49 3fffdab0 40000f49  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(1,6)


 ets Jan  8 2013,rst cause:4, boot mode:(1,6)

wdt reset

Yes that is the output you should see. You know it worked because a WeMos D1 Mini has 64 segments to make up 4M and j=63 means it has looped through 64 segments.

The crash at the end occurs after the setup() function completes and occurs because the loop() function is blank. It looks a bit disconcerting so maybe I should add something to the loop function.

why do you know this is Flash Erased ?
I think this is detroy bootloader
and I don't understand why j= 63
can you show me document ,my chip is ESP8266 node mcu

It is erased, but you would have to read the flash chip directly, rather than using a sketch in the ESP8266 to see it.

The boot loader is indeed lost but installing a new sketch using the Arduino IDE is hardware controlled and does not use software stored in flash. Most of the flash, including the boot loader, is overwritten every time it is programmed through the Arduino IDE so anything lost is restored next time you upload a sketch.

I understand this, how to read flash before and after erase ?

@kentaylor

Hi,
I don't show anything in serial monitor...

I attached ESP to USB and I opened serial monitor with 9600 baud rate, but I don't see anything... any help?