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.

CC2642R: Regarding the OAD characteristics of simple peripheral on-chip peripheral example code

Part Number: CC2642R
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hello,

I am using CC2642R controller for my BLE application. I have used simple peripheral on-chip example for my application. This involves using the OAD characteristics and I am successfully able to perform OTA using another CC2642R running the hex file of BTool. I have certain questions regarding the same:

1. When i connect a basic BLE Scanner App to the controller and write any random data to the characteristic, the controller stops working and enters the default infinite error loop. I need to avoid this as our application can be directly connected i.e. anyone can read and write to the characteristics. (So even if anyone can write to the OAD characteristic, only the proper command can start firmware update and the systems does not go into the infinite while loop)

2. Also, is there source code available for implementing the bin file to image conversion and subsequent communication with CC2642R.

Thanks and Regards.


  • Hello,

    Thanks for reaching out! I was unable to recreate the issue you're talking about. Could you try deleting the device from the Bluetooth list of the phone you're using and rerunning? Also, make sure that you're writing the correct data type and size to each characteristic.

    Could you also provide the version of the CCS and SDK you're using?

    As for the bin file, I'm not sure I quite understand what you're asking. The bin file is automatically generated. Could you elaborate?

    Best Regards,
    Tarek

  • Hello,

    Sorry for the delayed reply. Yes I have tried deleting the device from the Bluetooth list but the problem still arises. Also the correct data type and size is being written to each characteristic. With regards to the CCS and SDK version, I am using

    CCS 12.7.1.00001
    SDK 7.41.00.17

    The problem is as follows:
    If I write any random data to the OAD characteristics, the program stops working. I need the characteristics to reject the random data and accept only specific images which are required for OAD firmware updates.

    With regards to the second question, yes the bin file is automatically generated but I need the source code for bTool functionality. i.e. the application that converts the hex files to respective image files.

    Thanks and regards,
    Raj

  • Hello Raj,

    Thank you for your patience! I just ran the example using the SDK version you provided and had full functionality, so I'm struggling to recreate the error. Please confirm that you are following the example given on this website: https://dev.ti.com/tirex/explore/node?node=A__ATQuPjLa7mTe6cHhz7y-WA__com.ti.SIMPLELINK_ACADEMY_CC13XX_CC26XX_SDK__AfkT0vQ__LATEST
    If so, please try rebuilding the project and reflashing the board. Also, please provide some information regarding any changes you may have made when following the example, if any.

    As for the bin file, you could find a python script (oad_image_tool.py) along with a readme file describing the conversion inside the SDK. It is located in

    simplelink_cc13xx_cc26xx_sdk_7_41_00_17\tools\common\oad

    I hope this helps!

    Regards,

    Tarek

  • Hey Tarek,

    Thanks for the reply. I had already gone through the Simplelink BLE tutorials for understanding but to no avail. Let me re-explain the issue that I am currently facing:

    I am flashing 3 programs using Uniflash on my controller:
    1. BIM on-chip example 
    2. Persistent OAD example

    3. Modified Simple Peripheral On-chip example which consists of OAD Start / Reset characteristics. 

    Now due to my application constraints, I have disabled the passcode option i.e. anyone can directly connect and write to that characteristics via any standard app such as BLE Scanner App. If any random user writes random data to this OAD characteristics, the modified on-chip program stops working. This is harmful as anyone with a mobile and scanner app can initiate OAD with the controller and hang the program. So how do I avoid this ?? (i.e. OAD Set/Reset characteristics starts OAD only when it receives certain data)

    Also I haven't changed the OAD characteristics in simple peripheral on-chip example (created separate characteristics for my requirements)

    The reason I asked for Bin file to image converter since we are planning to develop custom app which can perform OAD with BLE device. Currently we are using CC2642R development board by running the BTool Hex file and performing an OAD

    Thanks again,
    Raj

  • Hey Raj,

    Could you explain what the modified on-chip program is doing, and what happens when it stops working? Could you also clarify if you mean the GATT characteristics when you say OAD characteristics?

    Also, you can refer to the BLE5-Stack User's Guide's section on GATT characteristics for more information on GATT characteristics.

    Regards,

    Tarek

  • Hello Tarek,

    Yes I am referring to GATT characteristics while talking about OAD characteristics. My program involves receiving a certain string and passing response to another device connected via UART. When I write random data to this OAD GATT characteristics, the controller hangs, disconnects and stops advertising.

    Yes sure I will go through BLE Stack User Guide and understand the same.

    Thanks,
    Raj

  • Hello Raj,

    Just to confirm, does the default on chip Bluetooth Low Energy Enhanced Over the Air Download (OAD) Fundamentals example work without any modifications for you? Can you do OAD using the app when using the default example? If you have not tried, please test it and let me know if you can successfully use the app.

    Regards,
    Tarek

  • Hello Tarek,

    Yes I am successfully able to run the OAD fundamentals example. I am able to perform OAD using that sample program. But the program faces the same issue i.e. controller hangs when writing any random data to this OAD characteristics. Kindly suggest what can I do to avoid this

    Regards,
    Raj

  • Hello Raj,

    If the default example is not working, maybe some sort of miscommunication is happening. Below, I will provide a step by step of what I did to get the project working, using just the target device and updating the firmware using the SimpleLink app on my phone. It would also be extremely helpful if you provided a picture of the LaunchPad you're using, and a video/pictures of you running into the issue when running the default example. 

    Steps for running the OAD project on the CC264xR board:

    1. Import the simple_peripheral_oad_onchip example and the persistent_app examples to CCS
    2. Build both projects
    3. Go to Uniflash and connect your board
    4. In Uniflash select the following files (as seen in the image below):
      1. bim_onchip.hex (Located in examples\nortos\CC26X2R1_LAUNCHXL\bim\hexfiles\bim_onchip\Release)
      2. persistent_app bin file (Located in the release file of the project) and load it into Load Addr: 0x38000
      3. simple_peripheral_oad_onchipbin file (Located in the release file of the project)

    5. Load images onto device then power cycle the device
    6. Connect to the board via the SimpleLink app


    7. Attempting writing data to the characteristics should be fine at this point


    8. Attempt to update the firmware (Make sure to select the correct files)


    9. Once the update is done, go back to the characteristics and attempt to type any data, it should still be fully functional

    I hope this helps with your problem. Hopefully we'll get your issue resolved soon!

    Best Regards,

    Tarek

  • Hello Tarek,

    Thanks for the detailed reply. Turns out the write attribute function of the OAD set/reset characteristics had to be modified to solve my problem.

    Regards