I have an otherwise working workspace with a bootloader and bootloadable project for OTA. The process of identifying how to use headers in the bootloadable project has been very confusing.
I am attempting to implement dyanamic broadcasting to write data to the advertising packet. This requires the use of CyBle_GapUpdateAdvData. As far as I can see, the only way to use these things is to manually copy the declaration from the header, because I get errors about duplicate declarations when including the correct header such as BLE_StackGap.h in a bootloadable project.
However, if I add the declaration to OTA_mandatory.h manually, I get "undefined reference to `CyBle_GapUpdateAdvData'" when linking.
What is the correct method of using CyBle_GapUpdateAdvData in a Bootloadable?
I have also filed a support case and will report back if I hear back from them. The over-arching issue is that when you have a fixed stack OTA firmware update, the BLE component 'lives' in the Bootloader project, not the Bootloadable project. So this makes it complicated to use BLE-specific API in the Bootloadable (for me, anyway).
Here is the solution thanks to Anjana:
1) Add KEEP(*(i.CyBle_GapUpdateAdvData*)) and
KEEP(*(.text.CyBle_GapUpdateAdvData*)) in cm0gcc.ld of Bootloader project.
2) build bootloader and run mk.bat
3) Add the API definition in OTAMandatory.h file of Bootloadable project as an extern. Eg as below
extern CYBLE_API_RESULT_T CyBle_GapUpdateAdvData
CYBLE_GAPP_DISC_DATA_T * advDiscData,
CYBLE_GAPP_SCAN_RSP_DATA_T * advScanRespData