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?
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.
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
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.
Code Model: Banked
Device Description File: ioCC2530F256.ddf
Stack Sizes Selected:
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,
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.
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.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.