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.

LP-EM-CC2340R5: CC2340R5 Bluetooth check with IMX93 Linux platform

Part Number: LP-EM-CC2340R5
Other Parts Discussed in Thread: CC2340R5, , UNIFLASH

Hi 

I am working on CC2340R5 Bluetooth module with IMX93 linux platform. Connected the CC2340R5 module with type C USB. On IMX93 device console, observe the below things 

root@imx93:~# lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 002: ID 0451:bef3

root@imx93:~# ls /dev/usb/hiddev0
/dev/usb/hiddev0

root@imx93:~# ls /dev/bus/usb/001/00*
/dev/bus/usb/001/001  /dev/bus/usb/001/002

root@imx93:~# bluetoothctl
Agent registeredct to bluetoothd...
[bluetooth]# devices
No default controller available
[bluetooth]#

Unable to find the device in bluetoothctl 

Do I need to flash the CC2340R5 module and if yes then what is process/steps to flash the bluetooth module. Or any other things which needs to follow


Thank you ! 
 

  • Hi Himanishu,

    You will need to program the CC2340R5 Bluetooth LE module with the host_test example firmware, and then there are additional steps necessary to attach the COM port to BlueZ using hciattach/hciconfig commands.  You can refer to this relevant E2E thread and OpenThread Example Guide (only refer to BLE instructions, the Thread portions can be ignored).

    Edit: ble_controller firmware should be used with BlueZ.

    Regards,
    Ryan

  • Hi Ryan
    Thank you for your replay
    If I am using CC2340R5 Bluetooth device for multiple quantity production, then do I need to follow this process on every Bluetooth Board.

    Regards,
    Himanishu 

  • Yes, as the CC2340R5 are not delivered pre-programmed with the firmware you need for your application.  You can accomplish this using the JTAG SWD or ROM serial bootloader, and there are multiple programming tool options available.

    Regards,
    Ryan

  • Hi Ryan 
    I am using LP-EM-CC2340R5 Bluetooth EVK. For TI Bluetooth EVK, do I need to follow the programming process or EVK is already pre programmed. 
    If the Bluetooth EVK is pre-programmed, then how to check the logs on console.

    Regards,
    Himanishu

  • The LP-EM-CC2340R5 may have a basic_ble pre-programmed, which ever it is will not benefit your needs.  You can use Uniflash -> Settings & Utilities -> "Perform Blank Check" to verify whether a CC2340R5 contains an image in flash memory.

    Regards,
    Ryan

  • Generated the empty_LP_EM_CC2340R5_freertos_ticlang.out file from CCS. And flash the .out file in LP-EM-CC2340R5 EVK using UniFlash 

    LP-EM-CC2340R5 EVK connected to the Linux system with XDS110 debugger and follow below command 

    root@root:~# lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 002: ID 0451:bef3 Texas Instruments, Inc. CC1352R1 Launchpad

    root@root:~# hciattach /dev/ttyACM0 any 115200
    Device setup complete

    root@root:~# hciconfig -a
    hci0: Type: Primary Bus: UART
    BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
    DOWN
    RX bytes:0 acl:0 sco:0 events:0 errors:0
    TX bytes:4 acl:0 sco:0 commands:1 errors:0
    Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    Packet type: DM1 DH1 HV1
    Link policy:
    Link mode: PERIPHERAL ACCEPT

    root@root:~# hciconfig hci0 up
    Can't init device hci0: Connection timed out (110)


    hci0 node is created but BT address is 00:00:00:00:00:00

    From UniFlash check the memory address 0x4E000058 and value is B0155406.

    How can we get the MAC address for hci0 Bluetooth node in linux


  • It is not empty_LP_EM_CC2340R5_freertos_ticlang.out you need to be programming, rather host_test should be used for any use with BlueZ.  The empty example has no Bluetooth LE stack or UART communication layer, thus the BT address being returned is invalid.  You could also confirm operation with BTool before trying BlueZ.

    If you don't need to use BlueZ to communicate Bluetooth instructions to the CC2340R5, but rather just want to read the BT address stored in the FCFG using a command line interface, you can try using the Uniflash CLI Memory Mode.

    Edit: ble_controller firmware should be used with BlueZ.

    Regards,
    Ryan

  • I have programmed the LP-EM-CC2340R5 EVK with host_test_LP_EM_CC2340R5_freertos_ticlang.out file using XDS110 debugger. 

    Now I am able to get the BT address for hci0 node but unable to power on the device using hciconfig hci0 up or bluetoothctl Linux commands.

    I have attached the dmesg logs

    root@LPT424:~$ ls /dev/ttyACM*
    /dev/ttyACM2  /dev/ttyACM3

    root@LPT424:~$ sudo hciattach /dev/ttyACM2 any 115200
    Device setup complete

    root@LPT424:~$ sudo hciconfig -a
    hci0:  Type: Primary  Bus: UART
      BD Address: 40:F3:B0:15:54:06  ACL MTU: 255:5  SCO MTU: 0:0
      DOWN 
      RX bytes:247 acl:0 sco:0 events:18 errors:0
      TX bytes:90 acl:0 sco:0 commands:18 errors:0
      Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
      Packet type: DM1 DH1 HV1 
      Link policy: 
      Link mode: PERIPHERAL ACCEPT


    root@LPT424:~$ sudo hciconfig hci0 up
    Can't init device hci0: Function not implemented (38)

    root@LPT424:~$ sudo dmesg
    [ 2129.823981] usb 1-2: USB disconnect, device number 19
    [ 2130.122221] usb 1-2: new high-speed USB device number 20 using xhci_hcd
    [ 2130.249682] usb 1-2: New USB device found, idVendor=0451, idProduct=bef3, bcdDevice= 1.00
    [ 2130.249699] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2130.249705] usb 1-2: Product: XDS110 (03.00.00.41) Embed with CMSIS-DAP
    [ 2130.249710] usb 1-2: Manufacturer: Texas Instruments
    [ 2130.249714] usb 1-2: SerialNumber: LS470IBJ
    [ 2130.356221] cdc_acm 1-2:1.0: ttyACM2: USB ACM device
    [ 2130.458105] cdc_acm 1-2:1.3: ttyACM3: USB ACM device
    [ 2130.460238] hid-generic 0003:0451:BEF3.000E: hiddev0,hidraw1: USB HID v1.11 Device [Texas Instruments XDS110 (03.00.00.41) Embed with CMSIS-DAP] on usb-0000:00:14.0-2/input5
    [ 2130.490140] usb 1-2: USB disconnect, device number 20
    [ 2145.614641] usb 1-2: new high-speed USB device number 21 using xhci_hcd
    [ 2145.742244] usb 1-2: New USB device found, idVendor=0451, idProduct=bef3, bcdDevice= 1.00
    [ 2145.742251] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [ 2145.742254] usb 1-2: Product: XDS110 (03.00.00.41) Embed with CMSIS-DAP
    [ 2145.742255] usb 1-2: Manufacturer: Texas Instruments
    [ 2145.742257] usb 1-2: SerialNumber: LS470IBJ
    [ 2145.849343] cdc_acm 1-2:1.0: ttyACM2: USB ACM device
    [ 2145.951571] cdc_acm 1-2:1.3: ttyACM3: USB ACM device
    [ 2145.954044] hid-generic 0003:0451:BEF3.000F: hiddev0,hidraw1: USB HID v1.11 Device [Texas Instruments XDS110 (03.00.00.41) Embed with CMSIS-DAP] on usb-0000:00:14.0-2/input5
    [ 2167.563837] Bluetooth: hci0: unexpected cc 0x203b length: 1 < 2
    [ 2167.563933] Bluetooth: hci0: Opcode 0x203b failed: -38
    [ 2179.407789] debugfs: File 'dut_mode' in directory 'hci0' already present!
    [ 2179.466747] Bluetooth: hci0: unexpected cc 0x203b length: 1 < 2
    [ 2179.466861] Bluetooth: hci0: Opcode 0x203b failed: -38
    root@LPT424:~$ 

    root@LPT424:~$ bluetoothd -v
    5.64

    Connection setup image : LP-EM-CC2340R5 EVK connected to the Linux system with XDS110 debugger and follow below command 


    How can we power up the Bluetooth

  • Thank you for the update.  I want to apologize for advertising host_test as this firmware is meant to be used in a different context which is not compatible with BlueZ as noted in the READMEs:

    host_test: implements a pure Bluetooth low energy network processor for use with an external microcontroller or a PC software application such as BTool (provided with the SDK). Host Test supports all GAP roles: Central, Peripheral, Broadcaster and Observer in addition to multi-role combinations of these roles. A network processor incorporates the TI BLE Host and Controller components of the protocol stack on the wireless MCU with the Bluetooth application residing on the external microcontroller. Communication with the network processor occurs through a serial interface (UART or SPI) using the Host Controller Interface (HCI) protocol. The external application uses TI Vendor Specific HCI commands and a limited subset of Bluetooth LE HCI commands/events to implement a Bluetooth application. By placing the Host and Controller on the wireless MCU, the memory requirements on the application processor are reduced since only the application is required. Note: It is not possible to use an external Bluetooth Host stack, such as BlueZ, with Host Test since the network processor implements the Host component. External applications must use the TI Vendor Specific HCI commands for implementing GAP, GATT, Pairing/Bonding, etc., functionality.
    ble_controller: 
    implements a Bluetooth controller that communicates via the Host Controller Interface (HCI) protocol over UART or SPI interfaces. This project is designed to act as a bridge between an internal/external microcontroller or PC software application and the Bluetooth network, managing all incoming and outgoing data and commands through these interfaces.

    You should be using the ble_controller example instead.  Here are similar E2E posts on the topic for your reference.

    Regards,
    Ryan

  • Hi Ryan 
    As you have suggested, I have flashed the ble_controller firmware in LP-EM-CC2340R5 Bluetooth EVK. It works with the only XDS110 debugger. If I connect LP-EM-CC2340R5 Bluetooth EVK UART pins to ttl to USB converter to Linux PC then facing issue with this setup, unable to get the MAC Address.
    ... 
    Is there any nRST (reset) pin sequence necessary for to detect the Bluetooth module on Linux system.
    LP-EM-CC2340R5 Bluetooth EVK  -------------------------------- TTL to USB
    1 -  3.3v     ---------------------------------------------------------------- 3.3 V 
    3 -  RXD    ---------------------------------------------------------------- RXD
    4 -  TXD    ----------------------------------------------------------------  TXD
    20/22 - GND  ------------------------------------------------------------  GND
    37 - CTS     -------------------------------------------------------------- CTS
    36 - RTS     -------------------------------------------------------------- RTS

    I have checked with 3.3V and 5V but same observation. Unable to up the Bluetooth with above setup

  • I'm glad to hear that you are making progress.  I haven't had any issues using a TTL-232R-3V3 as a replacement for the XDS110 backchannel UART.  Please be sure to use the 3V3 version as 5V is not supported on the CC2340R5.  UART flow control (RTS/CTS) is not supported by the code implementation but it's no issue to connect the wires so long as both ends agree that they aren't being used.  Keep in mind that UART works by one end's TX connecting to the other end's RX, so the connection diagram should appear as such

    LP-EM-CC2340R5 Bluetooth EVK  -------------------------------- TTL to USB
    1 -  3.3v     ---------------------------------------------------------------- 3.3 V 
    3 -  RXD    ---------------------------------------------------------------- TXD
    4 -  TXD    ----------------------------------------------------------------  RXD
    20/22 - GND  ------------------------------------------------------------  GND

    Regards,
    Ryan

  • It should be work with ble_controller binary right? is there any extra connection/jumpers required on LP-EM-CC2340R5 Bluetooth EVK?
    If I connect as per above connection, then able to see the ttyUSB0 node. After sudo hciattach /dev/ttyUSB0 any 115200 command node is created but MAC address is not assigned to hci0 node

  • It should work with ble_controller, or else it wouldn't work with the XDS110, and there are no extra jumper connections required outside of what I listed, as also apparent when considering the XDS110 solution.  Did you use "sudo hciconfig hci0 down" to remove any existing adapters?  You can continue to compare the working XDS110 configuration against the TTL-232R-3V3 version, even so far as comparing the UART RX/TX lines with a logic analyzer, so that you may discover the difference.

    Regards,
    Ryan

  • I have connected EVK with Linux system as shown below 
    Can you confirm the connection. 


    I have checked voltages on multimeter getting 3.3V but in hci0 node BD Address is 00:00:00:00:00:00 and DOWN. ble_controller firmware is flashed in LP-EM-CC2340R5 EVK.

    root@LPT424:~$ sudo hciattach /dev/ttyUSB0 any 115200
    Device setup complete

    root@LPT424:~$ sudo hciconfig -a
    hci0:  Type: Primary  Bus: UART
                   BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0
              DOWN 
              RX bytes:0 acl:0 sco:0 events:0 errors:0
              TX bytes:4 acl:0 sco:0 commands:1 errors:0
              Features: 0x00 0x00 0x00 0x00 0x60 0x00 0x00 0x00
              Packet type: DM1 DH1 HV1 
              Link policy: 
              Link mode: PERIPHERAL ACCEPT



  • Your connections appear proximately correct, however the image does not have enough resolution to verify the TX/RX connections and I don't know enough about your specific TTL dongle.  Are you certain that it is providing sufficient 3V3 to the CC2340R5?  Do you have a logic analyzer available for testing?

    Regards,
    Ryan

  • Connection is like below
     
    LP-EM-CC2340R5 Bluetooth EVK  -------------------------------- TTL to USB
    1 -  3.3v     ---------------------------------------------------------------- 3.3 V 
    3 -  RXD    ---------------------------------------------------------------- TXD
    4 -  TXD    ----------------------------------------------------------------  RXD
    20/22 - GND  ------------------------------------------------------------  GND

    Yes, It is providing 3.3 V on 3.3v pin, TXD and RXD pin

    Yes, have logic analyzer 

  • That should be the correction connection diagram.  I'm not sure why the XDS110 works but your TTL does not.  Comparing logic analyzer captures between the XDS110 and TTL setups may reveal additional details.

    Regards,
    Ryan