Hi There,
I am trying to get an idea of the RAM and Flash use of my program as I have recently bumped into a region overflow issue:
section .bss will not fit in region "m_data"
I am using the MK64FN1M0VLL12 uc with 256KB RAM and 1MB Flash.
I want to statically add an array which is 170*128*2=43520 bytes long.
From what I see in the print size before adding the array only 66560 Bytes are used in RAM so far.
Alas, I get a m_data region overflown by 31732 bytes when I add the array.
Below are code snippets and print size. What am I doing wrong?
Thanks a lot for your help,
S.
-----------------------------------------------
data.h:
extern uint16_t data_current_raw[MEASURES_MAX][BUFLEN];
data.c:
uint16_t data_current_raw[MEASURES_MAX][BUFLEN] = {{0}};
measure.c
#include "data.h"
#DEFINE MEASURES_MAX 170
#DEFINE BUFLEN 128
static uint16_t meas_data_all[MEASURES_MAX][BUFLEN] = {{0}};
(write important data in meas_data_all)
memcpy(data_current_raw, meas_data_all, sizeof(meas_data_all));
Here is the size print before adding data_current_raw:
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=sysv --totals "XXX.elf"
section size addr
.interrupts 1024 0
.flash_config 16 1024
.text 129536 1040
.ARM 8 130576
.init_array 4 130584
.fini_array 4 130588
.interrupts_ram 1024 536805376
.data 1016 536806400
.bss 50172 536807416
.heap 1024 536870912
.stack 1024 536871936
.ARM.attributes 48 0
.debug_info 266651 0
.debug_abbrev 42800 0
.debug_aranges 9744 0
.debug_ranges 10288 0
.debug_macro 243827 0
.debug_line 133816 0
.debug_str 1898995 0
.comment 112 0
.debug_frame 32100 0
.debug_loc 48696 0
.stab 156 0
.stabstr 387 0
Total 2872472