Part Number: TMS320F28379D
I am using the "Stack Usage" tool in CCS to get an idea of what parts of the code are taking up most space. I include a header file which, amongst other things, defines Park and Inverse Park transform functions which are not called by my current code. The sine and cosine operations within those are showing very large stack usage.
Question 1: Does the Stack Usage function show the stack usage of functions whether they are included in the final executable or not? If not, why might these unused functions be showing in my stack usage?
Question 2: Since I am using an F28379D with floating point support enabled, is it normal that the sine and cosine functions should use 636 bytes of stack each? Technical brief SPRY288B suggests as an example that a Park transform could take as little as 13 CPU cycles. I realise my implementation using sine and cosine from math.h may not be as efficient, but such large stack usage is making me suspect that a long and complex approximation is being done and there may be a problem.
void control_ab_to_dq (comp_num * p_ab,
float * p_theta,
dq_quantity * p_dq)
{
p_dq->d = p_ab->real*cos(*p_theta) + p_ab->imag*sin(*p_theta);
p_dq->q = p_ab->real*-sin(*p_theta) + p_ab->imag*cos(*p_theta);
return;
}
