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: BLE is disconnected immediately after connected

Part Number: CC2642R
Other Parts Discussed in Thread: SYSCONFIG, LAUNCHXL-CC26X2R1, UNIFLASH, , CC2652R

Hi 

We changed the chipset configuration from CC2652 to CC2642 in sysconfig file for this example code "simple_peripheral_oad_onchip_CC26X2R1_LAUNCHXL_tirtos_ccs ". We flashed the modified project("simple_peripheral_oad_onchip_CC26X2R1_LAUNCHXL_tirtos_ccs ") along with persistant and BIM in the device.  We are trying to connect from starter link ti app then BLE is connected and  immediately it is disconnecting.  We are not able to proceed further with FOTA implementation.
Can you please consider this as high priority and support on this because we are blocked in production level

  • Hi Divya,
    You can refer to the similar topic that David answers
    https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/823544/rtos-cc2640-ble-connected-and-getting-disconnected-immediately

    1. Configure the device to run off the calibrated low Is your BLE module acting as Peripheral? If yes, a test that you can try is to configure the device to run off the calibrated RCOSC_LF (low frequency oscillator). Please take a look at this app note: http://www.ti.com/lit/an/swra499b/swra499b.pdf

    2. Please also review the Hardware Troubleshooting section from this app note: www.ti.com/.../swra640

  • Hi Divya,

    The simple_peripheral_oad_onchip_CC26X2R1_LAUNCHXL_tirtos_ccs project is already established for the CC2642R1F variant so no code changes should be required.  BLE code can be used interchangeably on the CC2652 and CC2642 devices.  If you were previously evaluating on the LAUNCHXL-CC26X2R1 LaunchPad and the BLE connected successfully then this is an indicator that there is an issue with your hardware, in which case you will need to further inspect the links Sunny provided.

    Regards,
    Ryan

  • Hi Ryan,

    http://www.ti.com/lit/an/swra499b/swra499b.pdf

    www.ti.com/.../swra640

    If I click the link it showing the error like below image

    and As per the point 1 . we also configured in the LF clock source as "RCOSC_LF". still we are facing this problem.

    Please find the debug log below, while we are trying to connect,

    Debug Logs

    Adv Set 0 Disabled
    Adv Set 0 disabled after conn 0
    Num Conns: 1
    Connected to 0x66502C7BA891
    *Simple Peripheral
    +Work with >
    Adv Set 1 Disabled
    Device Disconnected!
    Num Conns: 0
    *Simple Peripheral
    +Work with >
    Adv Set 0 Enabled
    Adv Set 1 Enabled
    Adv Set 0 Disabled
    Adv Set 0 disabled after conn 0
    Num Conns: 1
    Connected to 0x66502C7BA891
    *Simple Peripheral
    +Work with >
    Adv Set 1 Disabled
    Device Disconnected!
    Num Conns: 0
    *Simple Peripheral
    +Work with >
    Adv Set 0 Enabled
    Adv Set 1 Enabled
    Adv Set 0 Disabled
    Adv Set 0 disabled after conn 0
    Num Conns: 1
    Connected to 0x71374FCE045F
    *Simple Peripheral
    +Work with >
    Adv Set 1 Disabled
    Device Disconnected!
    Num Conns: 0
    *Simple Peripheral
    +Work with >
    Adv Set 0 Enabled
    Adv Set 1 Enabled
    Adv Set 0 Disabled
    Adv Set 0 disabled after conn 0
    Num Conns: 1
    Connected to 0x71374FCE045F
    *Simple Peripheral
    +Work with >
    Adv Set 1 Disabled
    Device Disconnected!
    Num Conns: 0
    *Simple Peripheral
    +Work with >
    Adv Set 0 Enabled
    Adv Set 1 Enabled

    As per the point 2 Hardware troubleshooting is not need i think so , because we are not facing the problem of disconnection while loading simple peripheral code only facing the problem while loading simple_peripheral_OAD_onchip code.

  • Did you look up the literature numbers?

    SWRA499
    SWRA640 

    Do you have the on-chip BIM and persistent application loaded alongside your simple peripheral application code?  Please consult the BLE5-Stack User's Guide, BLE Enhanced OAD SimpleLink Academy Lab, and simple_peripheral_OAD_onchip README

    Regards,
    Ryan

  • Do you have the on-chip BIM and persistent application loaded alongside your simple peripheral application code?  == No we havent checked like that. 
    We checked by flashing only the simple peripheral application and device is started advertising. It is to just say that there is no problem with HW rit? Correct me if i am wrong 

  • You should test using the correct firmware structure as intended by the on-chip OAD example.

    Regards,
    Ryan

  • We are testing using the correct one only 
    What we are trying to convey we are using simple_peripheral from ble5stack for our project applications
    Our project is in end state and since it is production project we need to invoke FOTA
    So we are trying to test with the simple periheral on-chip OAD
    Before integrating that with our main FW, we tested the example exactly by just porting to CC2642 and at that stage only we are facing this issue

    Hope u understood our issue clearly

    For FOTA , below FW's are using from BLE stack

    simple_peripheral_oad_onchip_CC26X2R1_LAUNCHXL_tirtos_ccs,

    persistent_app_CC26X2R1_LAUNCHXL_tirtos_ccs,

     bim_onchip_CC26X2R1_LAUNCHXL_nortos_ccs

    TO debug the Connection and Disconnection Issues to ensure there is no Hardware issue, below FW is using from BLE stack,

    simple_peripheral_CC26X2R1_LAUNCHXL_tirtos_ccs

  • Hey Divya,

    I am supporting a similar thread of yours here. Can you clarify if we are investigating the same issue?

    If yes, please do not create duplicate threads for the same issue. If not, can you clarify the issue further and how it differs from the linked thread? As Ryan has pointed out, there is no need to change the default example to port to the CC2642 chipset.

  • No its different issue

    As Ryan has pointed out, there is no need to change the default example to port to the CC2642 chipset. ==> sysconfig need to changed correct?

  • SysConfig does not need to be changed to support the CC2642R1.

    Regards,
    Ryan

  • Hi Ryan

    We have tried the above statement like flashing without making any changes expect the HW pin gpio configurations
    At that time device is not even booted and no adv is happening

    We have tried all the possible ways from your statements but still we couldn't solve the issue

    It would be helpful if we have the debugging over the call

  • Hey Mohsan,

    Can you provide some precise details (step-by-step) on what you have tried and the exact HW configuration changes made? I would like to confirm the steps you are following to set up the device for an OAD. There was a gap not addressed in the related thread (here) that needs to be fixed for proper functionality.

    Based off the new thread (here), you were able to get the out of box example working. Step 2 in the new thread does not need to occur, as Ryan has pointed out.

    Does the issue you describe occur before or after the OAD? If the OAD has not been performed, then I assume the issue is setting up the device for the OAD. It's not clear exactly what you have tried, if you can summarize these details I can help determine the root of the issue.

    At that time device is not even booted and no adv is happening

    This indicates that either the BIM is not loaded to the device. It can also indicate that the image you are trying to boot does not pass the initial CRC check/image header verification. If this happens, it should boot into the persistent application.

  • Hi Ammar,

    Based off the new thread (here), you were able to get the out of box example working. Step 2 in the new thread does not need to occur, as Ryan has pointed out.

    =>  We tried without porting to CC2642R . that means default examples code we loaded in to the device(my product) by using uniflash in the following sequence ..... first we loaded presistant app, second OAD application, third bim app as per the user guide . Still it is not working. If i loaded the OAD application without porting to CC2642R in my device(my product). Device is not even booting. so that we are porting to CC2642R. After porting the OAD application and presistant app to CC2642R device(my product) is able to boot and it is advertising. but we are not able to connect If i try to connect it is immediately disconnecting. This the main problem we are facing

    Does the issue you describe occur before or after the OAD? If the OAD has not been performed, then I assume the issue is setting up the device for the OAD. It's not clear exactly what you have tried, if you can summarize these details I can help determine the root of the issue.

    => We ensure that hardware setup(developed product) is working properly by loading a normal simple periperal code with porting it into the CC2642R and it is advertising, connecting and working fine 

    also we found that examples codes of presistant app, OAD app, bim app are loadded properly and OAD is working fine if we loaaded in to the CC2652R1 development kit launch pad.

    This indicates that either the BIM is not loaded to the device. It can also indicate that the image you are trying to boot does not pass the initial CRC check/image header verification. If this happens, it should boot into the persistent application.

    => bim is loadded properly as mentioned in the user guide.

  • Hey Mohan,

    Thanks for the clarification. Can you try to perform a mass erase of the device and also clear any stored bond information on your mobile phone (by "Forgetting" the device)? Perhaps the connection is failing due to stale encryption information on either side.

    What is the sleep clock accuracy on your custom hardware? If it differs from the SCA that's on the launchpad, you need to update this in the application (see here). This could cause the issue you are seeing, but it would have been present when you tested simple_peripheral on the custom hardware.

    Do you have sniffer logs of the issue (on an Ellisys or Frontline sniffer)? It will help to narrow down the issue.

  • Hi Ammar,

    In our custom hardware by default we are using internal clock now we reworked the hardware to external clock. Now we are able to connect successfully without any disconnection. After connecting we are writing value  0x01 in a in a characteristic(0xFFD0) to switch that into a presistent mode tfor the FW upgradation. But after writing the value 1 in characterestic((0xFFD0)) we think that it is not switching to presistent mode, How we are ensured is -> device is not even advertising. Any clue on this ? 

    and why it is not working in a internal clock ? any changes need to be done on software?

  • Hey Mohan,

    Great progress!

    But after writing the value 1 in characterestic((0xFFD0)) we think that it is not switching to presistent mode

    Can you confirm the device reset does occur after writing the characteristic? You can perhaps add a print statement to SimplePeripheral_processConnEvt() right above the SystemReset() call. If the reset occurs and the BIM loads into the persistent app, you will see the green LED flash (UART is not enabled for the persistent application).

    I have seen cases where a mobile phone does not recognize the device by it's new name but rather the old cached name (i.e. "SP OAD on-chip"). Please verify this. If the reset does occur and you still cannot see any advertisements, then you can debug the BIM project to see why it's not booting into the persistent image. To do this, see our Advanced OAD Debugging guide.

    and why it is not working in a internal clock ? any changes need to be done on software?

    This document might help identify any issues running with the internal clock and settings required: https://www.ti.com/lit/swra499c .

  • Additionally, may I request that you please open a new thread describing the new issue? We can continue from there.

    This helps the readability of our forums since the original issue was found and are now debugging a new issue.

  • Make sure the BIM ccfg_app.c -> ccfg.c file uses the correct SET_CCFG_MODE_CONF_SCLK_LF_OPTION (0x03 for LF RCOSC).

  • Hi Ammar,

    With Simple peripheral code:----------------------------------------->

    For External clock, it is working fine with LF XOSC configured in clock source fin sysconfig file.

    For Internal clock,

    Hardware rework done in EVK and I tried with "simple_peripheral_CC26X2R1_LAUNCHXL_tirtos_ccs" code, I configured Device Configuration -> LF clock source as LF RCOSC then it was working fine in CC2642R/CC2652R Launchpad. 

    With Simple peripheral code OAD on-chip code:----------------------------------------->

    For External clock, it is working fine with LF XOSC configured in clock source fin sysconfig file.

    For Internal clock,

    Hardware rework done in EVK and I tried with "simple_peripheral_oad_onchip_CC26X2R1_LAUNCHXL_tirtos_ccs" code, I configured Device Configuration -> LF clock source as LF RCOSC then it was not working in CC2642R/CC2652R Launchpad. 

    Can you please give us some solution for this ?

    Is there any additional configuartion is needed in software ?

    NOTE: :----------------------------------------->

    Not Working condition : While tring to connect BLE It is continiously connecting and disconnecting.

    SDK used : simplelink_cc13x2_26x2_sdk_5_20_00_52

  • SysConfig's Device Configuration should be disabled for simple_peripheral_oad_onchip_CC26X2R1_LAUNCHXL_tirtos_ccs since the CCFG is configured by the bim_onchip_CC26X2R1_LAUNCHXL_nortos_ccs project, Application/ccfg_app.c which points to the linked source\ti\devices\cc13x2_cc26x2\startup_files\ccfg.c file.  This resource should be modified before importing and building the BIM project which will configure the CCFG for LF clock source.

    Regards,
    Ryan

  • Hi Ryan,

    Below mentioned code are available in the bim_onchip_CC26X2R1_LAUNCHXL_nortos_ccs project, Application/ccfg_app.c file, Is there anything to be additionally added to work with Internal clock?

    //BIM OAD Offchip is located in last page, ROM code should jump there.
    #define SET_CCFG_IMAGE_VALID_CONF_IMAGE_VALID 0x56000

    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(startup_files/ccfg.c)

    #define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x03

  • the below code is already available but it is not working for internal clock,

    //BIM OAD Offchip is located in last page, ROM code should jump there.
    #define SET_CCFG_IMAGE_VALID_CONF_IMAGE_VALID 0x56000

    #include <ti/devices/DeviceFamily.h>
    #include DeviceFamily_constructPath(startup_files/ccfg.c)

    #define SET_CCFG_MODE_CONF_SCLK_LF_OPTION 0x03

  • .

    // you can modify it if you want, the recommend way will be to remove the
    // bellow include, copy the content of the <startup_files/ccfg.c> file in this
    // file and rebuild.
    

    As changing the linked ccfg.c directly will affect other projects in the SDK as well.

    Regards,
    Ryan