- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dears,
I would like to test FPU in PSOC6 in modus toolbox 2.4 environment
I installed CMSIS DSP and set all variables in makefile (DEFINES, INCLUDES, LDLIBS as noted in another posts like https://community.infineon.com/t5/PSoC-6/How-to-use-ARM-CMSIS-DSP-lib-in-ModusToolbox2-4/m-p/342494 ...) when VFP_SELECT=hardfp all source codes compiles ok and project seems to run normally but I still think that FPU is not used... So I would like also test with "software emulated" and compare execution time.
But when I set makefile variable VFP_SELECT=softfp or to empty value (as default) But now I got compilation errors like this "ld.exe: failed to merge target specific data of file...":
Linking output file mtb-example-psoc6-lptimer.elf
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: error: ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_sin_f32.o) uses VFP register arguments, C:/Users/xxxx/mtw/Low-Power_Timer/build/CY8CKIT-062-WIFI-BT/Debug/mtb-example-psoc6-lptimer.elf does not
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_sin_f32.o)
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: error: ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_cos_f32.o) uses VFP register arguments, C:/Users/xxx/mtw/Low-Power_Timer/build/CY8CKIT-062-WIFI-BT/Debug/mtb-example-psoc6-lptimer.elf does not
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_cos_f32.o)
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: error: ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_mult_f32.o) uses VFP register arguments, C:/Users/xxx/mtw/Low-Power_Timer/build/CY8CKIT-062-WIFI-BT/Debug/mtb-example-psoc6-lptimer.elf does not
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_mult_f32.o)
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: error: ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_add_f32.o) uses VFP register arguments, C:/Users/xxx/mtw/Low-Power_Timer/build/CY8CKIT-062-WIFI-BT/Debug/mtb-example-psoc6-lptimer.elf does not
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_add_f32.o)
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: error: ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_common_tables.o) uses VFP register arguments, C:/Users/xxx/mtw/Low-Power_Timer/build/CY8CKIT-062-WIFI-BT/Debug/mtb-example-psoc6-lptimer.elf does not
c:/users/xxx/modustoolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld.exe: failed to merge target specific data of file ../CMSIS/DSP//Lib/GCC/libarm_cortexM4lf_math.a(arm_common_tables.o)
collect2.exe: error: ld returned 1 exit status
make[1]: *** [../mtb_shared/core-make/release-v1.9.1/make/core/build.mk:529: C:/Users/xxx/mtw/Low-Power_Timer/build/CY8CKIT-062-WIFI-BT/Debug/mtb-example-psoc6-lptimer.elf] Error 1
make: *** [../mtb_shared/core-make/release-v1.9.1/make/core/main.mk:434: secondstage_build] Error 2
"C:/Users/xxx/ModusToolbox/tools_2.4/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_MAKE_IDE_VERSION=2.4 CY_IDE_TOOLS_DIR=C:/Users/xxx/ModusToolbox/tools_2.4 -j12 all" terminated with exit code 2. Build might be incomplete.
What is going bed ?
Best Regards
Radim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you would have set the library path to the lf library in the makefile by changing LDLIBS. You will have to change the path of the library there.
This thread should provide the steps in detail - Install CMSIS DSP for CY8CPROTO-062-4343W on ModusToolbox v2.1.0 on Windows (Still)
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Radim,
The library libarm_cortexM4lf_math.a requires an FPU. The l here stands for little-endian and the f stands for the availability of an FPU. You probably are getting the errors because of the same. Can you please try libarm_cortexM4l_math.a and let me know if that works?
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Rakshith ,
How can I change to use libarm_cortexM4l_math.a instead of libarm_cortexM4lf_math.a ?
In folder ...\mtw\CMSIS\DSP\Lib\GCC folder I have both compiled versions.
Thanks in advance for your help...
Regards
Radim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe you would have set the library path to the lf library in the makefile by changing LDLIBS. You will have to change the path of the library there.
This thread should provide the steps in detail - Install CMSIS DSP for CY8CPROTO-062-4343W on ModusToolbox v2.1.0 on Windows (Still)
Rakshith M B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Rakshith,
thanks for mention LDLIBS. I had to be blind... After changing its value, it has been compiled without problems. So I can compile project with HARDFP or SOFTFP value in VFP_SELECT variable.
VFP_SELECT=hardfp & LDLIBS=$(DSP_DIR)/Lib/GCC/libarm_cortexM4lf_math.a
VFP_SELECT=softfp & LDLIBS=$(DSP_DIR)/Lib/GCC/libarm_cortexM4lf_math.a
Now for both variants the project compiled without error. But when I compare execution time - it is still same.
for(i=0; i< blockSize; i++)
{
cosOutput = arm_cos_f32(testInput_f32[i]);
sinOutput = arm_sin_f32(testInput_f32[i]);
arm_mult_f32(&cosOutput, &cosOutput, &cosSquareOutput, 1);
arm_mult_f32(&sinOutput, &sinOutput, &sinSquareOutput, 1);
arm_add_f32(&cosSquareOutput, &sinSquareOutput, &testOutput, 1);
/* absolute value of difference between ref and test */
diff = fabsf(testRefOutput_f32 - testOutput);
}
Maybe I am still doing something in wrong way.
Radim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ravo ,
Can you please let me know how you are performing this performance analysis on your end?
Also can you please share your project here (from where you shared the above snippet) so we can test the same on our end.
Warm Regards
Alen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Alen,
For time measurement I am using simultaneously counter and GPIO pin toggle to verify on scope.
event1_cnt = cyhal_lptimer_read(&lptimer_obj);
cyhal_gpio_write(CYBSP_USER_LED2, CYBSP_LED_STATE_ON);
{ executed code}
event2_cnt = cyhal_lptimer_read(&lptimer_obj);
cyhal_gpio_write(CYBSP_USER_LED2, CYBSP_LED_STATE_OFF);
timegap = (event2_cnt - event1_cnt) / (lptimer_obj_info.frequency_hz/1000);
/* Print the timegap value */
printf("\r\nFPU math functions take = %.3f sec\r\n",(double) timegap / 1000);
Now I think that it is working now. The mistake was on my side - the blockSize has value 32. So the problem was that the running time was similar for both softfp and hardfp variants. If I change cycle counts for example to 100 000 counts then the time differences could be measured.
Best Regards for answers and ideas to corrections.
Radim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @ravo ,
Glad your query is resolved!
Please feel free to post any queries or issues you may have on Infineon products in the community and we will be happy to help.
Thanks and Regards,
Alen
Cypress Semiconductor Corporation
An Infineon Technologies Company