cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

New Contributor

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
Reply
5 Replies
Moderator
Moderator

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
Reply
New Contributor

Thank you for your comment, Ryan.

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

0 Likes
Reply
Moderator
Moderator

Can the project in post#1 be built successfully?

0 Likes
Reply
Honored Contributor

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."
New Contributor

len

Thank you for your advice.

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

0 Likes
Reply