c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.
- raspberrypidmx
- Posts: 15
- Joined: Wed Apr 27, 2016 6:15 am
- Contact:
c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.
Postby raspberrypidmx » Thu Sep 29, 2016 2:46 am
With ESP8266_RTOS_SDK 1.4.2 , the #define ICACHE_FLASH_ATTR is empty. 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
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
Re: c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.
Postby pratik » Fri Sep 30, 2016 5:50 pm
Hello Arjan,
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...
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...
- raspberrypidmx
- Posts: 15
- Joined: Wed Apr 27, 2016 6:15 am
- Contact:
Re: c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.
Postby raspberrypidmx » Thu Oct 06, 2016 11:06 pm
Hi Pratik,
Thank you for the reply. Much appreciated.
I have replaced the simple "%s\n" printf's with my own written
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
Thank you for the reply. Much appreciated.
I have replaced the simple "%s\n" printf's with my own written
Code: Select all
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
Re: c_types.h #define ICACHE_FLASH_ATTR Hence, the code is not placed in .irom.text anymore.
Postby pratik » Sat Oct 08, 2016 11:42 am
Glad it worked, thanks for sharing the links!
Take care of alignment issues though, when storing arrays in ROM.
Take care of alignment issues though, when storing arrays in ROM.

Who is online
Users browsing this forum: No registered users and 54 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.