-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Use additional ROM functions instead of libc versions #6430
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
Comments
Dropped routines form libc.a which are present and usable in ROM: `ar dv libc.a lib_a-strcmp.o lib_a-strlen.o lib_a-strncmp.o lib_a-strstr.o lib_a-memcmp.o lib_a-memcpy.o lib_a-memmove.o lib_a-memset.o lib_a-bzero.o` Left strcpy and strncpy in libc.a because they silently support PROGMEM accesses as required by GCC optimizations. Saves ~628 bytes in AdvancedWebServer example, from IROM (not IRAM). Also allows mem* and str* routines to be safely called from inside an ISR. Prior to this PR, these routines were stored in flash and not IRAM, so they were technically illegal to call while in an ISR. Fixes esp8266#6430
Is there anything recently committed that may cause an increase of the iram usage on (stage) core 2.6.0 SDK2? N.B. I ask it here, since you've apparently been looking into resource hoggers the last few days. :) |
UMM (the memory manager) was significantly updated, that's probably the culprit. See #6274. This specific PR here, should have no effect either way on IRAM size, only on total flash usage. |
I just tried another branch (without the changed platformio.ini in the PR I linked) and it also cannot be built due to iram issues. N.B. it is the build with SDK 2 (without extra define) |
Sorry, no idea then. Check |
Could it be this one: 55539ae |
I doubt that would actually change the assembly generated significantly. Your best bet is to look at the .MAPs and see the different sizes in the .TEXT/.TEXT1 areas (i.e. IRAM). |
It appears almost all core 2.6.0 builds now run out of iram, but how do I see what amount is being used? Even the verbose build doesn't show it:
|
I'm on the phone d so can't check, but I think you get a map file even if the link fails. Check for |
There is no .map file. What takes more (iram) memory?
But I guess that maybe it is time to continue this discussion in its own issue? |
It's define by the linker file regwx matching as well as the coffee when you specify the attribute, so it's not clear cut. The larger iram will finish the link and then you just need to look at the map file. |
Dropped routines form libc.a which are present and usable in ROM: `ar dv libc.a lib_a-strcmp.o lib_a-strlen.o lib_a-strncmp.o lib_a-strstr.o lib_a-memcmp.o lib_a-memcpy.o lib_a-memmove.o lib_a-memset.o lib_a-bzero.o` Left strcpy and strncpy in libc.a because they silently support PROGMEM accesses as required by GCC optimizations. Saves ~628 bytes in AdvancedWebServer example, from IROM (not IRAM). Also allows mem* and str* routines to be safely called from inside an ISR. Prior to this PR, these routines were stored in flash and not IRAM, so they were technically illegal to call while in an ISR. Fixes #6430
The ROM provides versions of memcpy, memmove, and other standard C lib routines. Verify their functionality and then remove the copies present in the libc.a library to save program space.
Note that these libc.a versions are not stored in IRAM presently, so it is technically illegal to call them from an interrupt routine. The ROM versions have no such problem.
The text was updated successfully, but these errors were encountered: