This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-CC2650: How to update "firmware revision" field automatically?

Part Number: LAUNCHXL-CC2650

Hello,

I am using LAUNCHXL-CC2650

BLE SDK 2_02_07_06

CCS7.4

Compiler TI v5.2.6.

I have developed application code which can receive data over BLE (with reference to the Simple BLE peripheral example code).

I also have many custom PCB with some variations in PCB hardware, which are running my BLE application code.

In the current scenario whenever I update my code, I am hard-coding the "firmware revision field" string. as shown in the attached image.

currently I am changing this field manually every time.

I am using "device info" service at BLE master side to read peripheral parameters.

Is there any way by which this field "firmware revision" will automatically update as per the name of the changed application code?

As there is a similar case with build variables and path variables where we can give reference to the directory, file or path, String.

Thank you 

Dnyaneshvar Salve

  • Hello Dnyaneshvar,

    This may be possible but may require some additional scripts to be written. The project name is stored in a CCS variable named ProjName as shown below:

    I would recommend creating a script that is ran as part of the pre-build steps that is passed the ProjName as ${ProjName} as a parameter. The script should then create a text file with a known name (textFileName.txt as an example) and save the string contained in the ${ProjName} parameter in the text file. The text file should be save somewhere in your project directory. Your code should add an include statement to be able to access the text file (something like #include "textFileName.txt"). Afterwards, additional logic may be written to read the string from the text file and update the field as desired.

    I have not attempted to implement this myself, so I am not 100% sure if it will work, but I think this is a good starting point. Another possible avenue would be to add a predefine and add the project name there.

    Best Regards,

    Jan

  • Hello ,

    Thank you for your help.

    Is there any easier way to accomplish this this task by using only code composer studio only and  without writing any script with third party application involved?

    Dnyaneshvar salve

  • Hi Dnyaneshvar,

    If CCS is running in a windows machine, then a batch script should not require a an external application and can run natively in Windows. You may also use Python script, pass it the ${ProjName} variable and directly modify the C file within the Python script as a prebuild step. Unfortunately, reading the project name will not be possible without the use of a pre-build script (python, batch, or other).

    Best Regards,

    Jan

  • hi Jan,

    I will definitely try this in future.

    Thank you

    Dnyaneshvar salve