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

[TW#13618] make size, make size-components, make size-files doesn't seem to work with tip. #739

Closed
madscientist42 opened this issue Jun 28, 2017 · 5 comments

Comments

@madscientist42
Copy link

Captured result from an attempt to use...

FEarl@ENG110 MINGW32 /d/PetProjects/esp32/esp-idf/examples/bluetooth/ble_adv
$ make size
Traceback (most recent call last):
File "D:/PetProjects/esp32/esp-idf/tools/idf_size.py", line 229, in
main()
File "D:/PetProjects/esp32/esp-idf/tools/idf_size.py", line 153, in main
memory_config, sections = load_map_data(args.map_file)
File "D:/PetProjects/esp32/esp-idf/tools/idf_size.py", line 47, in load_map_data
sections = load_sections(map_file)
File "D:/PetProjects/esp32/esp-idf/tools/idf_size.py", line 82, in load_sections
scan_to_header(map_file, "Linker script and memory map")
File "D:/PetProjects/esp32/esp-idf/tools/idf_size.py", line 43, in scan_to_header
raise RuntimeError("Didn't find line '%s' in file" % header_line)
RuntimeError: Didn't find line 'Linker script and memory map' in file
make: *** [/d/PetProjects/esp32/esp-idf/make/project.mk:395: size] Error 1

Here's a grep for the landmark in the .map file:

FEarl@ENG110 MINGW32 /d/PetProjects/esp32/esp-idf/examples/bluetooth/ble_adv/build
$ grep Linker *.map
Linker script and memory map

For some unknown reason, it seems like Python's clipping off the map file out of the example build - the map file has the landmark section sought for the processor code. I'm looking for causes right now. Will update the issue and indicate in notes as soon as I see what gives.

@madscientist42
Copy link
Author

Looks like the Regex for the memory configuration section processor doesn't work as expected. It skims to that header for the section, can't find any lines because it's not a valid regex to parse the line, and since the code always has "result" as empty...it inhales the rest of the file. Oops.

@madscientist42
Copy link
Author

I'll tinker a bit with it and see if I can't help out with a fix here.

@projectgus
Copy link
Contributor

Thanks @madscientist42 . Maybe this is something line ending related?

@projectgus
Copy link
Contributor

projectgus commented Jun 29, 2017

Thanks again for reporting this, and sorry for the hassle. It was exactly like you said, and is fixed now (plus a sanity check to get a better error if scan_for_header() inhales the entire file.)

Fix will be merged shortly, but the change is here if you're interested:

-    RE_MEMORY_SECTION = r"(?P<name>[^ ]+) +0x(?P<origin>[\da-f]+) 0x(?P<length>[\da-f]+)"
+    RE_MEMORY_SECTION = r"(?P<name>[^ ]+) +0x(?P<origin>[\da-f]+) +0x(?P<length>[\da-f]+)"

Seems like Windows formats the map file slightly differently (maybe assumes a different line width?)

@madscientist42
Copy link
Author

madscientist42 commented Jun 29, 2017

Thanks- didn't have time yesterday like I'd thought I would with the project they had me on at work combined with getting ready to go to a SF convention that many of the major SF authors use as a get-together on this weekend. Greatly appreciated and I'll apply the patch locally because I'm trying to find an answer for the associated project that uses an ESP32.

Probably the case on Windows. As long as it works on both worlds- I'm stuck at work with the Windows side, and I use the Linux side after hours.

@FayeY FayeY changed the title make size, make size-components, make size-files doesn't seem to work with tip. [TW#13618] make size, make size-components, make size-files doesn't seem to work with tip. Jun 30, 2017
@igrr igrr closed this as completed in a8f08dc Jul 13, 2017
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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants