Writing to internal flash nodemcu v3


#1

Testing simple code:

try:
    ff = flash.FlashFileStream(0x40300000 - 4, 4)
    payload = 100
    ff.write(payload)
    print("Call flush")
    ff.flush()
    print("Call close")
    ff.close()
except Exception as e:
    print("FlashFileStream exception:")
    print(e)

This code just must write in last 4 bytes of flash an integer value.

Line ff.flush() raise exception:

TypeError @[0081:0010:0000:005A:0000:0000:0000:0000]

Uplink output:

[info] Probe sent
[info] Got header: r2.1.1 yXN2r4cuRtWOIkD35ELTyQ nodemcu3 7460000020008fe546000b0000c5fcf7 ZERYNTH
[info] Found VM yXN2r4cuRtWOIkD35ELTyQ for nodemcu3
[info] Handshake
[info]     symbols: 3
[info]     membase  @3FFF166C
[info]     romstart @40270000
[info]     flash    @00090000

It’s looks like a some bug… What do you think?


#2

Please helps!! Very important function, but it doesn’t work((