4 Replies Latest reply on Aug 9, 2019 1:12 AM by AnjanaM_61

    How to use standard HCI on CYW20719 / CYW920719Q40EVB-01 Evaluation Kit?

    MaRi_1281436

      Hi. I've read

      - CYW20719 in HCI mode

       

      which advices to write an empty app to the board. I've tried this

       

      - Re: How to use standard HCI on CYW20819 / CYW920819EVB-02 Evaluation Kit?

       

      explains to keep CTS high during reset.

       

      I've connected the dev kit to my Mac and try examples of a third-party Bluetooth stack (btstack.org(.

       

      If I press the Reset Button (SW2), and start the examples right away, I get this HCI sequence

      - HCI Reset

      - HCI Command Complete Event / Reset

      - HCI Read Local Version Information

      - HCI Command Complete Event / Local Version Information

      - HCI Read Local  Name

      - HCI Hardware Error Event, HW Code 0x08

       

      If I press the Reset Button, and wait 5 seconds, I get this

      - HCI Reset

      - HCI Hardware Error Event, HW Code 0x08

       

      If I hold Recovery Button (SW1), then press Reset Button, I get this

      - HCI Reset

      - HCI Command Complete Event / Reset

      - HCI Read Local Version Information

      Nothing happens after this.

       

      I've also seen Cypress Bluetooth SoC Programming Guide but I'm not sure how to get regular HCI to work.

       

      If anybody wants to try, I'm using btstack/port/posix-h4 at master · bluekitchen/btstack · GitHub for testing.

       

      Thanks!

        • 1. Re: How to use standard HCI on CYW20719 / CYW920719Q40EVB-01 Evaluation Kit?
          AnjanaM_61

          Hi ,

           

          The method suggested in - CYW20719 in HCI mode should work for HCI commands testing.

          Can you please try with our CyBluetool if you have a Windows or linux system CyBluetool (Linux Installer) CyBluetool (Windows Installer)  ?

           

          1. First please program from WICED SDK with an empty project with

          #include "sparcommon.h"

          APPLICATION_START() {}

           

          and try sending commands with CyBluetool.

           

          Thanks,

          Anjana

          1 of 1 people found this helpful
          • 2. Re: How to use standard HCI on CYW20719 / CYW920719Q40EVB-01 Evaluation Kit?
            MaRi_1281436

            I've put the suggested code into a file hci.c:

             

            #include "sparcommon.h"

            APPLICATION_START() {}

             

            and have a Makefile with

             

            NAME := hci

            APP_SRC  = hci.c

             

            then, I've uploaded it with

            $ ./make snip.bt.hci-CYW920719Q40EVB_01 download

             

            Compiling spar_setup.c

            Compiling hci.c

            Compiling wiced_platform.c

            Compiling wiced_platform_pin_config.c

            Compiling lib_installer.c

            Linking target ELF

            OK, made elf.

            ../../43xxx_Wi-Fi/tools/ARM_GNU/OSX/bin/arm-none-eabi-objdump: section '.ordered' mentioned in a -j option, but not found in any input file

            ../../43xxx_Wi-Fi/tools/ARM_GNU/OSX/bin/arm-none-eabi-objdump: section '.data' mentioned in a -j option, but not found in any input file

            ../../43xxx_Wi-Fi/tools/ARM_GNU/OSX/bin/arm-none-eabi-objdump: section '.aon' mentioned in a -j option, but not found in any input file

            ../../43xxx_Wi-Fi/tools/ARM_GNU/OSX/bin/arm-none-eabi-objdump: section '.pram_rodata' mentioned in a -j option, but not found in any input file

            Call to hci_spar_crt_setup @ 00215871

            OK, made /Projects/Broadcom/WICED-Studio-6.2.1-SDK/20719-B1_Bluetooth/WICED/../build/hci-CYW920719Q40EVB_01-rom-ram-Wiced-release/A_20719B1-hci-rom-ram-spar.cgs. MD5 sum is:

            51b74b98f13dbe141f0396550673a97c ../build/hci-CYW920719Q40EVB_01-rom-ram-Wiced-release/A_20719B1-hci-rom-ram-spar.cgs

            --------------------------------------------------------------------------------

            Patch code starts at              0x00270400 (RAM address)

            Patch code ends at                0x0027ACD8 (RAM address)

            Patch RW/ZI size                  2936 bytes

            Application starts at             0x00215768 (RAM address)

            Application ends at               0x00215870 (RAM address)

            Patch code size                        43224 bytes

            Application RAM footprint                264 bytes

                                                  ------

            Total RAM footprint                     3200 bytes (3.1kiB)

            --------------------------------------------------------------------------------

            Converting CGS to HEX...

            Conversion complete

            Creating OTA images...

            Conversion complete

            OTA image footprint in NV is 50218 bytes

            Detecting device...

            Device found

            Downloading application...

            Download complete

            Application running.

             

            Now. I start CyBluetool on Windows and connect to the controller successfully.

             

            07/11/19 13:50:36.452 com2 -- Transport opened

            com2@115200

            07/11/19 13:50:36.452 com2 -- Protocol set to HCI

            com2@115200

             

            Then, I execute an HCI Reset

             

            07/11/19 13:51:22.788 com2@115200 c> Reset

            HCI Command

            com2@115200

            [03 0C 00 ]

            opcode = 0x0C03 (3075, "Reset")

             

             

            07/11/19 13:51:22.803 com2 <e Hardware Error

            HCI Event

            com2@115200

            [10 01 ]: 00

            event = 0x10 (16,"Hardware Error")

            Hardware_Code = 0x0 (0, "UART Parsing Error")

             

             

            07/11/19 13:51:22.834 com2 <e Vendor Specific

            HCI Event

            com2@115200

            [FF 08 ]: 1B 04 01 00 00 79 01 00

            event = 0xFF (255,"Vendor Specific")

            Event_Sub_Code = 0x1B (27, "DBFW Dump")

            Dump Type = 0x4 (4, "DBFW TraceDump2")

            Nof T = 0x1 (1)

            Trace Status = 0x0 (0, "")

            TRACE-1 = "00 79 01 00"

             

            I did not expect to get the Hardware error. What did I do wrong?

            • 3. Re: How to use standard HCI on CYW20719 / CYW920719Q40EVB-01 Evaluation Kit?
              MaRi_1281436

              After successfully following the Run CYW20706 in HCI Mode guide with the 20706 dev kit, I've tried the same approach with the 20719: disabled the trace log by wiced_set_debug_uart(WICED_ROUTE_DEBUG_NONE) in the hello_sensor demo application and keep CTS high during RESET - the USB UART is closed when pressing RESET button.

               

              With this, the 20719 is mostly working over HCI. Could somebody explain the difference between an empty application and a full Bluetooth application? Is this correct?

               

              During startup, I get a few 'HCI Event Command Complete - Command Disallowed" for HCI Reset, HCI Read Local Name, HCI Set Event Mask, ... more or less all configuration commands. Any ideas about this?

              • 4. Re: How to use standard HCI on CYW20719 / CYW920719Q40EVB-01 Evaluation Kit?
                AnjanaM_61

                Hi ,

                 

                Not sure if your issue is resolved or not.

                 

                Whenever there is a full bluetooth application loaded, there will be HCI transaction going on from the application. The reason why its recommended to have an empty application is , it avoids any unwanted HCI transaction and will respond to the HCI commands sending from the host connected.

                I had tested 20719 downloaded with empty application as suggested here: CYW20719 in HCI mode  and was able to successfully communicate with CyBluetool several times.

                Please make sure the CyBluetool settings are correct ( flow control enabled, HCI UART connected with baud rate 115200bps). Make sure HCI uart port is not connected to any other console when you try communicating with CyBluetool.

                 

                Thanks,
                Anjana

                1 of 1 people found this helpful