In implementing power management on an CC2530 chip set I have noticed that i get stack overflows when power management is enabled. I have byte aligned the PCON = 1; command on a 4 byte boundary but it still overflows. I have also seen this cause the device to reboot after about 10 hours of run-time which i am assuming is due to a corruption of a function pointer or some other element in data memory. The project is using a proprietary stack and power management is required as the device is using a CR2032 battery and must have long run time. I currently have the project using a large data model and xdata stack so i was wondering if there is something i can do to mitigate this issue.
below is the PM code
asm("NOP");
asm("NOP");
PCON = 0x01;
EA = 0;