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.

CC2340 basic_ble project ca

Other Parts Discussed in Thread: LP-EM-CC2340R5

Hi,

SDK:simplelink_cc23xx_sdk_6_40_00_21_eng

Board:LP-EM-CC2340R5

I imported basic_ble project as peripheral from simplelink_cc23xx_sdk_6_40_00_21_eng, the uart output looks fine.

But when I connect to the board by my mobile, the DevInfoService and SimpleProfile do not work.

It only shows Advertisement data:

I add Display_printf to check the Data_start() returned SUCCESS(0x00).

void App_StackInitDoneHandler(gapDeviceInitDoneEvent_t *deviceInitDoneData)
{
    bStatus_t status = SUCCESS;

    // Open Display.
    openDisplay();

    // Print the device address
    Display_printf(dispHandle, dispIndex, 0,
                   "#%5d    BLE Device Address %s",
                   dispIndex,
                   BLEAppUtil_convertBdAddr2Str(deviceInitDoneData->devAddr)); dispIndex++;

#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG ) )
    // Any device that accepts the establishment of a link using
    // any of the connection establishment procedures referred to
    // as being in the Peripheral role.
    // A device operating in the Peripheral role will be in the
    // Slave role in the Link Layer Connection state.
    status = Peripheral_start();
    // TODO: Call Error Handler
#endif

#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( BROADCASTER_CFG ) )
    // A device operating in the Broadcaster role is a device that
    // sends advertising events or periodic advertising events
    status = Broadcaster_start();
    // TODO: Call Error Handler
#endif

#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( CENTRAL_CFG ) )
    // A device that supports the Central role initiates the establishment
    // of an active physical link. A device operating in the Central role will
    // be in the Master role in the Link Layer Connection state.
    // A device operating in the Central role is referred to as a Central.
    status = Central_start();
    // TODO: Call Error Handler
#endif

#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( OBSERVER_CFG ) )
    // A device operating in the Observer role is a device that
    // receives advertising events or periodic advertising events
  status = Observer_start();
  // TODO: Call Error Handler
#endif

#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG | CENTRAL_CFG ) )
    status = Pairing_start();
    Display_printf(dispHandle, dispIndex, 0,
                       "#%5d   Pairing_start status %d",
                       dispIndex,
                       status); dispIndex++;
    // TODO: Call Error Handler
#ifndef OAD_CFG
    status = Data_start();
    // TODO: Call Error Handler

    Display_printf(dispHandle, dispIndex, 0,
                       "#%5d   Data_start status %d",
                       dispIndex,
                       status); dispIndex++;
#endif
#endif


#if defined( HOST_CONFIG ) && ( HOST_CONFIG & ( PERIPHERAL_CFG | CENTRAL_CFG ))  &&  defined(OAD_CFG)
status = BLEAppUtil_oadStartService(&App_OADGrantPermissionCallback);
    // TODO: Call Error Handler
#endif

}

# 0 BLE Device Address 0x806FB01E350D
# 1 Peripheral_start: Register Handlers
# 2 Peripheral_start: Init Adv Set 1
# 3 Peripheral_start: Start Adv Set 1
# 4 Pairing_start: Register Handlers
# 5 Pairing_start status 0
# 6 Data_start: Register Handlers
# 7 Data_start: Add Services
# 8 Data_start status 0
# 9 ADV_START_AFTER_ENABLE: Peripheral role, advhandle: 0

Is there something I need to set?

