ESP8266 Developer Zone The Official ESP8266 Forum 2016-10-08T11:42:07+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=2823 2016-10-08T11:42:07+08:00 2016-10-08T11:42:07+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2823&p=10075#p10075 <![CDATA[Re: c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.]]> Take care of alignment issues though, when storing arrays in ROM. :)

Statistics: Posted by Guest — Sat Oct 08, 2016 11:42 am


]]>
2016-10-06T23:06:00+08:00 2016-10-06T23:06:00+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2823&p=10064#p10064 <![CDATA[Re: c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.]]>
Thank you for the reply. Much appreciated.

I have replaced the simple "%s\n" printf's with my own written

Code:

int __attribute__((section(".irom0.text"))) uart0_puts(const char *s) {
   char c;
   int i = 0;;

   while ((c = *s++) != (char) 0) {
      i++;
      uart0_putc(c);
   }

   return i;
}


This reduces the amount of RAM being used.

The complete code be found here -> https://github.com/vanvught/rpidmx512/tree/master/esp8266_rtos_sdk_rpi
With the Raspberry Pi code here -> https://github.com/vanvught/rpidmx512/tree/master/lib-esp8266

Statistics: Posted by raspberrypidmx — Thu Oct 06, 2016 11:06 pm


]]>
2016-09-30T17:50:38+08:00 2016-09-30T17:50:38+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2823&p=10002#p10002 <![CDATA[Re: c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.]]>
The LD files contain where the code will be placed by default. Please make sure you are using a freshly downloaded, unmodified copy of the SDK with the original LD files.
Also, if you are getting the error that code cannot fit in IRAM, it might be because you have large printf logs or large constant arrays that are getting stored in RAM...

Statistics: Posted by Guest — Fri Sep 30, 2016 5:50 pm


]]>
2016-09-29T02:46:09+08:00 2016-09-29T02:46:09+08:00 https://bbs.espressif.com:443/viewtopic.php?t=2823&p=9966#p9966 <![CDATA[c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.]]>
According to the manual "ESP8266 RTOS SDK Programming Guide Version 1.4.0" -> "Since ESP8266_RTOS_SDK_v1.2.0, functions are stored in CACHE area by default, need not be added ICACHE_FLASH_ATTR any more."

When I compile my project with void user_init(void) , then I get the error :
build/app.out section `.text' will not fit in region `iram1_0_seg'

When I compile my project with void __attribute__((section(".irom0.text"))) user_init(void) , then the compile is going fine:
Generate user1.1024.new.2.bin successully in folder firmware/upgrade

Seems to me that the function are not stored by default in CACHE area.

Please advice.

Thanks, Arjan

Statistics: Posted by raspberrypidmx — Thu Sep 29, 2016 2:46 am


]]>