This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049: Calling Device_cal safely from optimised code

Part Number: TMS320F280049

I've had some problems with Device_cal() changing the state of CPU registers (specifically XAR3) which the compiler is using to store automatic variables.  From looking at the disassembly for Device_cal(), it doesn't appear to push CPU registers onto the stack.  I'm calling it from in an initialisation function, so before interrupts are enabled.

My optimisation settings are O2 with optimise for speed = 2.  The flags excluding include paths etc are: v28 -ml -mt --cla_support=cla2 --float_support=fpu32 --tmu_support=tmu0 --vcu_support=vcu0 -O2.

Do you have any recommendations on how to ensure that Device_cal() can be called safely from optimised code?