ESP32 IRAM and DRAM
Posted: Fri Feb 18, 2022 12:51 pm
Hello. I would like to understand more what exactly is IRAM and DRAM. After building my project, I get the following:
I am slightly worried about 87% if IRAM used. It says that 17069 bytes are remaining.
1.In my program, there are various FreeRTOS tasks running doing their thing. If it says that 17069 bytes of static IRAM is remaining, does that mean that if by any chance, my program tries to occupy more than 17069 bytes the program will crash?
What will happen if in my main.c I will allocate a buffer of lets say 18000 bytes for example:
uint8_t test_buffer[18000]={0};
2. What exactly is DRAM compared to IRAM?
3. When I declare a local variable in some function, I assume the memory is allocated in the IRAM. Is that correct?
4. What happens when I declare a global variable? Where is it placed in memory?
Code: Select all
Total sizes:
Used static DRAM: 58608 bytes ( 65972 remain, 47.0% used)
.data size: 22632 bytes
.bss size: 35976 bytes
Used static IRAM: 114003 bytes ( 17069 remain, 87.0% used)
.text size: 112976 bytes
.vectors size: 1027 bytes
Used stat D/IRAM: 172611 bytes ( 83041 remain, 67.5% used)
.data size: 22632 bytes
.bss size: 35976 bytes
.text size: 112976 bytes
.vectors size: 1027 bytes
Used Flash size : 1199003 bytes
.text : 971051 bytes
.rodata : 227696 bytes
Total image size: 1472273 bytes (.bin may be padded larger)
1.In my program, there are various FreeRTOS tasks running doing their thing. If it says that 17069 bytes of static IRAM is remaining, does that mean that if by any chance, my program tries to occupy more than 17069 bytes the program will crash?
What will happen if in my main.c I will allocate a buffer of lets say 18000 bytes for example:
uint8_t test_buffer[18000]={0};
2. What exactly is DRAM compared to IRAM?
3. When I declare a local variable in some function, I assume the memory is allocated in the IRAM. Is that correct?
4. What happens when I declare a global variable? Where is it placed in memory?