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: Simple BLE Peripheral from SimpleLink SDK 1.3.5 advertises, but won't connect on custom board

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640,

Hello fellow E2E'rs,

I'm attempting to follow the "Running on Customs Boards" section of the Bluetooth Low Energy Software Developer's Guide here: http://software-dl.ti.com/lprf/sdg-latest/html/ble-stack/index.html#running-the-sdk-on-custom-boards

I've done this 3 times on fresh installs, and based my new project off of the Simple BLE Periphal project, but whenever I run it on my custom board, I can see my board advertise fine from both Android (Nexus 5, and Nexus 5x) as well as an iPhone 5C using the Nordic nRF Connect app, but whenever I connect, I see it spin for awhile, and then eventually time out withe an error code of 0x85 (133) on both the iPhone and Android phones. As I've said before, I've never been able to get the BTool to work correctly with any of the projects, and can't find adequate documentation for it to get it working - so before you ask - I haven't used BTool to troubleshoot this.

I'm running the 5.2.6 TI compiler as has been suggested in other forum posts, with no luck. I can also use my CCS installation to successfully build and run the SensorTag project on the SensorTag board - so I'm confident my toolchain is in working order. And my custom board is a proven board design as it was previously working fine with a CC2640 on it rather than the current configuration of a CC2640R2. This is a "production" board with a proven antenna design, so I don't think that's it.

My question is, has anyone run into a similar issue with a project based off of the SimpleLink SDK 1.3.5 and the CC2640R2? I've tried all of the sensible troubleshooting steps like making sure my Board Pin Map is blank only containing PIN_TERMINATE, and making sure I have put Display_DISABLE_ALL in my predefined symbols list. I just find it very odd that I can see the thing advertise, but can't connect. I'm also willing to share my project source code in case anyone is interested in looking at it to see if I've missed anything obvious.

And please - ANY help would be appreciated as this project depends on the ability to use the CC2640R2.

Thanks guys,