Thanks

  • Hi,

    All look like the connection is not formed. The GATT table is not found and the log does not display "LINK_ESTABLISHED_EVENT".

    For me, the log is as following:

    #    0    BLE Device Address 0x806FB01E350D
    #    1    Peripheral_start: Register Handlers
    #    2    Peripheral_start: Init Adv Set 1
    #    3    Peripheral_start: Start Adv Set 1
    #    4    Pairing_start: Register Handlers
    #    5    Data_start: Register Handlers
    #    6    Data_start: Add Services
    #    7    ADV_START_AFTER_ENABLE: Peripheral role, advhandle: 0
    #    8    ADV_END_AFTER_DISABLE: Peripheral role, advhandle: 0
    #    9    LINK_ESTABLISHED_EVENT: Peripheral role Connected to 0x5191B4A43F23, connectio
    #   24    ATT_MTU_UPDATED_EVENT

    I would recommend you run a new test on the unmodified project. In the Bluetooth settings of the phone, make sure to "forget" the device prior to the test.

    I hope this will help,

    Best regards,

  • Hi,

    I have re-installed the SDK(simplelink_cc23xx_sdk_6_40_00_21_eng) and run a new test on the unmodified project.

    The log  is as following:

    #    0    BLE Device Address 0x806FB01E350D
    #    1    Peripheral_start: Register Handlers
    #    2    Peripheral_start: Init Adv Set 1
    #    3    Peripheral_start: Start Adv Set 1
    #    4    Pairing_start: Register Handlers
    #    5    Data_start: Register Handlers
    #    6    Data_start: Add Services
    #    7    ADV_START_AFTER_ENABLE: Peripheral role, advhandle: 0
    #    8    ADV_END_AFTER_DISABLE: Peripheral role, advhandle: 0
    #    9    LINK_ESTABLISHED_EVENT: Peripheral role Connected to 0x472247E96C4B, connectionHandle = 0
    #   10    LINK_ESTABLISHED_EVENT: Peripheral role Num Conns = 1
    #   11    ADV_START_AFTER_ENABLE: Peripheral role, advhandle: 0
    #   12    ATT_MTU_UPDATED_EVENT

    But it still can't found device info and GATT table.

     

    Can you help again

    Thanks.

  • Hi,

    Thank you for running this additional test.

    This time, I confirm the connection is properly formed. However, I still cannot reproduce your observations.

    - Can you provide the log from the app (3rd tab on the bottom)

    - Can you try to run the test with an other mobile app? (e.g. BLE Scanner)

    Best regards,

  • Hi,

    The log from lightblue app:

    16:09:56.391 - Starting search for nearby peripherals

    16:09:56.395 - CentralManager not on, delaying scan

    16:09:56.400 - Starting search for nearby peripherals

    16:09:56.400 - CentralManager not on, delaying scan

    16:09:56.407 - Bluetooth State: Powered On

    16:09:56.434 - Starting search for nearby peripherals

    16:09:56.559 - Discovered nearby peripheral: (null) (RSSI: -78)

    16:09:56.564 - Discovered nearby peripheral: (null) (RSSI: -82)

    16:09:56.570 - Discovered nearby peripheral: Basic BLE project (RSSI: -47)

    16:09:57.090 - Discovered nearby peripheral: (null) (RSSI: -86)

    16:09:57.183 - Discovered nearby peripheral: (null) (RSSI: -91)

    16:09:57.262 - Discovered nearby peripheral: (null) (RSSI: -85)

    16:09:57.644 - Discovered nearby peripheral: (null) (RSSI: -90)

    16:09:57.763 - Discovered nearby peripheral: (null) (RSSI: -75)

    16:09:57.842 - Discovered nearby peripheral: (null) (RSSI: -92)

    16:09:57.882 - Discovered nearby peripheral: Mi Watch Lite_11C6 (RSSI: -91)

    16:09:58.012 - Discovered nearby peripheral: (null) (RSSI: -81)

    16:09:58.015 - Discovered nearby peripheral: (null) (RSSI: -94)

    16:09:58.023 - Discovered nearby peripheral: (null) (RSSI: -72)

    16:09:58.118 - Discovered nearby peripheral: (null) (RSSI: -92)

    16:09:58.122 - Discovered nearby peripheral: (null) (RSSI: -96)

    16:09:58.238 - Discovered nearby peripheral: (null) (RSSI: -95)

    16:09:58.319 - Discovered nearby peripheral: (null) (RSSI: -78)

    16:09:58.323 - Discovered nearby peripheral: (null) (RSSI: -86)

    16:09:58.385 - Discovered nearby peripheral: (null) (RSSI: -84)

    16:09:58.492 - Discovered nearby peripheral: (null) (RSSI: -97)

    16:09:58.605 - Discovered nearby peripheral: (null) (RSSI: -97)

    16:09:58.642 - Discovered nearby peripheral: (null) (RSSI: -89)

    16:09:58.993 - Discovered nearby peripheral: (null) (RSSI: -99)

    16:09:59.406 - Connecting to nearby peripheral: Basic BLE project

    16:09:59.416 - Bluetooth State: Powered On

    16:09:59.416 - Starting search for nearby peripherals

    16:09:59.476 - Discovered nearby peripheral: (null) (RSSI: -100)

    16:09:59.848 - Connected to nearby peripheral: Basic BLE project

    16:09:59.853 - Discovered nearby peripheral: (null) (RSSI: -87)

    16:10:00.112 - Discovered nearby peripheral: (null) (RSSI: -95)

    16:10:00.128 - Discovered nearby peripheral: (null) (RSSI: -89)

    16:10:00.181 - Discovered nearby peripheral: (null) (RSSI: -80)

    16:10:00.233 - Discovered nearby peripheral: (null) (RSSI: -82)

    16:10:00.340 - Stopping search for nearby peripherals

    BLE Scanner 4.0 App:

    And I have tried simple_peripheral proect form old sdk. (simplelink_cc23xx_sdk_6_30_00_20_eng)

    It worked fine.

    Is any another process for installing new SDK ? (simplelink_cc23xx_sdk_6_40_00_21_eng

    Thanks!

  • Hi,

    I am sorry, I still cannot reproduce.

    Can you verify the function Data_start(); is called in App_StackInitDoneHandler() (file app_main.c)?

    Then, within Data_start(), can you verify Data_addDevInfoService() and  Data_addSimpleProfile() are properly executed?

    Best regards,

  • Hi,

    I have found the cause of this problem.

    My mobile phone is iPhone12 pro with iOS 15.6.1 <--can't found GATT table.

    I use another phone (iPhone 13 pro with iOS 16.3.1) <--work properly.

    And Android phone with Android 11 is also worked.

    I think this version of SDK(6.40) may have compatibility problem, the previous SDK(6.30) has no such problem.

    Thanks.

  • Hi,

    Good you get this to work.

    For information I tried to reproduce with the phones I have (iPhone 12, iOS 16 and iPhone8, iOS 15) but I could not.

    I have open a ticket to track this issue. If you have the opportunity, it would be helpful to collect a sniffer log for both the working and non-working cases.

    Best regards,