AnsweredAssumed Answered

Is FPU working in twrK60F120m???

Question asked by David Cantero on May 26, 2014
Latest reply on May 27, 2014 by David Cantero

Hi everybody!!!!


I did some test to evaluate the performance of the floating procesing unit in the twrK60F120m. I´m using IAR 6.50 and I have configured the project to use VFPv4 in the General Options dialog as shown in the image.




I have use a "hello world" example in the MQX 4.1 version and I have added a "for loop" containing a flating point operations:


    while (1) {




           for (i = 0; i<100000; i++) {

                   d_aux = d_aux *0.9012555 + 0.11152547;




d_aux is defined as double and initialized  to zero. GPIO_Tgl is a macro for writing directly in the PTOR register of the GPIOA PIN11 to measure the time elapsed in the loop.

I have measured elapsed time using a oscilloscope and I obtained 125ms to compute all 100000 operations, so aproximátely 1.25us per loop (aprox 150 clock cicles). This time looks an order of magnitude bigger than expected (maybe due to "hidden" instructions not explicitly showed in the code above??)  but when I disabled the FPU unit in the "General Options" dialog and repeated the same test I have obtained EXACTLY THE SAME RESULT!!!!!  I have done many test using divisions and "sqrt" and I have never found differences when disabling the FPU. So my question is, Is the FPU actually working in the Tower system using MQX 4.1? If yes, It is posible to optimize the code to be closer to the theorethical performance of the FPU? If not, How can I put the FPU working?  I spent some time searching in the Freescale web, consulting the processor manuals, in the communities, but the information about FPU is poor and abstruse. Where can I get moreinformation about this issue?


Thanks in advance!!!