-Ben

  • Hello Ben,

    Typically these problems occur when the RF front end and bias is not configured correctly in SW to match the actual layout or if there is a 32 kHz crystal issue. Did you follow the troubleshooting tips on the TI BLE Wiki, HW Bringup article? The default SW uses the Internal Differential layout configuration from the LaunchPad (7ID).

    Also, the default TI ARM Compiler for CC2640R2F SDK 1.35 is 16.09.01.LTS.

    Likewise, the BTool User Guide can be found on the aforementioned wiki under "User Guides & Training".

    Best wishes
  • Hi JXS,

    Your suggestion about the RF frontend was actually the first thing I looked into. My custom board uses a differential frontend with external bias, and the package is the 5XD variant of the CC2640R2, and the proper symbols are defined in the project for this configuration.

    Thanks for the suggestion on the compiler version, and for pointing out that BTool has better documentation now. I couldn't find it when I had looked previously. I'll look further into this tonight, and will post details about whatever I find out.

    Thanks again,
    -Ben
  • Hello again,

    I'm sorry that it's taken so long for me to reply, but the Windows 10 Creators Update ate my PC and I had to completely rebuild my software. Anyways, I had a chance to run BTool using a LAUNCHXL CC2640R2 and collected the logs from a Scan, and then an unsuccessful Connection attempt to my custom board. I'm attaching the log collected here to see if anyone has any further ideas about what I could possible be doing wrong - but since even the official BTool doesn't connect successfully, I believe it's got to be my software configuration.

    I'm currently going through my code line by line, and comparing it to the Simple BLE Peripheral code I based it off of to see if there could possibly be ANYTHING I've missed, but in the meantime, does anyone have any other ideas?

    Thanks,

    -Ben

    [1] : <Tx> - 09:34:31.287
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE04 (GAP_DeviceDiscoveryRequest)
    -Data Length    : 0x03 (3) byte(s)
     Mode           : 0x03 (3) (All)
     ActiveScan     : 0x01 (1) (Enable)
     WhiteList      : 0x00 (0) (Disable)
    Dump(Tx):
    0000:01 04 FE 03 03 01 00                            .......
    --------------------------------------------------------------------
    [2] : <Rx> - 09:34:31.334
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFE04 (GAP_DeviceDiscoveryRequest)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 04 FE 00                      .........
    --------------------------------------------------------------------
    [3] : <Rx> - 09:34:31.349
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x18 (24) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x00 (0) (Connectable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : D0:03:4B:04:F6:81
     Rssi           : 0xB4 (180)
     DataLength     : 0x0B (11)
     Data           : 02:01:1A:07:FF:4C:00:10:02:01:00
    Dump(Rx):
    0000:04 FF 18 0D 06 00 00 00 81 F6 04 4B 03 D0 B4 0B ...........K....
    0010:02 01 1A 07 FF 4C 00 10 02 01 00                .....L.....
    --------------------------------------------------------------------
    [4] : <Rx> - 09:34:31.412
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x14 (20) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x00 (0) (Connectable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : 54:6C:0E:2C:2A:6A
     Rssi           : 0xDB (219)
     DataLength     : 0x07 (7)
     Data           : 02:01:06:03:02:F0:FF
    Dump(Rx):
    0000:04 FF 14 0D 06 00 00 00 6A 2A 2C 0E 6C 54 DB 07 ........j*,.lT..
    0010:02 01 06 03 02 F0 FF                            .......
    --------------------------------------------------------------------
    [5] : <Rx> - 09:34:31.427
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x2B (43) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x04 (4) (Scan Response)
     AddrType       : 0x00 (0) (Public)
     Addr           : 54:6C:0E:2C:2A:6A
     Rssi           : 0xDB (219)
     DataLength     : 0x1E (30)
     Data           : 14:09:53:69:6D:70:6C:65:42:4C:45:50:65:72:69:70:
                      68:65:72:61:6C:05:12:50:00:20:03:02:0A:00
    Dump(Rx):
    0000:04 FF 2B 0D 06 00 04 00 6A 2A 2C 0E 6C 54 DB 1E ..+.....j*,.lT..
    0010:14 09 53 69 6D 70 6C 65 42 4C 45 50 65 72 69 70 ..SimpleBLEPerip
    0020:68 65 72 61 6C 05 12 50 00 20 03 02 0A 00       heral..P. ....
    --------------------------------------------------------------------
    [6] : <Rx> - 09:34:31.521
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x2C (44) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x02 (2) (Scannable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : A4:77:33:F2:F2:C5
     Rssi           : 0xBD (189)
     DataLength     : 0x1F (31)
     Data           : 02:01:06:03:03:9F:FE:17:16:9F:FE:02:30:54:6F:57:
                      70:38:55:66:6D:66:6B:00:00:01:5D:34:73:F2:45
    Dump(Rx):
    0000:04 FF 2C 0D 06 00 02 00 C5 F2 F2 33 77 A4 BD 1F ..,........3w...
    0010:02 01 06 03 03 9F FE 17 16 9F FE 02 30 54 6F 57 ............0ToW
    0020:70 38 55 66 6D 66 6B 00 00 01 5D 34 73 F2 45    p8Ufmfk...]4s.E
    --------------------------------------------------------------------
    [7] : <Rx> - 09:34:31.537
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x17 (23) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x04 (4) (Scan Response)
     AddrType       : 0x00 (0) (Public)
     Addr           : A4:77:33:F2:F2:C5
     Rssi           : 0xBD (189)
     DataLength     : 0x0A (10)
     Data           : 09:FF:E0:00:00:68:CA:91:79:62
    Dump(Rx):
    0000:04 FF 17 0D 06 00 04 00 C5 F2 F2 33 77 A4 BD 0A ...........3w...
    0010:09 FF E0 00 00 68 CA 91 79 62                   .....h..yb
    --------------------------------------------------------------------
    [8] : <Rx> - 09:34:31.552
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x1C (28) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x03 (3) (Non-connectable Undirect Advertisement)
     AddrType       : 0x01 (1) (Static)
     Addr           : 3C:CE:68:24:57:DE
     Rssi           : 0xB4 (180)
     DataLength     : 0x0F (15)
     Data           : 02:01:1B:0B:FF:4C:00:09:06:03:93:C0:A8:01:64
    Dump(Rx):
    0000:04 FF 1C 0D 06 00 03 01 DE 57 24 68 CE 3C B4 0F .........W$h.<..
    0010:02 01 1B 0B FF 4C 00 09 06 03 93 C0 A8 01 64    .....L........d
    --------------------------------------------------------------------
    [9] : <Rx> - 09:34:31.599
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x2C (44) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x02 (2) (Scannable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : F4:F5:D8:B4:7D:A3
     Rssi           : 0xB6 (182)
     DataLength     : 0x1F (31)
     Data           : 02:01:06:03:03:9F:FE:17:16:9F:FE:00:00:00:00:00:
                      00:00:00:00:00:00:00:00:00:00:00:00:00:00:00
    Dump(Rx):
    0000:04 FF 2C 0D 06 00 02 00 A3 7D B4 D8 F5 F4 B6 1F ..,......}......
    0010:02 01 06 03 03 9F FE 17 16 9F FE 00 00 00 00 00 ................
    0020:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ...............
    --------------------------------------------------------------------
    [10] : <Rx> - 09:34:31.615
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x17 (23) bytes(s)
     Event          : 0x060D (1549) (GAP_DeviceInformation)
     Status         : 0x00 (0) (Success)
     EventType      : 0x04 (4) (Scan Response)
     AddrType       : 0x00 (0) (Public)
     Addr           : F4:F5:D8:B4:7D:A3
     Rssi           : 0xB5 (181)
     DataLength     : 0x0A (10)
     Data           : 09:FF:E0:00:00:65:CA:82:3E:D1
    Dump(Rx):
    0000:04 FF 17 0D 06 00 04 00 A3 7D B4 D8 F5 F4 B5 0A .........}......
    0010:09 FF E0 00 00 65 CA 82 3E D1                   .....e..>.
    --------------------------------------------------------------------
    [11] : <Rx> - 09:34:41.553
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x2C (44) bytes(s)
     Event          : 0x0601 (1537) (GAP_DeviceDiscoveryDone)
     Status         : 0x00 (0) (Success)
     NumDevs        : 0x05 (5)
     Device #0
     EventType      : 0x00 (0) (Connectable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : D0:03:4B:04:F6:81
     Device #1
     EventType      : 0x00 (0) (Connectable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : 54:6C:0E:2C:2A:6A
     Device #2
     EventType      : 0x02 (2) (Scannable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : A4:77:33:F2:F2:C5
     Device #3
     EventType      : 0x03 (3) (Non-connectable Undirect Advertisement)
     AddrType       : 0x01 (1) (Static)
     Addr           : 3C:CE:68:24:57:DE
     Device #4
     EventType      : 0x02 (2) (Scannable Undirect Advertisement)
     AddrType       : 0x00 (0) (Public)
     Addr           : F4:F5:D8:B4:7D:A3
    Dump(Rx):
    0000:04 FF 2C 01 06 00 05 00 00 81 F6 04 4B 03 D0 00 ..,.........K...
    0010:00 6A 2A 2C 0E 6C 54 02 00 C5 F2 F2 33 77 A4 03 .j*,.lT.....3w..
    0020:01 DE 57 24 68 CE 3C 02 00 A3 7D B4 D8 F5 F4    ..W$h.<...}....
    --------------------------------------------------------------------
    [12] : <Tx> - 09:34:56.569
    -Type           : 0x01 (Command)
    -OpCode         : 0xFE09 (GAP_EstablishLinkRequest)
    -Data Length    : 0x09 (9) byte(s)
     HighDutyCycle  : 0x00 (0) (Disable)
     WhiteList      : 0x00 (0) (Disable)
     AddrTypePeer   : 0x00 (0) (Public)
     PeerAddr       : 54:6C:0E:2C:2A:6A
    Dump(Tx):
    0000:01 09 FE 09 00 00 00 6A 2A 2C 0E 6C 54          .......j*,.lT
    --------------------------------------------------------------------
    [13] : <Rx> - 09:34:56.616
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus)
     Status         : 0x00 (0) (Success)
     OpCode         : 0xFE09 (GAP_EstablishLinkRequest)
     DataLength     : 0x00 (0)
    Dump(Rx):
    0000:04 FF 06 7F 06 00 09 FE 00                      .........
    --------------------------------------------------------------------
    [14] : <Info> - 09:34:56.694
    Device Connected
    Handle = 0x0000
    Addr Type = 0x00 (Public)
    BDAddr = 54:6C:0E:2C:2A:6A
    --------------------------------------------------------------------
    [15] : <Rx> - 09:34:56.679
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x14 (20) bytes(s)
     Event          : 0x0605 (1541) (GAP_EstablishLink)
     Status         : 0x00 (0) (Success)
     DevAddrType    : 0x00 (0) (Public)
     DevAddr        : 54:6C:0E:2C:2A:6A
     ConnHandle     : 0x0000 (0)
     ConnRole       : 0x08 (8) (Central)
     ConnInterval   : 0x0050 (80)
     ConnLatency    : 0x0000 (0)
     ConnTimeout    : 0x07D0 (2000)
     ClockAccuracy  : 0x00 (0)
    Dump(Rx):
    0000:04 FF 14 05 06 00 00 6A 2A 2C 0E 6C 54 00 00 08 .......j*,.lT...
    0010:50 00 00 00 D0 07 00                            P......
    --------------------------------------------------------------------
    [16] : <Info> - 09:34:57.257
    Device Disconnected
    Handle = 0x0000
    Addr Type = 0x00 (Public)
    BDAddr = 54:6C:0E:2C:2A:6A
    --------------------------------------------------------------------
    [17] : <Rx> - 09:34:57.257
    -Type           : 0x04 (Event)
    -EventCode      : 0x00FF (Event)
    -Data Length    : 0x06 (6) bytes(s)
     Event          : 0x0606 (1542) (GAP_TerminateLink)
     Status         : 0x00 (0) (Success)
     ConnHandle     : 0x0000 (0)
     Reason         : 0x3E (62) (Failed To Establish)
    Dump(Rx):
    0000:04 FF 06 06 06 00 00 00 3E                      ........>
    --------------------------------------------------------------------
    

  • Hello Ben,

    No problem. One more reason for me to hang onto Win7 :)

    Have you gone through the check items on the HW Troubleshooting wiki article? You may have a sleep clock accuracy issue on your board. A quick test is to disable POWER_SAVING. If the connection is stable w/o power saving then you need to look into the 32k xtal accuracy. You won't see this during ADV/scan since these operations are not sleep clock dependent.

    Best wishes
  • Hello again JXS,

    Thanks again for pointing me at something I hadn't previously looked at.

    I first tried disabling POWER_SAVING, but still couldn't connect either.

    For whatever reason, I had never found the link to the "BLE Connection Issues" section on the Wiki - thanks for pointing it out. I followed each step of the advice, first mapping the 32kHz crystal output to a pin that is easily accessible on my custom board, and indeed, it doesn't appear to be 32.768kHz. According to my cheap Oscilloscope, it's more like 31.264kHz. I then checked the actual source according to OSCClockSourceGet(OSC_SRC_CLK_LF), and it indeed appears to be OSC_XOSC_LF as expected. This is really odd to me, and seems to indicate a hardware problem with my crystal oscillator.

    I'm going to pass along this information to my EE and see if he can look into it. It's really weird because this same exact board design works fine with the CC2640, but not the CC2640RD. I'll be sure to post back with whatever I find to solve the issue, no matter what.

    Thanks again,

    -Ben

  • Ok,

    After talking this over with my EE, he concurred that it was the crystal that was at fault (even though this same exact model of crystal oscillator worked on the same exact board layout with the original CC2640) and stole the one off of the Launch XL and put it on our board. At this point, everything works as expected. Our board advertises, and connects without issue.

    He's going to take another look at the recommended specs for an oscillator and choose a different one going forward.

    Thanks for all the help and suggestions, and thanks for being patient with me. I would have never guessed this was going to be the culprit, especially because the part we used was one of the recommended TI oscillators. Oh well.

    Hope this topic helps folks in the future that run into the same issue.

    -Ben