ESP8266 Developer Zone The Official ESP8266 Forum 2017-02-06T10:42:42+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=3297 2017-02-06T10:42:42+08:00 2017-02-06T10:42:42+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3297&p=11241#p11241 <![CDATA[Re: question about macro "ICACHE_RODATA_ATTR"]]> For ESP8266_RTOS SDK:
Functions are located in the IROM section by default and do not need to be attributed with ICACHE_FLASH_ATTR. Interrupt handlers can also run from IROM. Hence, if functions called frequently need to be run from IRAM, they should be attributed with IRAM_ATTR.

Statistics: Posted by ESP_Xutao — Mon Feb 06, 2017 10:42 am


]]>
2017-01-27T11:03:52+08:00 2017-01-27T11:03:52+08:00 https://bbs.espressif.com:443/viewtopic.php?t=3297&p=11193#p11193 <![CDATA[question about macro "ICACHE_RODATA_ATTR"]]>

Code:

const char ICACHE_RODATA_ATTR  testFlashStr[]="test string";
const int ICACHE_RODATA_ATTR   testFlashArray[]={0,1,2,3,4,5,6,7,8,9};
void testDataInFlash()
{
   int i=0;
   while(1)
   {
      printf("%u:%s--%d\n",i++,testFlashStr,testFlashArray[i%10]);
      vTaskDelay(1000 / portTICK_RATE_MS);
   }
}

the uart print:
Fatal exception (3):
epc1=0x40101277
epc2=0x00000000
epc3=0x00000000
epcvaddr=0x4024c038
depc=0x00000000


But,removed the macro "ICACHE_RODATA_ATTR",like this:

Code:

const char testFlashStr[]="test string";
const int testFlashArray[]={0,1,2,3,4,5,6,7,8,9};
void testDataInFlash()
{
   int i=0;
   while(1)
   {
      printf("%u:%s--%d\n",i++,testFlashStr,testFlashArray[i%10]);
      vTaskDelay(1000 / portTICK_RATE_MS);
   }
}

It's OK,I was confused

Statistics: Posted by spiderweb — Fri Jan 27, 2017 11:03 am


]]>