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.
Hello dear TI-Support Team,
I am using the new MSP432 P401R Launchpad and want to test the FPU. The given code composer studio 6.1 exampleproject from MSPWare "fpu_simple_floating_point_operation" in the DriverLibrary for MSP432xx shall show how efficient the FPU is.
Unfortunatelly I can't see any difference in the execution time with/without the FPU enabled by the Driverlib Function "MAP_FPU_enableModule();"
I used the LED on Port 1.0 to indicate the time for the large floatingpoiint calculation:
while(1)
{
for(ii=0;ii<200;ii++)
{
fCalculate = (sin(50.5) * (12.2f / 50.1f) * 10.22f / 3) * ii;
}
MAP_GPIO_toggleOutputOnPin(GPIO_PORT_P1, GPIO_PIN0); //should toggle faster when FPU is enabled
}
With the FPU enabled (by a button, like shown in the example) i expect a faster blinking... Is the project running correctly on the MPS432 Launchpad?
Thank you in advance,
Benjamin H.
Benjamin,
Thank you for your post. I am confirming a few things with our compiler team right now regarding the usage of FPU functions and assembly that is generated with the FPU settings enabled. As soon as I get an answer, I will update the thread here (and provide a new example if needed).
Best Regards,
Tim
Hello Katie and Dennis,
thank you very much so far for your attempts to help. I look forward to use the new Controller with all its nice new features!
Best regards,
Benjamin Herzlich
Benjamin,
After doing a little bit of research, I was able to conclude that this code example should be fundamentally changed.
When the FPU is enabled (by specifying --float_support=FPv4SPD16 in the compiler settings along with having a runtime library that supports the FPU), this means that special "VFP" floating point instructions will be generated by the compiler and used for relevant floating point operations. The FPU_enableModule/FPU_disableModule functions only enable/disable the floating point coprocessor and obviously have no bearing on what assembly is generated.
So, in summary, the short answer is that you should not have to worry about pragmatically enabling/disabling the FPU. This is done by the runtime library and compiler settings depending on what is enabled. The APIs exist for power users that might want to selectively enable/disable the FPU to save on power consumption or configure advanced aspects of the module.
I will update this example to be more relevant (and correct) and have it fixed in the next release.
Best Regards,
Tim
**Attention** This is a public forum