Please have a look at the document "AN97060 - PSoC® 4 BLE and PRoC™ BLE - Over-the-Air (OTA) Device Firmware Upgrade (DFU) Guide" (Link:http://www.cypress.com/file/198301/download).
Hi Hima -
We have already reviewed the linked file. What we are missing are details on how to make things like "CyBle_GattsReadAttributeValue" available to our bootloadable project.
Our BLE component is defined in the Bootloader project. The Bootloadable project is configured to require the Bootloader project per the instructions, but we are still having trouble getting our Bootloadable to compile - it seems like some of the CyBle_Gatts properties are not available. Is this intentional? How do we access them?
Some more info that might help you figure out what we're missing...
I can get the CyBle_GattsReadAttributeValue method to be available to the bootloader (it is present in BootloaderSymbolsGcc.ld) by adjusting the build settings of the Bootloader:
* Bootloader -> Build settings -> Linker -> Optimization -> Removed Unused sections = FALSE
* Bootloader -> Build Settings -> Compiler -> Optimization -> Create Function sections = FALSE
However, when I do this, I get a strange error while building the bootloadable - that it is trying to write outside the rom area or something like that, so it fails the build step.
I think we've solved this one... For the missing method,
* Add a line to bootloader's cm0gcc.ld in Scripts directory: " KEEP(*(i.CyBle_GattsReadAttributeValue*))"
* Added CyBle_GattsReadAttributeValue's definition to Bootloadable's ota_mandatory.h: "extern CYBLE_GATT_ERR_CODE_T CyBle_GattsReadAttributeValue
Then for the missing char handles / services,
* Copy the #define for the service's char handle from the bootloader's generated CyBle_custom.h, and paste it into the bootloadable's ota_mandatory.h:
#define CYBLE_SOMESERVICE_SOMETHING_CHAR_HANDLE (0x0022u) /* Handle of something characteristic */
For anyone else going down this path, we also ran into trouble with the bonding information - see this post for more a great description of the problem (basically you need to manage the bonding keys in the bootloader project, not the bootloadable.): http://www.cypress.com/forum/psoc-4-ble/ota-bootloader-bonding-problem