I understand this topic is quite vague.... so I'll try to explain it.
I'm working on a project in IAR Workbench. I have gotten to the point where if I add a new feature, such as a simple if statement, the entire code structure breaks. The code compiles fine and downloads to the 8051 device fine, but midway through the code's startup sequence, I lose connectivity. It's as if there is a stack overflow happening. If I pause the debugger, I see that my XdataStack and IdataStack values are low (less than 50%) and there are no stack overflows to report.
In fact, the code that causes the problem isn't even being called by the application.
This is even more evident if I enable a debug #define constant I have in my code. Enabling this causes more string constants to be built into the code for uart debugging.
Another test I performed was to created an array of 100 chars in a function that already existed
char hello[100];
memset(hello, 0x00, 100);
And this also seems to break the code.
I was wondering if there are memory areas I should look at to see if perhaps I have filled up this device (CC2540 with 128Kb flash size)
IAR lets me look into:
- IDATA
- XDATA
- SFR
- Logical Code
- Code
- Data
- Pdata
As far as my project configuration is concerned:
Stack Sizes:
- IDATA: 0xC0
- PDATA: 0x00
- XDATA: 0x280
Heap Sizes:
- XDATA: 0xFF
- Far: 0xFFF
- Far22: 0xFFF Huge: 0xFFF