how to determine needed flash size

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
tecdroid
Posts: 27
Joined: Thu Apr 08, 2021 6:22 am

how to determine needed flash size

Post by tecdroid » Wed Jan 05, 2022 5:51 pm

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?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: how to determine needed flash size

Post by dhylands » Thu Jan 06, 2022 6:00 pm

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.

wr300000
Posts: 32
Joined: Sun Jan 14, 2018 3:54 pm

Re: how to determine needed flash size

Post by wr300000 » Sat Feb 26, 2022 2:01 pm

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,

Post Reply