UART ISR not located in IRAM

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: UART ISR not located in IRAM

Postby Ritesh » Tue Sep 25, 2018 5:13 pm

Shcreasey wrote:Hi @ESP_Angus

Would it be safe to only place functions in IRAM that are called by enabled interrupts?

For example if the pattern match interrupt is disabled can these functions be excluded safely from IRAM etc?

Thanks,
Yes. We have also query and asked few questions related to this to ESP SDK developers for same.
Regards,
Ritesh Prajapati

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: UART ISR not located in IRAM

Postby ESP_igrr » Wed Sep 26, 2018 1:05 am

Please check the following two sections of the docs on placing code into IRAM:

https://docs.espressif.com/projects/esp ... uction-ram

https://docs.espressif.com/projects/esp ... t-handlers

These discuss both the performance aspect and considerations for interrupts being called while cache is disabled.
See also this comment on a similar question on GitHub: https://github.com/espressif/esp-idf/is ... -421869837

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: UART ISR not located in IRAM

Postby Ritesh » Wed Sep 26, 2018 4:07 am

ESP_igrr wrote:Please check the following two sections of the docs on placing code into IRAM:

https://docs.espressif.com/projects/esp ... uction-ram

https://docs.espressif.com/projects/esp ... t-handlers

These discuss both the performance aspect and considerations for interrupts being called while cache is disabled.
See also this comment on a similar question on GitHub: https://github.com/espressif/esp-idf/is ... -421869837
Thanks for providing useful information.

I have one question like if I enabled whole uart.c file into IRAM from linker script then does it will create any problem in later stage as we need UART ISR to be executed as high priority with Flash APIs.
Regards,
Ritesh Prajapati

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: UART ISR not located in IRAM

Postby ESP_igrr » Wed Sep 26, 2018 6:22 am

if I enabled whole uart.c file into IRAM from linker script then does it will create any problem in later stage as we need UART ISR to be executed as high priority with Flash APIs.
It increases IRAM usage, so at later stage you may run out of IRAM if more functions are added to IRAM.
Also you do this by modifying the linker script, which makes it harder to update to new IDF version in the future.

Aside from these two, I can't think of any other possible issue.

Ritesh
Posts: 1365
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: UART ISR not located in IRAM

Postby Ritesh » Wed Sep 26, 2018 1:14 pm

ESP_igrr wrote:
if I enabled whole uart.c file into IRAM from linker script then does it will create any problem in later stage as we need UART ISR to be executed as high priority with Flash APIs.
It increases IRAM usage, so at later stage you may run out of IRAM if more functions are added to IRAM.
Also you do this by modifying the linker script, which makes it harder to update to new IDF version in the future.

Aside from these two, I can't think of any other possible issue.
Hi,

Thanks for quick response regarding that issue.

I am planning to just add uart.c file into IRAM section as we tried to enable uart driver install with IRAM FLAG as IRQ but didn't get any success for that.

We have also checked IRAM size which is about to increase 4 to 5 KB after adding uart.c into IRAM from linker script.

We are also planning to switch into newer IDF in later stage but at that time we will manage it by our-self for that.
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: No registered users and 146 guests