UART ISR not located in IRAM
UART ISR not located in IRAM
What are the reason why the ESP IDF uart handler code does not put the ISR into IRAM.
In the latest documentation (http://esp-idf.readthedocs.io/en/latest ... /uart.html) it states: "Do not set ESP_INTR_FLAG_IRAM here (the driver’s ISR handler is not located in IRAM)"
Is there any technical reason why I shouldn't modify esp-idf/components/driver/uart.c and set all functions to have IRAM_ATTR.
I want to do this as I need to still service the UART ISR when writing to flash as such need all the UART code to be located in IRAM. I'm just wondering if the code specifically doesn't use IRAM for a silicon bug work around.
Regards
In the latest documentation (http://esp-idf.readthedocs.io/en/latest ... /uart.html) it states: "Do not set ESP_INTR_FLAG_IRAM here (the driver’s ISR handler is not located in IRAM)"
Is there any technical reason why I shouldn't modify esp-idf/components/driver/uart.c and set all functions to have IRAM_ATTR.
I want to do this as I need to still service the UART ISR when writing to flash as such need all the UART code to be located in IRAM. I'm just wondering if the code specifically doesn't use IRAM for a silicon bug work around.
Regards
Re: UART ISR not located in IRAM
Hi fasthands,
No, I think this is just a chosen tradeoff due to the amount of code which needs moving to IRAM.
We have some features coming in future IDF versions which will make it easier to configure which code is moved into IRAM, but you should be able to modify uart.c now to do this. Just take care that all functions called by the ISR are also moved to IRAM, or you may get a crash at runtime.
(One sure-fire way to get them all is to edit the linker script components/esp32/esp32.common.ld instead, and specify that all of uart.o in libdriver.a sections .text/.rodata go to IRAM/DRAM. If you look into this file then you'll see a lot of other object files are already specified in this way. Note that this will use more IRAM because all UART functions go to IRAM, but if you have free IRAM in your project then this may not be a problem.)
Angus
No, I think this is just a chosen tradeoff due to the amount of code which needs moving to IRAM.
We have some features coming in future IDF versions which will make it easier to configure which code is moved into IRAM, but you should be able to modify uart.c now to do this. Just take care that all functions called by the ISR are also moved to IRAM, or you may get a crash at runtime.
(One sure-fire way to get them all is to edit the linker script components/esp32/esp32.common.ld instead, and specify that all of uart.o in libdriver.a sections .text/.rodata go to IRAM/DRAM. If you look into this file then you'll see a lot of other object files are already specified in this way. Note that this will use more IRAM because all UART functions go to IRAM, but if you have free IRAM in your project then this may not be a problem.)
Angus
Re: UART ISR not located in IRAM
Works well thanks for the quick reply.
-
- Posts: 62
- Joined: Wed Apr 19, 2017 6:35 am
Re: UART ISR not located in IRAM
Hi Angus,ESP_Angus wrote: No, I think this is just a chosen tradeoff due to the amount of code which needs moving to IRAM.
We have some features coming in future IDF versions which will make it easier to configure which code is moved into IRAM, but you should be able to modify uart.c now to do this. Just take care that all functions called by the ISR are also moved to IRAM, or you may get a crash at runtime.
(One sure-fire way to get them all is to edit the linker script components/esp32/esp32.common.ld instead, and specify that all of uart.o in libdriver.a sections .text/.rodata go to IRAM/DRAM. If you look into this file then you'll see a lot of other object files are already specified in this way. Note that this will use more IRAM because all UART functions go to IRAM, but if you have free IRAM in your project then this may not be a problem.)
Angus
I am facing issue while data communication of UART1 with every 10ms data is been received and same time my application access flash. I am getting fifo over flow at this time. Its not coming while flash is not being accessed while uart data is being read.
I did above solution and now no fifo overflow issue is reproducing.
So my concern is that, will this solution affect to any other functionalities in regression ? I have also created issue on github as below link,
https://github.com/espressif/esp-idf/issues/2424
And can you tell me when you guys are planning to add features to configures which code is moved into IRAM.?
Thanks.
Re: UART ISR not located in IRAM
Hi Espressif Support Team,
I am working with Rahul for ESP32 related products and we are in critical stage for issue which he has mentioned into last post. So, Would you guys check and provide feedback for same?
Let us know if need any details regarding same from our side.
I am working with Rahul for ESP32 related products and we are in critical stage for issue which he has mentioned into last post. So, Would you guys check and provide feedback for same?
Let us know if need any details regarding same from our side.
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: UART ISR not located in IRAM
Hi Espressif Developer,
Any update for last couple of questions which we have posted into this thread?
Any update for last couple of questions which we have posted into this thread?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: UART ISR not located in IRAM
Hi ESP_Angus,
Would you please check and let me know if need anything else from my side?
Would you please check and let me know if need anything else from my side?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: UART ISR not located in IRAM
Hi ESP_Angus,
Did you get chance to look into details which We have asked earlier like below?
Did you get chance to look into details which We have asked earlier like below?
Hope you have sufficient information regarding same or let me know if you need any detail for thatHi Angus,
I am facing issue while data communication of UART1 with every 10ms data is been received and same time my application access flash. I am getting fifo over flow at this time. Its not coming while flash is not being accessed while uart data is being read.
I did above solution and now no fifo overflow issue is reproducing.
So my concern is that, will this solution affect to any other functionalities in regression ? I have also created issue on github as below link,
https://github.com/espressif/esp-idf/issues/2424
And can you tell me when you guys are planning to add features to configures which code is moved into IRAM.?
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: UART ISR not located in IRAM
Hi Espressif Developer,
Would you please check few couple of posts which I have Rahul Patel have sent regarding this issue? We are in critical stage in one of our product w.r.t. this issue and looking for proper solution for that.
Let me know if need any more details regarding this from our side so that we can provide you as much as possible from our side regarding this
Would you please check few couple of posts which I have Rahul Patel have sent regarding this issue? We are in critical stage in one of our product w.r.t. this issue and looking for proper solution for that.
Let me know if need any more details regarding this from our side so that we can provide you as much as possible from our side regarding this
Regards,
Ritesh Prajapati
Ritesh Prajapati
Re: UART ISR not located in IRAM
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,
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,
Steve.
Who is online
Users browsing this forum: Baidu [Spider] and 307 guests