-
Notifications
You must be signed in to change notification settings - Fork 7k
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#18001] .rtc_data and .rtc_rodata should be placed into the RTC_FAST segment #1553
Comments
Because it has different addresses on data and instruction buses would you have to split it up? Like 2k for data and 6k for code. |
right, that's was also my guess as to why the data was placed into rtc_slow in the first place. |
@rojer on the LD script side, something along these lines could work: I haven't checked whether this runs correctly though — there could be issues with CRC of RTC fast memory not being calculated correctly. Existing code might also depend on an assumption that the ULP can access variables with RTC_DATA_ATTR attribute. |
@igrr hey, nice trick! and it works, as far as i can tell - rtc_data gets placed right after rtc_text, even though their address space is different:
|
@igrr oh yeah, and there are no issues with CRC, my wake-up stub runs fine and can manipulate its data as well. as i have not got as far as working with ULP yet, i have not checked that aspect. |
Ok, good to know. Hope this workaround works for you for now. I will check if we can integrate it nicely without conflits for ULP (perhaps by adding another section attribute). |
… segment Changes: KConfig: The option CONFIG_ESP32_RTCDATA_IN_FAST_MEM is added in Kconfig file for esp32 component. esp32.common.ld: added support of RTC_DATA_ATTR, RTC_RODATA_ATTR data placement into appropriate segment according to Kconfig option. esp32.ld: linker script is modified to set alias for memory segment selected by Kconfig option to place data. The segments for force placement are added for RTC_FAST_ATTR, RTC_SLOW_ATTR attributes. esp_attr.h: added new attributes RTC_FAST_ATTR, RTC_SLOW_ATTR for force placement into fest/slow memory. test_rtc_fast.c: Added unit test cases to check data placement into appropriate memory segment. Updated documentation for RTC_DATA_ATTR, RTC_FAST_ATTR, RTC_SLOW_ATTR in deep_sleep_stub.rst file. TW#18001 Closes espressif/esp-idf#1553
Currently both are placed into the RTC_SLOW segment, which not only eats at the space available for ULP code, but also makes accessing data and constants very slow, unnecessarily so.
The text was updated successfully, but these errors were encountered: