Posted: Thu Feb 13, 2014 7:47 am Post subject: easiest way to calculate stack compiler sizes?
Is there any easy way to calculate the correct sizes needed for the HW/SW/Slack stacks in the compiler? Reason I ask is i ran into a weird bug on a very complex program that I had written that every great once in awhile the FLASH will "deprogram" itself.
Hard to explain, but it all works fine but one random day itll crash and burn hard with no response, as if it wasnt programmed. Reflashing the micro via bootloader brings it back online.
I am using BOD, etc.. So I am beginning to suspect a stack issue and its returning into the wrong entry point of an instruction causing a mis-interpretation and maybe its mistaking a jump for an SPM or something weird. Ive had weird things happen in the past with other projects and firmware that work fine, then hard-locks occur that only the watchdog will kick it out. But I digress...
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
Posted: Thu Feb 13, 2014 6:44 pm Post subject:
Hi,
Have a look at the "stackcheck.lib" in the help text.
I've used it on a fairly large program (2500 lines of code) and although it took about 2 days to find the stack Overflow I'm now 100% sure there aren't any stack problems.
If you have enough ram just increase the stack values to very large values is another solution.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum