关于ICACHE_FLASH_ATTR的用法
Re: 关于ICACHE_FLASH_ATTR的用法
Postby mariuszb » Thu Dec 10, 2015 7:03 pm
I would like to understand it well:
1. Functions with ICACHE_FLASH_ATTR are in FLASH and downloaded to IRAM "on execution demand"
2. Functions without ICACHE_FLASH_ATTR are from the beginning in the IRAM
Questions to point 2:
- Are they there permanently ?
- or in the absence of memory erased and then re-loaded like ICACHE_FLASH_ATTR ?
- if they are still in memory and will be a lot of such functions does not run out of cache for ICACHE_FLASH_ATTR function ?
or the only difference is that the functions are loaded into the cache at the beginning and further there is no difference between functions with and without attribute ICACHE_FLASH_ATTR ?
Thanks for ansver
1. Functions with ICACHE_FLASH_ATTR are in FLASH and downloaded to IRAM "on execution demand"
2. Functions without ICACHE_FLASH_ATTR are from the beginning in the IRAM
Questions to point 2:
- Are they there permanently ?
- or in the absence of memory erased and then re-loaded like ICACHE_FLASH_ATTR ?
- if they are still in memory and will be a lot of such functions does not run out of cache for ICACHE_FLASH_ATTR function ?
or the only difference is that the functions are loaded into the cache at the beginning and further there is no difference between functions with and without attribute ICACHE_FLASH_ATTR ?
Thanks for ansver

Re: 关于ICACHE_FLASH_ATTR的用法
Postby ESP_Faye » Fri Dec 11, 2015 3:03 pm
Hi,
Please refer to this topic http://bbs.espressif.com/viewtopic.php?f=7&t=1183&start=10#p5000.
Thanks for your interest in ESP8266 !
Please refer to this topic http://bbs.espressif.com/viewtopic.php?f=7&t=1183&start=10#p5000.
Thanks for your interest in ESP8266 !
Re: 关于ICACHE_FLASH_ATTR的用法
Postby jinhucn » Tue Jan 05, 2016 4:39 pm
Espressif_Faye wrote:您好,
ICACHE_FLASH_ATTR 是 ESP8266_NONOS_SDK 才需要添加的宏,ESP8266_RTOS_SDK 默认使用这个宏,无需特别添加。
如果是一开始就加载到 RAM 的函数,将始终在 RAM 中。在 CACHE 中的函数,才是仅调用时才加载到 CACHE 中。
感谢您对 ESP8266 的关注!
加载到CACHE中的函数应该是用完了就会被置换出去的吧,那么user_rf_pre_init和user_init通常只需要运行一次,为什么你们给的例子中没有使用ICACHE_FLASH_ATTR?
Who is online
Users browsing this forum: No registered users and 2 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.