BLE OTA Fixed Stack with Use of BLE API service in the bootloadable

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

cross mob
Anonymous
Not applicable

Hello,

   

I am working on an existing project which uses BLE services. A BLE component was defined in its design. 

   

In order to implement a OTA functionality in the existing project, I created a Fixed Stack Bootloader Project in the workspace, configured it (as well as the existing project to be bootloadable) using the AN 9706. I then followed the instruction from the "BLE OTA Fixed Stack Bootloader and Bootloadable"for adding service to the bootloadable:

   

I first added the APIs needed by the bootloadable in the linker Script of the bootloader cm0gcc.ld (eg KEEP(*(i.CyBle_Start)))
Then, ran the mk.bat file to generate the bootloadable linker Script BootloaderSymbolGcc.ld

   

My problem is now that I should add the used BLE APIs as extern declaration (as well as the BLE types and defines) to the OTAMandatory.h file of the bootloadable project. That is where I am stuck because I do not know how to do that and I did not find example projects on the forum with the bootloadable using BLE services.

   

Thank you in advance.

0 Likes
5 Replies
Anonymous
Not applicable

To declare a method as declared externally in the OTAMandatory.h file, you would use the following syntax in the OTAMandatory.h file:

   

extern void myFunction(integer myVariable);

   

If the function is properly declared/implemented in your other .c,.h files correctly, then the above syntax should be the only thing to change/add to implement what you stated in your question.

0 Likes
Anonymous
Not applicable

Hello,

   

Thanks a lot for your help. As you said I used the syntax in the OTAMandatory.h file. See below:

   

CYBLE_API_RESULT_T CyBle_GattsWriteRsp (CYBLE_CONN_HANDLE_T     connHandle); 

   

However I still receive failure message undefined reference to "CyBle_GattsWriteRsp". I did no other aditional declaration/implementation in my .c,h files; I supposed they were no declaration missing there as the project worked correctly before the implementation of the OTA function... 

   

​Then again thanks if you have any other clue, i am happy to hear from you.

   

I think i will try another direction (with an upgradable Stack OTA Bootloader) as it seems easier, due to the fact that the BLE component can stay in the original existing project.

   

Have a good day.

   

Marlène

0 Likes
Anonymous
Not applicable

Hmmm, I'm pretty sure the CyBle_GattsWriteRsp() is a function generated by the Cypress Library based on the hardware configuration of your BLE component.

   

You forgot to place the syntax word EXTERN in front of the line. (Assuming you didn't copy paste it wrong).

   

For example:

   

Extern CYBLE_API_RESULT_T CyBle_GattsWriteRsp (CYBLE_CONN_HANDLE_T     connHandle); 

0 Likes
Anonymous
Not applicable

Marlene, did you solve this? I'm having the same issue.

0 Likes
Anonymous
Not applicable

Hi Gregory,

   

I did not solve the problem but I was successful implementing the upgradable Stack OTA Bootloader.

   

Regards,

   

Marlene

0 Likes