Build error: region RAM overflowed with stack

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
yuna_4671381
Level 1
Level 1

The device is developed using PSOC5 (PSoc Creator 4.3) on CY8C5888AXI-LP096.

The compiler uses "ARM GCC 5.4-2016-q2-update".

The upper part of the following if statement is normal, but the lower part gives a compile error.

Please tell me the cause.

prj.M0120:Build error: region RAM overflowed with stack

int KaDIM[2][5] ={0};

const KaDIM_ini[2][5] = { {1,2,3,4,5} ,{7,8,9,10,11}};

#if 0

     KaDIM[0][0] = KaDIM_ini[0][0];

     KaDIM[0][1] = KaDIM_ini[0][1];

     KaDIM[0][2] = KaDIM_ini[0][2];

     KaDIM[0][3] = KaDIM_ini[0][3];

     KaDIM[0][4] = KaDIM_ini[0][4];

     KaDIM[1][0] = KaDIM_ini[1][0];

     KaDIM[1][1] = KaDIM_ini[1][1];

     KaDIM[1][2] = KaDIM_ini[1][2];

     KaDIM[1][3] = KaDIM_ini[1][3];

     KaDIM[1][4] = KaDIM_ini[1][4];

#else

     for(int i=0;i<2;i++)

     {

          for(int j=0;j<5;j++)

          {

               KaDIM = KaDIM_ini;

          }

     }

#endif

0 Likes
5 Replies
lock attach
Attachments are accessible only for community members.
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

I tried the code, building and compiling is OK.

Attached is the project.

According to the error log "prj.M0120:Build error: region RAM overflowed with stack", could you try using a larger stack size and try again?

pastedImage_2.png

Best Regards,

Ryan

0 Likes

Thank you for your comment, Ryan.

Even if the stack size is increased, the same error will occur.

0 Likes

Can the project in post#1 be built successfully?

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

yuna,

I find one potential issue with your code:

const KaDIM_ini[2][5] = { {1,2,3,4,5} ,{7,8,9,10,11}};

You don't specify the size of the KaDIM_ini variable.

Use instead:

const int KaDIM_ini[2][5] = { {1,2,3,4,5} ,{7,8,9,10,11}};

Len

Len
"Engineering is an Art. The Art of Compromise."

len

Thank you for your advice.

In the actual source code, it is correctly defined as an int type.

0 Likes