1
votes

I am at present initializing stacks for tasks that need to be serviced upon receiving an interrupt. For an example there are 2 tasks which gets called with different periodicity, however both the tasks are using same ISR. The task with higher sample rate should interrupt the lower sample rate task and enter the same ISR. At present I am allocating stacks for the tasks and upon completion I free the stack memory. However I would like to know if MSP430 takes care of re-entrancy on it's own, so that I do not need to create and delete stack, save and restore context.

2

2 Answers

1
votes

There's only one (the current) hardware stack. So, in theory, as long as it doesn't overflow, you don't need to create dedicated stacks and you can handle interrupts on the same stack.

1
votes

The MSP430 architecture itself has no concept of tasks, i.e., there is only a single stack.

If you're using an OS, then you have to manage tasks according to the documentation of that OS.