This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

The stack 'XdataStack' is filled to 95% (4174 bytes used out of 4351). The warning threshold is set to 90.%

Other Parts Discussed in Thread: CC2530, CC2430

Hello,

 

On trying to debug the code for CC2530, I get the following error at various stages of execution: "The stack 'XdataStack' is filled to 95% (4174 bytes used out of 4351). The warning threshold is set to 90.%"

 

I suspect that the stack overflows and corrupts the memory. I tried increasing the XData Stack size from 0xEFF to 0x10FF but the code bloats to fill the extra size allotted. I changed the compiler optimization level to "High" and optimized for "Size" rather than "Speed" to no avail.

 

How can I avoid the conditions that cause the above warning to show up?

 

Thanks,

 

Siddharth 

  • The following is the IAR Workbench debug screenshot. It is puzzling to see that the XData stack warning comes up even though the memory window shows only initial values in the stack. Also, this is seen even before the first instruction in main() executes.

  • In the project options dialog, try unchecking the option to run to main.  Then reload code and see if the same error exists at the moment you are at the reset vector.  If it doesn't, see if you can step through the code to find the point where it fails.

    The picture you post is curious as normally there isn't any RAM at address 0x0000 in XData space.  This data should be flash data showing through in the unified memory map but I don't see anything that looks like code here.  The 0x80 value at 0x0000 should be your reset vector and should match your dissambly window at this point.  How the debugger even gets to main is a bit of a curiosity.

    Jim Noxon

  • Jim Noxon said:
    The picture you post is curious as normally there isn't any RAM at address 0x0000 in XData space.  This data should be flash data showing through in the unified memory map but I don't see anything that looks like code here. 

    Jim, here I think you have confused the memory map of the CC2530 with the one of CC2430. In CC2530, the RAM is located at address 0x0000 in XDATA. See Page 25 of the CC253x user guide.

  • Thanks for the correction.  Note to self:  No more E2E posts from memory!  =D

    Jim Noxon

  • Hi,

    I've disabled the "Run to main" feature. The stack warning still comes up and this time on reaching "__program_start".

    The two images below are:

    1. Screenshot at reset.

     

     

    2. Screenshot at reaching __program_start, i.e. after executing the first instruction.

     

    3. On reaching ?RESET_SP, i.e. after executing second instruction.

     

    Thereafter, the stack remains full to 95% (3662 B) till the end of the program. As evident from the memory area seen above in each screenshot, they are on their initial values.

    Options selected:

    Device: CC2530F256

    Code Model: Banked

    Device Description File: ioCC2530F256.ddf

    Stack Sizes Selected:

    IDATA: 0x40

    PDATA: 0x80

    XDATA: 0xEFF

     

  • Hi,

    I've changed the "Calling convention" in the General Options. It was originally at "XDATA stack reentrant". I changed it to the only other option available viz. PDATA stack reentrant. I don't see the warning anymore but I'm worried if this will cause other issues. The change is shown in the screenshot below.

  • Hello,

    This problem is causing a major roadblock. Any help would be highly appreciated.

    Thanks in advance,

    cig

  • I had a similar issue but fixed it by getting the latest updates from IAR.  You should move back to XDATA Stack Reentrant for your builds as well.

    Jim Noxon

  • Hi Jim,

    Since I do not have a full version of IAR, I simply upgraded to the latest evaluation version. (I used to have 8.10.1 and now it's 8.10.3). I still see the same problem.

  • Hi,

    I have the same problem and my IAR version is 8.10.1.

    Matt

  • Hello all,

    I had same problem and after extending XData size, no luck. Problem: when hitting download (Ctrl + D), XData reached maximum etc..

    The solution that worked for me: after download, go to Project, Restart Debugger (Ctrl + Shift + R) and NO MORE PROBLEM (obvious for that run). If you stop the Debugging, when you start again the Debug mode, Reset again from command (Button from Debugger didn't work for me).

    Hope this helps,

    Mircea

  • I also have same issue.

    Does any one can help?

    Thanks

  • Hello,

    Have you tried my solution?

    Mircea