As the title says... Chat on...

User avatar
By scabskunk
#4608 What is the current command to see how much flash memory is available?
I have only found this command and have not found mention of it in this forum but if i am not mistaken this shows available ram?
And i ordered some chips and another esp to try them on.

Code: Select allgcinfo()

This function returns 2 values.

The first : the value of used memory.
The second: the value, of the reserved memory for the garbage collector.
garbage collector is a independent working programm, that clears memory that will not be used anymore. See also collectgarbage

Both values are in kB.

!!!!!!!!! Since lua 5.1 collectgarbage("count") has been replaced this function !!!!!!!!!!

Example:
   
    print( gcinfo()) --> 17 29
    bigString = string.rep('a', 100000) -- a lot of memory will be used
    print( gcinfo()) --> 322 197
User avatar
By brig
#4766 I am sorry for my bad english (automatic Google translation) ... :oops:

In the document "ESP8266_Specifications_v4.1-1.pdf" (on page 7) states that allowed the use of flash memory chips from 4Mbit (512KByte) to 128Mbit (16MByte). I performed this replacement:

Image

Image

I tested the module - it works as before replacement. BUT...

I write to the module several files of about 45 KB. Further write operation resets the module. After the reboot, none of the previously recorded files can not be deleted. Means LUA nodeMCU does not work with files outside the 512K?

The same steps I did on another module (new, not modified). The result is the same.

Interesting: The total size of the recorded files is about 40-60 Kbytes, it does not match the size of the flash memory ...
Memory size = 512 Kbyte
Firmware size = 508 Kbyte
---------------------------------
Total = 512 - 508 = 4 Kbyte, but recorded 40-60. Strange. Can be recorded with the destruction of the firmware?
User avatar
By GeoNomad
#4799
brig wrote:In the document "ESP8266_Specifications_v4.1-1.pdf" (on page 7) states that allowed the use of flash memory chips from 4Mbit (512KByte) to 128Mbit (16MByte). I performed this replacement:

I write to the module several files of about 45 KB. Further write operation resets the module. After the reboot, none of the previously recorded files can not be deleted. Means LUA nodeMCU does not work with files outside the 512K?

The same steps I did on another module (new, not modified). The result is the same.

Can be recorded with the destruction of the firmware?


Lua has a lot of bugs in the flash memory management at this time. I hope those will be fixed soon!

They may well have hard coded some limitations on how much memory is available to write, too.

It would be interesting to know if the memory is usable on the other IDEs without the Lua code on top...

Great to see you trying, and thanks for the snippet from the specification.

Peter
User avatar
By Warthog
#4806 How do you measure the free memory? collectgarbage("count")*1024 gives me 10220.

I have some microchip SST25VF032-80 here, maybe I give them a try. 80Mhz should be enough?