Issue linkin to #include "wiced_bt_hfp_hf.h"

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

cross mob
ArC_4353456
Level 1
Level 1

Hi Team,

I'm trying to develop a application which should display the name of the caller when there is a incoming call from the connected mobile device.

In my source code file I have included #include "wiced_bt_hfp_hf.h" to initiate and connect the HFP profile from CYW201819 board.

When I call the below API, I am getting linking error, as shown below:

  wiced_result_t hfpResult = wiced_bt_hfp_hf_init(&app_hfp_config,app_bt_hfp_hf_event_cb_t);
  WICED_BT_TRACE("\nwiced_bt_hfp_hf_init hfpResult: %d\n", hfpResult);

  wiced_result_t hfpConnectResult = wiced_bt_hfp_hf_connect( p_encryption_status->bd_addr );
  WICED_BT_TRACE("\nwiced_bt_hfp_hf_init hfpConnectResult: %d\n", hfpConnectResult);

Error is as below when I try to build the app:

/home/arch272129/mtw/Trial_EB_TVS_Proj/template/empty_wiced_bt//empty_wiced_bt.c:360: undefined reference to `wiced_bt_hfp_hf_init'

../../../wiced_btsdk/dev-kit/baselib/20819A1/make/core/build.mk:611: recipe for target '/home/arch272129/mtw/Trial_EB_TVS_Proj/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/EmptyWicedBluetooth.elf' failed

/home/arch272129/mtw/Trial_EB_TVS_Proj/template/empty_wiced_bt//empty_wiced_bt.c:360: undefined reference to `wiced_bt_hfp_hf_connect'

collect2: error: ld returned 1 exit status

make: *** [/home/arch272129/mtw/Trial_EB_TVS_Proj/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/EmptyWicedBluetooth.elf] Error 1

I even tried adding COMPONENTS in the application make file, but not helpful, not sure whether I am adding a proper component or not, could you please suggest me what is going wrong even when the header is included, why the library of HFP is not being included.

Thank You,

Arathi, C

0 Likes
1 Solution
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

As confirmed in PBAP and HFP support for CYW20819 , HFP is not supported for CYW20819 device.

View solution in original post

6 Replies
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi Arathi,

Can you check if you have following line included in your makefile:

SEARCH_LIBS_AND_INCLUDES=$(CY_BSP_PATH) $(CY_BASELIB_PATH) $(CY_SHARED_PATH)/dev-kit/btsdk-include

0 Likes

Hi Sheetal,

I have tried adding the below line, but I use to get errors while doing the build and clean build, so removed.

SEARCH_LIBS_AND_INCLUDES=$(CY_BSP_PATH) $(CY_BASELIB_PATH) $(CY_SHARED_PATH)/dev-kit/libraries/btsdk-rfcomm $(CY_SHARED_PATH)/dev-kit/btsdk-include

I have btsdk-rfcomm also in the above path because I need for SPP.

ERRORs are as below:

make[1]: *** No rule to make target 'clean'.  Stop.

make: *** [../../../wiced_btsdk/dev-kit/btsdk-include] Error 2

make: *** Waiting for unfinished jobs....

makefile:191: recipe for target '../../../wiced_btsdk/dev-kit/btsdk-include' failed

Beow errors when tried doing build:

make[1]: Entering directory '/home/arch272129/mtw/wiced_btsdk/dev-kit/bsp/TARGET_CYW920819EVB-02'

make[1]: *** No rule to make target 'all'.  Stop.

Initializing build: CYW920819EVB-02_bsp Debug CYW920819EVB-02 GCC_ARM

make[1]: Entering directory '/home/arch272129/mtw/wiced_btsdk/dev-kit/libraries/btsdk-rfcomm'

Initializing build: btsdk-rfcomm Debug CYW920819EVB-02 GCC_ARM

make[1]: Entering directory '/home/arch272129/mtw/wiced_btsdk/dev-kit/btsdk-include'

make[1]: Leaving directory '/home/arch272129/mtw/wiced_btsdk/dev-kit/btsdk-include'

make[1]: Entering directory '/home/arch272129/mtw/wiced_btsdk/dev-kit/baselib/20819A1'

Initializing build: 20819A1_baselib Debug CYW920819EVB-02 GCC_ARM

make: *** [../../../wiced_btsdk/dev-kit/btsdk-include] Error 2

makefile:191: recipe for target '../../../wiced_btsdk/dev-kit/btsdk-include' failed

make: *** Waiting for unfinished jobs....

0 Likes

Hi ArC_4353456

Seems like some linking issue.

How did you create your project in MTB? (I believe you are using latest MTB2.0).

Could you please try to create a new empty project and edit the source file in it?

Thanks,

-Dheeraj

Hi Dheeraj,

Yes as I mentioned in my first query, it is related to linker error, which I am not able to resolve.

I am using MTB 2.0 and I already tried with new empty project couple of time already.

Need more help on the modification of build.mk I suspect.

Thanks,

Arathi C

0 Likes
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

Hi Arathi,

It will be great if you could provide us your project makefile or full project, so that we can check at our end and look for the problem.

0 Likes
SheetalJ
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 500 likes received

As confirmed in PBAP and HFP support for CYW20819 , HFP is not supported for CYW20819 device.