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

idf.py size-components: Unexpected section name (IDFGH-6801) #8428

Closed
balix-microej opened this issue Feb 18, 2022 · 3 comments
Closed

idf.py size-components: Unexpected section name (IDFGH-6801) #8428

balix-microej opened this issue Feb 18, 2022 · 3 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@balix-microej
Copy link

Environment

  • Development Kit: none
  • Module or chip used: ESP32-S2
  • IDF version: v4.3.2
  • Build System: idf.py
  • Compiler version : xtensa-esp32-elf-gcc.exe (crosstool-NG esp-2021r2) 8.4.0
  • Operating System: Windows
  • (Windows only) environment type: PowerShell
  • Using an IDE?: No

Problem Description

Trying to get size info on the firmware produced. idf.py size works as expected but not idf.py size-components.

Expected Behavior

Print size info about components in an IDF project.

Actual Behavior

Command failed to run with the following error:

  File "C:\Users\balix\git\cc0158_enkiplatform-esp32-s2\enki-platform-esp32-s2-bsp\Drivers\esp-idf\tools\idf_size.py", line 248, in get_display_name_order
    assert len(split_name) == 3 and split_name[0] == '', 'Unexpected section name'
AssertionError: Unexpected section name
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
Press any key to continue . . .

If I print the sections here is what I got:

['', 'dram0', 'data']
['', 'rtc', 'data']
['', 'dram0', 'bss']
['', 'noinit']

So I assume that this section noinit does not fit the naming scheme to be processed by this script. Is there any way I can work around this?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Feb 18, 2022
@github-actions github-actions bot changed the title idf.py size-components: Unexpected section name idf.py size-components: Unexpected section name (IDFGH-6801) Feb 18, 2022
@dobairoland
Copy link
Collaborator

Hi @balix-microej. I'm sorry for the late reply. By any chance, is your project publicly available or could you share at least your MAP file from the build directory? Please be aware that the MAP file could contain sensitive information so don't share it here if it is proprietary.

As a possible fix please try to remove line no. 201:

assert len(split_name) == 3 and split_name[0] == '', 'Unexpected section name'

... and change line no. 182 from

display_name = seg_name + ('' if seg_name != 'IRAM' else split_name[1].replace('iram', '')) + f' .{split_name[2]}'

to

display_name = seg_name + ('' if seg_name != 'IRAM' else split_name[1].replace('iram', '')) + f' .{split_name[2]}' if len(split_name) >2 else ''

Please note that your line numbers could be slightly different.

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Mar 1, 2022
@balix-microej
Copy link
Author

Hi @dobairoland. No problem. I did as you advised and it worked. It seems that in fact this is normal in my case. I have a specific library included in my project that have section names that do not match the expected pattern. Thank you for your help!

@dobairoland
Copy link
Collaborator

Thanks for the feedback. The above fix will be probably included in ESP-IDF soon.

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: In Progress Work is in progress Resolution: NA Issue resolution is unavailable labels Mar 3, 2022
espressif-bot pushed a commit that referenced this issue Mar 4, 2022
espressif-bot pushed a commit that referenced this issue Mar 8, 2022
espressif-bot pushed a commit that referenced this issue Mar 8, 2022
espressif-bot pushed a commit to espressif/esp-idf-size that referenced this issue Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants