Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core 3.1.x: static and flash memory usage messages from compiler seem corrupted #8896

Open
5 tasks done
bxparks opened this issue Mar 24, 2023 · 1 comment
Open
5 tasks done

Comments

@bxparks
Copy link

bxparks commented Mar 24, 2023

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • [how do I do this?] I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [3.1.2]
  • Development Env: [Arduino IDE 1.8.19]
  • Operating System: [Ubuntu]

Settings in IDE 1.8.19

--board esp8266:esp8266:nodemcuv2:xtal=80,vt=flash,exception=disabled,ssl=all,eesz=4M2M,led=2,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600

  • Module: [Nodemcu]
  • Flash Mode: [???]
  • Flash Size: [4MB/2MB]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [???]
  • Flash Frequency: [???]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200]

Problem Description

Prior to 3.1.x (e.g. 3.0.2), the compiler printed a summary of the static and flash memory usage that was formatted like this:

Executable segment sizes:
ICACHE : 32768       	- flash instruction cache
IROM   : 231500      	- code in flash     	(default or ICACHE_FLASH_ATTR)
IRAM   : 26217   / 32768 - code in IRAM      	(IRAM_ATTR, ISRs...)
DATA   : 1496  )     	- initialized variables (global, static) in RAM/HEAP
RODATA : 876   ) / 81920 - constants         	(global, static) in RAM/HEAP
BSS	: 25520 )     	- zeroed variables  	(global, static) in RAM/HEAP

Sketch uses 260089 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27892 bytes (34%) of dynamic memory, leaving 54028 bytes for local variables. Maximum is 81920 bytes.

In 3.1.0, (and verified to be the same in 3.1.2), that changed to something like this, with a bunch of ? question marks, with no final summary lines:

. Variables and constants in RAM (global, static), used 28008 / 80192 bytes (34%)
???   SEGMENT  BYTES	DESCRIPTION
????????? DATA 	1496 	initialized variables
????????? RODATA   920  	constants  	 
????????? BSS  	25592	zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 59143 / 65536 bytes (90%)
???   SEGMENT  BYTES	DESCRIPTION
????????? ICACHE   32768	reserved space for flash instruction cache
????????? IRAM 	26375	code in IRAM    
. Code in flash (default, ICACHE_FLASH_ATTR), used 231636 / 1048576 bytes (22%)
???   SEGMENT  BYTES	DESCRIPTION
????????? IROM 	231636   code in flash

Expected Result

  1. Those ????????? seem to indicate corrupted strings.

  2. Print the 2 summary lines in the format of:

Sketch uses 260089 bytes (24%) of program storage space. Maximum is 1044464 bytes.
Global variables use 27892 bytes (34%) of dynamic memory, leaving 54028 bytes for local variables. Maximum is 81920 bytes.

for readability and compatibility with other cores.

MCVE Sketch

A blank sketch is sufficient to see this.

#include <Arduino.h>
void setup() {}
void loop() {}

Debug Messages

@mcspr
Copy link
Collaborator

mcspr commented Mar 25, 2023

Python forced into UTF-8 mode for the size script, and we kind of expect linux systems to use that by default.
#8570
#8573
(which may be wrong assumption within IDE)

More output is the point here, basic size pattern is... too basic (but, still print it in verbose mode)
#8572 already mentioned that original size pattern is pretty limiting and does not integrate with IDE all too well, but arduino-cli starting with 0.21 has recipe.advanced_size.pattern for IDE ≥2.0 which can be used instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants