PSOC 6 BLE hardfp/vfp

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

cross mob
JoYe_1259141
Level 1
Level 1
First like given Welcome!

I'm currently using the CYBLE-416045-02 module for my CMSIS/DSP project.  Using the PSOC creator 4.2/4.3 I'm able to compile for hardfp with a separate make file.  However, adding the BLE function (CM0 ble controller/CM4 ble host stack) generates a VFP error because the ble/lib/*.a files were not generated for hardfp.  How does one generate a set of ble *.a files that incorporates VFP?  I'm currently using the PDL\3.1.1\middleware\ble\lib ble stack.

John Y.

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.

Hello John,

You cannot do it in PSoC Creator. The HardFP variants have been provided to you as part of PDL. The KBA is a generic one. Let me highlight all the steps required for PSoC6 projects below:

(1) Point to PDL 3.1.0 using Peripheral Driver Library > Custom in the Build Settings

(2) Export your PSoC Project to Makefile using Build Settings > Target IDEs > Makefile > Generate.

(3) Copy "cy_ble_stack_gcc_host_ipc_cm4f.a" from "C:\Program Files (x86)\Cypress\PDL\3.1.0\middleware\ble\lib" and place it inside  "<your_project>.cydsn\Generated_Source\PSoC6\pdl\middleware\ble\lib\" directory.

(4) Import the Makefile project into any of your favourite IDEs. I'm going to use Eclipse for example.

(5) In the file "platform_debug.mk" (present in your .cydsn folder), do a find and replace operation changing all "-mfloat-abi=softfp" to "-mfloat-abi=hard".

(6) Now edit the "gen_source.mk" file. It will be present under "Generated_Source/PSoC6". Add the HardFP variant of the BLE Static Library as shown below:

     GEN_LIBS_CortexM4=\

          Generated_Source/PSoC6/pdl/middleware/ble/lib/cy_ble_stack_gcc_host_ipc_cm4f.a

(7) Perform a clean and build. It will build successfully.

Attaching my files for reference. Let me know your observations

Regards,

Dheeraj

View solution in original post

8 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello John,

In the path "C:\Program Files (x86)\Cypress\PDL\3.1.0\middleware\ble\lib", you can find the ".a" libraries for both HardFP and SoftFP. The SoftFP ones are named "xxxx_soft_cm4.a" and HardFP libraries are named "xxx_cm4.a".

Did you use the HardFP libraries and then notice the error?

Regards,

Dheeraj

Hi Dheeraj,

Thanks for getting back.  As PSOC Creator defaults to softfp, I've been compiling the using platform_debug.mk setting the -mfloat-abi=hard  for CFLAGS_CortexM4, LDFLAGS_CortexM4, ASFLAGS_CortexM4 and setting arm_cortexM4lf_math.  I noticed that I need to touch all the generated devices.c code to get most of the VFP to set to hard.  Is there a flag to tell the psoc to generate code using hardfp?

Regards,

John

0 Likes

Hello John,

PSoC Creator doesn't have official support for HardFP. The method you have of exporting it to a makefile and adding the flags is the right way to go. You can refer this KBA which highlights this: Enabling Hardware Floating Point Compilation for Arm Cortex-M4 in PSoC Creator™ - KBA222890

Can you elaborate on the error you are seeing currently?

Regards,

Dheeraj

0 Likes

HI Dheeraj,

All the errors seem to be related to cy_ble_stack_gcc_host_ipc_cm4.a was not created with VFP turned on.

c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/bin/ld.exe: error: output/debug/CortexM4/SoundSensor_BLE_CAL_link.elf uses VFP register arguments, Generated_Source/PSoC6/pdl/middleware/ble/lib/cy_ble_stack_gcc_host_ipc_cm4.a(att_fsm_handlers.o) does not

John

0 Likes

Hello John,

Checked with the internal team. HardFP variants haven't been added as part of the PDL 3.1.1 release. Please use the HardFP libs of the format "xxx_cm4f.a" inside the older PDL 3.1.0 version folder. You can find it at the path: "C:\Program Files (x86)\Cypress\PDL\3.1.0\middleware\ble\lib\".

Let me know your observations after using them.

Regards,

Dheeraj

0 Likes

Hi Dheeraj,

I see the "xxx_cm4f.a" in the PDL 3.1.0 in the directory and I can point the build_settings/pdl to the 3.1.0.  But where do I tell the compiler to use the xxx_cm4f.a.  Should one specify it in the PSOC creator or modify the .cyprj file in the directory.  Do you have an example file or a tutorial?  I looked at the KBA222890 and Hardfp in PSoC Creator 4_2_Beta_2.docx, neither showed how to specify how to switch the .a files from soft to hard.

John

0 Likes
lock attach
Attachments are accessible only for community members.

Hello John,

You cannot do it in PSoC Creator. The HardFP variants have been provided to you as part of PDL. The KBA is a generic one. Let me highlight all the steps required for PSoC6 projects below:

(1) Point to PDL 3.1.0 using Peripheral Driver Library > Custom in the Build Settings

(2) Export your PSoC Project to Makefile using Build Settings > Target IDEs > Makefile > Generate.

(3) Copy "cy_ble_stack_gcc_host_ipc_cm4f.a" from "C:\Program Files (x86)\Cypress\PDL\3.1.0\middleware\ble\lib" and place it inside  "<your_project>.cydsn\Generated_Source\PSoC6\pdl\middleware\ble\lib\" directory.

(4) Import the Makefile project into any of your favourite IDEs. I'm going to use Eclipse for example.

(5) In the file "platform_debug.mk" (present in your .cydsn folder), do a find and replace operation changing all "-mfloat-abi=softfp" to "-mfloat-abi=hard".

(6) Now edit the "gen_source.mk" file. It will be present under "Generated_Source/PSoC6". Add the HardFP variant of the BLE Static Library as shown below:

     GEN_LIBS_CortexM4=\

          Generated_Source/PSoC6/pdl/middleware/ble/lib/cy_ble_stack_gcc_host_ipc_cm4f.a

(7) Perform a clean and build. It will build successfully.

Attaching my files for reference. Let me know your observations

Regards,

Dheeraj

Hi Dheeraj,

Tweaking the "gen_source.mk" did the trick.  Thank you for your help.

Regards,

John 

0 Likes