Discussion forum for the BasicX family of microcontroller chips.
|
Hello BXers, I am looking for some insight on how tasks use the stack arrays allocated to them. I have tried to run the taskexample on a BX24 - no succes. I raised the stack lenghts to 50 or more - it ran OK. Then i experimented with different lengths as descibed in the documentation. I am getting some outcomes i cannot explain. For instance: when i print the stack contents i get different results in diferrent runs. This may be because the instructions that print the stack run after the tasks terminate, by which time the stack memory has been recycled and put to use by some other commands. Then again, how can we really check the contents of the stack precisely after a task terminates? And why should resetting the processor result in diferent parts of the stack array beeing written upon? (unless the operating system shifts memory addresses with every run in order to spread eeprom wear more thinly). Well, i am certainly missing something elementary here - so, please, could someone explain? Thanks in advance George Chamilothoris |