How to enable hard floating point support in PSoC 62S2 WiFi BT Pioneer Kit in CM0?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
chwaitang
Level 3
Level 3
First solution authored 25 sign-ins 10 replies posted

Hi All,

I have 2 questions.

1) Explicitly, how do I enable hard floating point support in M0 processor in PSoC 6  62S2 WiFi BT Pioneer Kit?

I have try edit makefile option 

VFP_SELECT=hardfp and get compiler error:

/Applications/ModusToolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: error: ../../mtb_shared/capsense/release-v3.0.0/COMPONENT_HARDFP/TOOLCHAIN_GCC_ARM/libcy_capsense.a(cy_capsense_smartsense_fw_lib.o) uses VFP register arguments, /Users/tangcw/mtw/Dual-CPU_Empty_PSoC6_App/cm0p_app/build/CY8CKIT-062S2-43012/Debug/cy_m0p_image.elf does not

/Applications/ModusToolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ../../mtb_shared/capsense/release-v3.0.0/COMPONENT_HARDFP/TOOLCHAIN_GCC_ARM/libcy_capsense.a(cy_capsense_smartsense_fw_lib.o)

/Applications/ModusToolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: error: ../../mtb_shared/capsense/release-v3.0.0/COMPONENT_HARDFP/TOOLCHAIN_GCC_ARM/libcy_capsense.a(cy_capsense_smartsense_hw_lib.o) uses VFP register arguments, /Users/tangcw/mtw/Dual-CPU_Empty_PSoC6_App/cm0p_app/build/CY8CKIT-062S2-43012/Debug/cy_m0p_image.elf does not

/Applications/ModusToolbox/tools_2.4/gcc/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/bin/ld: failed to merge target specific data of file ../../mtb_shared/capsense/release-v3.0.0/COMPONENT_HARDFP/TOOLCHAIN_GCC_ARM/libcy_capsense.a(cy_capsense_smartsense_hw_lib.o)

Am I missing something?

2) Second, how do I print float variables to UART for debug? I have try print to string with sprint then use UART_PutString but the contents of float variables never appear.

In addition, I am referring to M0 CPU and am using ModusToolbox 2.4

 

Warm Regards

CW

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @chwaitang ,

1) Explicitly, how do I enable hard floating point support in M0 processor in PSoC 6  62S2 WiFi BT Pioneer Kit?

A] The CM0P Core in PSoC 6 does not support hardfp and hence providing this flag in the MakeFile will cause it to throw error as the VFP registers are not present for CM0P core leading to compilation errors. You can observe the presence of the VFP registers in the CM4 technical reference guide, but the same is absent in CM0P technical reference guide

2) Second, how do I print float variables to UART for debug? I have try print to string with sprint then use UART_PutString but the contents of float variables never appear.

A] In order to observe the float values in the CM0P core with UART, please populate the LDFLAG parameter as follows in the MakeFile of the project. Note that due to the lack of a FPU, floating point operations are very slow compared to integer operations.

LDFLAGS=-u _printf_float

 

Warm Regards
Alen

View solution in original post

0 Likes
1 Reply
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @chwaitang ,

1) Explicitly, how do I enable hard floating point support in M0 processor in PSoC 6  62S2 WiFi BT Pioneer Kit?

A] The CM0P Core in PSoC 6 does not support hardfp and hence providing this flag in the MakeFile will cause it to throw error as the VFP registers are not present for CM0P core leading to compilation errors. You can observe the presence of the VFP registers in the CM4 technical reference guide, but the same is absent in CM0P technical reference guide

2) Second, how do I print float variables to UART for debug? I have try print to string with sprint then use UART_PutString but the contents of float variables never appear.

A] In order to observe the float values in the CM0P core with UART, please populate the LDFLAG parameter as follows in the MakeFile of the project. Note that due to the lack of a FPU, floating point operations are very slow compared to integer operations.

LDFLAGS=-u _printf_float

 

Warm Regards
Alen

0 Likes