Problems with CTS and OTA Bootloadable code

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

cross mob
MikeAustin
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

I've got some code I've been writing that I now want to convert over to be able to upgrade Over The Air.

The code has the BLE component set up as a Client and Server profile.  The Client profile is configured with a Current Time Service, to enable syncing of the time in my code whenever it is accessed via a central device.  In the Server profile, I've got various custom services along with all the normal ones (Device Information, Generic Attribute, Generic Access, etc).

The Server profile is also set up to stuff some data into the Scan Response Packet, to make it easier to get data across to the Client without requiring a connection.  Connection is reserved for firmware updates (if I can get this to work!)

The code, as a non-OTA arrangement, compiles and works fine.  Until I attempt to convert it over to an OTA Fixed Stack Bootloadable version.  I've done this before, just not with the CTS functionality included, and its always worked.  I've followed all the steps outlined in the OTA Guide (AN97060), but I'm still not getting the Bootloadable code to compile.  Its throwing up a bunch of errors associated with the CTS functionality, even though I've made sure I've included the appropriate header files, etc.

The particular things its getting errors on are:

  • CyBle_GetClientState()
  • CYBLE_CLIENT_STATE_DISCOVERED
  • cyBle_ctsc

I can see that these are all defined in the Bootloader source code (in BLE_eventHandler.h & BLE_cts.c and BLE_cts.h), but for whatever reason, my Bootloadable code isn't seeing them.

Any ideas what I'm doing wrong??

Cheers,

Mike

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Mike,

Please find the attached Fixed Stack OTA Bootloader project with PSoC 4 BLE (CY8C4247LQI-BL483).

Thanks and regards

Ganesh

View solution in original post

0 Likes
5 Replies
MikeAustin
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Can anyone help out on this one?

0 Likes
MikeAustin
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

So, I've been doing a bit more digging into this. Decided in order to progress the OTA aspect of my design, I'd just strip out all the CTS related code until I can understand why this part isn't compiling when I convert to the OTA version.

So, now I just have a Custom Service with two characteristics (one to prompt going into OTA Bootloader mode and another to indicate that its currently in Bootloader mode).  I'm also sending data out via the Scan Response Packet.

In order to get pairing authentication, I need to make a call to: CyBle_GapAuthReq(cyBle_connHandle.bdHandle, &cyBle_authInfo);

And in order to update my scan response packet data, I need to make a call to: CyBle_GapUpdateAdvData(&cyBle_discoveryData, &cyBle_scanRspData); 

Both of these are defined in BLE_Stack_Gap.h, which I have included in the ota_mandatory.h file, and have then included this ota_mandatory file in my source code that makes the calls to these two functions.  But when I try to compile, the compiler flags these two function calls as errors:

MikeAustin_0-1611702940271.png

Until I get past this, our App developers can't test their App code to ensure they can trigger an OTA update and then transfer the firmware, so things have come to a grinding halt and I'm starting to get the heat applied.

Is there something obvious I am missing?  Can anyone see what I might be doing wrong?

Thanks and regards,
Mike

0 Likes
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi,

Can you please attach the stripped versions of your Bootloader and Bootloadable projects for which you are getting errors?

Thanks 

Ganesh

0 Likes
MikeAustin
Level 4
Level 4
25 replies posted 25 sign-ins 10 replies posted

Hi Ganesh,

Probably easiest if I just send you the complete Workspace - do you have a private email address I can send it to?

Regards,

Mike

0 Likes
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Mike,

Please find the attached Fixed Stack OTA Bootloader project with PSoC 4 BLE (CY8C4247LQI-BL483).

Thanks and regards

Ganesh

0 Likes