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
If this post has answered your question, even if not the way you wanted, please indicate so by clicking the Verify Answer button on this post.Please start a new thread if your question is not closely aligned with the original post in this thread as it makes searches more effective.If responding to a post please click the Reply button on the post you are responding to rather than merely defaulting to the bottom post.
Jim NoxonThe 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
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
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.
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.
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.
I have the same problem and my IAR version is 8.10.1.
Matt