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.

CC2640R2F: SIMPLELINK-CC2640R2-SDK

Part Number: CC2640R2F

We are trying to update the fimware of our device which uses the CC2640R2F chip, using TI-OAD library provided by you, the link to the repo https://git.ti.com/cgit/simplelink-ble-oad-android/simplelink-ble-oad-android/


The TI-OAD library, which manages the firmware upgrade process, expects the second element of the response array from the device to be 0x00 (0) and 0x0e (14) when the firmware is being written to the device. However, in some cases, the Drive One device responds with a different byte in the second element of the response array, specifically 0x05 (5). When this occurs, it leads to a failure in the firmware update or repair process, keeping the device in OAD mode forever until repaired.

So we need technical support regarding how to tackle this situation. I am also attaching images of the device response we received when the firmware file was written to the device for your reference

  • Hi,

    Thank you for reaching out.

    Based on the OAD return value documentation (https://software-dl.ti.com/simplelink/esd/simplelink_cc2640r2_sdk/5.30.00.03/exports/docs/blestack/ble_user_guide/html/ble3-stack-oad/oad-profile.html#oad-return-values), 0x05 is returned in case the OAD process has not yet started (OAD_NOT_STARTED).

    At first sight, I would assume the OAD process has not be able to properly start. One approach I could suggest is to try to re-start the process using the OAD Control Point Characteristic (see https://software-dl.ti.com/simplelink/esd/simplelink_cc2640r2_sdk/5.30.00.03/exports/docs/blestack/ble_user_guide/html/ble3-stack-oad/oad-profile.html?highlight=oad_not_started#oad-control-point-characteristic-0xffc5). 

    I hope this will help,

    Best regards,

  • Okay Clément, I have added an additional else if case if I receive 0x05 in response then the

    sendEoadStartOADProcessCmd() function is again called


    Let me know if anything else is needed or anything I am doing wrong in the below code


    Here's the code for handleOADControlPointMessage



    public void handleOADControlPointMessage(final byte[] response) {
    switch(response[0]) {
    case TIOADEoadDefinitions.TI_OAD_CONTROL_POINT_CMD_DEVICE_TYPE_CMD:
    internalState = TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientDeviceTypeRequestResponse;
    TIOADEoadDeviceID = new byte[4];
    for (int ii = 0; ii < 4; ii++) TIOADEoadDeviceID[ii] = response[ii + 1];
    Log.d(TAG,"Device ID: " + TIOADEoadDefinitions.oadChipTypePrettyPrint(TIOADEoadDeviceID));
    if (TIOADEoadDefinitions.oadChipTypePrettyPrint(TIOADEoadDeviceID).equals("CC1352P")) {

    //Special case for the CC1352P's because they can have two different RF layouts
    if (progressCallback != null) {

    progressCallback.oadStatusUpdate(TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientChipIsCC1352PShowWarningAboutLayouts);
    }

    }
    if (progressCallback != null) {
    progressCallback.oadStatusUpdate(TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientReady);
    }

    break;
    case TIOADEoadDefinitions.TI_OAD_CONTROL_POINT_CMD_GET_BLOCK_SIZE:

    handleEoadBlockSizeResponse(response);
    //We should now be ready to actually run an OAD programming
    break;
    case TIOADEoadDefinitions.TI_OAD_CONTROL_POINT_CMD_ENABLE_OAD_IMAGE:

    if (response[1] == 0x00) {
    internalState = TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientCompleteFeedbackOK;
    }

    break;
    case TIOADEoadDefinitions.TI_OAD_CONTROL_POINT_CMD_IMAGE_BLOCK_WRITE_CHAR_RESPONSE:

    if (response[1] == 0x00) {
    if (internalState == TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientProgrammingAbortedByUser) {
    try {
    if (oadDevice != null)
    oadDevice.g.disconnect();
    if (oadDevice != null)

    oadDevice.g.close();
    } catch (Exception e) {

    Log.e(TAG, "Error closing gatt connection %s", e);
    }

    if (progressCallback != null) {
    progressCallback.oadStatusUpdate(TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientProgrammingAbortedByUser);
    }

    return;
    }

    internalState = TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientImageTransfer;
    new Thread(new Runnable() {

    @Override
    public void run() {

    long block = TIOADEoadDefinitions.BUILD_UINT32(response[5], response[4], response[3], response[2]);
    sendEoadDataBlock(block);
    }

    },"OAD Block Send Thread").start();
    }

    else if (response[1] == 0x0e) {
    internalState = TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientImageTransferOK;
    return;
    }

    else if (response[1] == 0x05) {
    sendEoadStartOADProcessCmd();
    }

    else {
    if (progressCallback != null) {
    progressCallback.oadStatusUpdate(TIOADEoadDefinitions.oadStatusEnumeration.tiOADClientImageTransferFailed);
    }

    }
    break;
    case TIOADEoadDefinitions.TI_OAD_CONTROL_POINT_CMD_START_OAD_PROCESS:

    break;
    default:

    Log.d(TAG,"Unknown Control Point Response: " + TIOADEoadDefinitions.BytetohexString(response));
    break;
    }

    }






    and the sendEoadStartOADProcessCmd() function code is also mentioned below

    public void sendEoadStartOADProcessCmd () {
    byte cmd = TIOADEoadDefinitions.TI_OAD_CONTROL_POINT_CMD_START_OAD_PROCESS;
    TIOADEoadTotalBlocks = this.fileReader.getRawImageData().length / (TIOADEoadBlockSize - 4);
    if ((this.fileReader.getRawImageData().length - (TIOADEoadTotalBlocks * (TIOADEoadBlockSize - 4))) > 0) {

    TIOADEoadTotalBlocks++;
    }

    if (oadDevice != null)
    oadDevice.writeCharacteristicAsync(imageControlChar,cmd);
    }
  • Hey Clément, this solution also didn't work, still the update is failing

  • Hi,

    You may have to stop (cancel) the OAD process before re-starting it.

    Regards,

  • Hey Clément, tried doing this as well still issue persists. If possible can we connect over a meet so I can show you the failure case as well ?

  • Hi,

    I would recommend to collect some Bluetooth sniffer logs showing the behavior of the device both in the working and the non-working case.

    If needed, I can help analyzing such logs.

    I hope this will help,

    Best regards,