KB: Adding CGMP Support to the FOTA Library (CMSIS Software Pack v3.2 - v3.5)

[RSL10 - Knowledge Base]


When trying to build a Bluetooth Low Energy firmware that includes both the CGMP (Continuous Glucose Monitoring Profile) and the FOTA ( Firmware Over The Air) Stack, if you are using the RSL10 Software CMSIS Packs version 3.2 - 3.5 you will notice that trying to add the CGMP using the Stack commands will return an error.

What is causing this issue and how can I get the profile added successfully to my FOTA firmware?


This is caused by the lack of CGMP wrappers within the FOTA portion of the firmware that allows it to share Bluetooth Low Energy Stack access across both FOTA and application firmware. While the CGMP firmware was added to the Stack in the RSL10 Software CMSIS Pack v3.2, the wrapper for FOTA to access it as expected was not added until v3.6.

In order to manually add the necessary wrapper functions to the FOTA Library source code, import the FOTA source code into your workspace and make the following changes:

Add CGMS and CGMC wrappers to line 169 as shown below.

const struct prf_task_cbs * __wrap_cgmc_prf_itf_get(void)
    return fota_config_p->prf.cgmc_prf_itf_get();

const struct prf_task_cbs * __wrap_cgms_prf_itf_get(void)
    return fota_config_p->prf.cgms_prf_itf_get();

Add Profile Interface Get function declaration to line 52 as shown below.

const struct prf_task_cbs * cgmc_prf_itf_get(void);

const struct prf_task_cbs * cgms_prf_itf_get(void);

Add the new function declaration to the Table on line 162 as shown below.


Add the function prototypes on line 63 as shown below.

    fota_prf_wrapper_t * cgmc_prf_itf_get;
    fota_prf_wrapper_t * cgms_prf_itf_get;

Once you have made these updates, build the FOTA source code in your workspace of choice to generate a new fota.bin & libfota.a.

Now that you have a fixed version of the FOTA Library and binary file, return to your application that makes use of FOTA and update the project settings (Libraries & Post-Build Steps) to reference the new FOTA files that you have just generated.

1 Like