22. HCI Mode

In earlier sections, we covered using the DA1453x as a standalone device, where it runs the application firmware. Alternatively, the DA1453x can be employed in HCI (Host Controller Interface) mode. In this setup, another processor manages the Bluetooth LE stack’s host part, while the DA1453x handles the controller part. Typically, a serial interface, such as UART or SPI, connects the two. This configuration is often chosen for integrating Bluetooth LE capability into systems running the Linux operating system.

The following section describes how to run HCI example on DA14531 DEVKT-P with DA14531 daughter board(this process is same for DA14535 and DA1453x DEVKT-P) in HCI mode using the UART interface. For more details you can refer to the UM-B-146: DA14585/DA14531 HCI Commands.

22.1. Preparing the Development Kits

When using a DA14531 or DA1453x DEVKT-P in HCI mode we will configure it so that the DA14531 can boot from flash and connect to the host using a 4-wire UART interface.

To do this we will use the following pins on the DA14531 as the UART interface:
  • P0_6: UART CTS (Input)

  • P0_7: UART RTS (Output)

  • P0_8: UART RXD (Input)

  • P0_9: UART TXD (Output)

Hint

DA1453x family members are pin to pin compatible.With this understanding you can use the following pins on the DA14535.

In the following sections we describe how to configure each of the supported DA14531 and DA1453x DEVKT-P to use the above signals as the UART interface.

22.1.1. DA14531 DEVKT-P HCI Mode Configuration (DA14531 Daughter board)

The jumpers/wires illustrated below need to be added to the DA14531 DEVKT-P to enable boot from Flash and HCI mode via this UART interface.

_images/da14531_pro_hci.png

Figure 70 Additional jumpers for UART HCI mode on the DA14531 DEVKT-P

22.1.1.1. DA14531 DEVKT-P HCI Mode Configuration (DA14531 Tiny Module)

The jumpers/wires illustrated below need to be added to the DA14531 DEVKT-P in order to enable boot from Flash and HCI mode via this UART interface.

_images/da14531_module_pro_hci.png

Figure 71 Additional jumpers for UART HCI mode on the DA14531 DEVKT-P (as can be seen the on board SPI flash jumpers have been removed)

22.1.2. DA1453x DEVKT-P HCI Mode Configuration (DA14535 Daughter board)

The jumpers/wires illustrated below need to be added to the DA1453x DEVKT-P in order to enable boot from Flash and HCI mode via this UART interface DA14535 device.

_images/da14535_pro_hci.svg

Figure 72 Additional jumpers for UART HCI mode on the DA1453x DEVKT-P

22.1.2.1. DA1453x DEVKT-P HCI Mode Configuration (DA1453x Tiny Module)

The jumpers/wires illustrated below need to be added to the DA1453x DEVKT-P to enable boot from Flash and HCI mode via this UART interface for DA14535 module.

_images/da14535_module_pro_hci.svg

Figure 73 Additional jumpers for UART HCI mode on the DA1453x DEVKT-P (as can be seen the on board SPI flash jumpers have been removed)

22.2. HCI Example

SDK6 contains an example application for the DA1453x that allows it to operate in HCI mode. This example application can be found at the following location within the SDK:

<sdk_root_directory>\projects\target_apps\hci\hci\

Before deploying this application, it’s essential to tailor it for the UART interface using the designated pins. To implement these adjustments,

follow these steps :
  1. Launch Keil and open the HCI project.

  2. In the user_periph_setup.h file change the pins used to implement the UART to the following:

    // Define UART1 Pads
    #if defined (__DA14531__)
       #define UART1_TX_PORT           GPIO_PORT_0
       #define UART1_TX_PIN            GPIO_PIN_9
    
       #define UART1_RX_PORT           GPIO_PORT_0
       #define UART1_RX_PIN            GPIO_PIN_8
    
       #define UART1_RTSN_PORT         GPIO_PORT_0
       #define UART1_RTSN_PIN          GPIO_PIN_7
    
       #define UART1_CTSN_PORT         GPIO_PORT_0
       #define UART1_CTSN_PIN          GPIO_PIN_6
    #else
    

Warning

Pay attention to UART2_TX_PIN also and make sure it is configured with different pin for example assign it to P0_1

+ #define UART2_TX_PORT           GPIO_PORT_0
+ #define UART2_TX_PIN            GPIO_PIN_1

- #define UART2_TX_PORT           GPIO_PORT_0
- #define UART2_TX_PIN            GPIO_PIN_6
  1. Once the changes detailed above have been made and the HCI example has been re-compiled it can be programmed into the flash memory of the SPI flash on Development kit or the module.To do this, follow the instructions in the Flash Programming chapter - the file to be programmed is located within the HCI example folder:

    sdk_root_directory>\\projects\\target_apps\\hci\\hci\\Keil_5\\out_DA14531\\Objects\\hci_531.bin

    Or you can also download the file dircetleo the RAM with Keil Debugger

Run and test the HCI example:

Upon successfully programming the HCI example into the Development Kit board,we can run and test the project. This test can be performed with a terminal emulator such as RealTerm.

  1. Configure the terminal emulator with the following settings:
    • Baud Rate: 115200

    • Data Bits: 8

    • Stop Bits: 1

    • Parity: None

    • Flow Control: Hardware (RTS/CTS)

  2. Now use the terminal emulator to transmit the following hex bytes to the DA14531:

    0x01 0x01 0x10 0x00

Note

This is the HCI command Read Local Version, for further details refer to the Bluetooth specification.

In response you should get a string of bytes representing the version numbers of the software components running on the DA14531, as illustrated in the following diagr am.
_images/realterm_hci_1.png

Figure 74 Run the project on DA14531 device (daughterboard)

You have now successfully configured your DA14531 DEVKT-P to operate in HCI mode using a 4-wire UART. You can run this project on other devices of DA1453x family with htis quality.