Page 1 of 1

how to determine needed flash size

Posted: Wed Jan 05, 2022 5:51 pm
by tecdroid
hi again,
stupid question. How can I determine the size of my compiled micropython to fit it into my flash.
standard stm32 only has 90kb of program space left and i wonder if i can resize it a little..

btw: is micropython capable of handling spi flash like AT45DB321E-SHF and how do i tell it to use it?

Re: how to determine needed flash size

Posted: Thu Jan 06, 2022 6:00 pm
by dhylands
When you build the firmware, it prints the size, something like this:

Code: Select all

LINK build-PYBV11/firmware.elf
   text	   data	    bss	    dec	    hex	filename
 368392	     16	  27424	 395832	  60a38	build-PYBV11/firmware.elf
The size of the "text" section is the amount of space needed for code. The "data" section corresponds to global variables, and their initial value is stored in flash. The values used during runtime is stored in RAM. The "bss" section is zero-ed global variables and is only stored in RAM.

So the total amount of flash needed is text + data + filesystem
The total amount of RAM needed is data + bss + stack + heap.

Re: how to determine needed flash size

Posted: Sat Feb 26, 2022 2:01 pm
by wr300000
Hello,
This is another stupid question. What is current maximum compiled flash size that we can reach on ESP8266, ESP32GENERIC and ESP32 SPIRAM.
your response is much appreciated,