cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot connect to BNRG2A1 using normal HCI commands (in Zephyr RTOS)

WYede.1
Associate

I am not able to establish a BLE connection between the Zephyr RTOS and any other device I have (phone + laptop).

My setup is as follows

  • a NUCLEO-L4R5ZI board with a X-NUCLEO-BNRG2A1 shield, powered by the ST-Link over USB from my laptop
  • a Digilent Analog Discovery 2 connected to the SPI, CS, and IRQ pins
  • Zephyr RTOS 2.4.99 extended with support for the X-NUCLEO-BNRG2A1 shield

I have attached debug log from the nRF Connect Android App (Log 2021-01-14 110432) and a heavily annotated log of the SPI communication between board and shield (sib-connect3)

I was able to port the SensorDemo_BleSensor-App to this board and it is working. Unfortunately it only uses Vendor Specific commands, so it does not help me in analyzing what, if anything, I'm doing wrong...

Your help would be greatly appreciated.

Kind regards,

Wim Yedema

3 REPLIES 3
Winfred LU
ST Employee

Please try to program X-NUCLEO-BNRG2A1 with the DTM firmware, built from DK with defining LL_ONLY.

This is to tell the BlueNRG-M2SP module not to use its BLE stack (vendor specific commands and events). It will act as a transceiver with standard HCI commands, and rely on the stack in Zepher OS.

To analyze the SPI transactions, please refer to ACI document located in:

file:///C:/Program%20Files%20(x86)/STMicroelectronics/BlueNRG%20GUI%203.2.1/Docs/gui_aci_html/bluenrg_1_v2_x.html

There shall be some error code or status in those transactions indicating what's wrong.

Take the first one for example, it is an ACI Blue Initialized Event

  • MOSI: 0B 00 00 00 00 FF FF FF FF FF FF
  • MISO: FF 08 01 06 00 04 FF 03 01 00 01
    • SPI header
      • 0B --> Read operation
      • WBUF length = 0x0108 --> BlueNRG-M2 DMA FIFO is still empty
      • RBUF length = 0x0006 --> BlueNRG-M2 is sending the SPI packet with 6 bytes
    • Data = 04 FF 03 01 00 01
      • 04 --> HCI event packet
      • FF --> this is an ACI (vendor specific) event
      • 01 00
        • event code = 0x0001 --> ACI_BLUE_INITIALIZED_EVENT
      • 01
        • Reason code = 1 --> firmware started properly

MMate.3
Associate II

Hi, I'm solving similar problm while integrating the Bluenrg2+DTM into Zephyr. I can advertise and connect the peripheral to the nRF connect but the list of gatt services are missing.

There is an option for the BlueNRG in the Zephyr sources (CONFIG_BT_BLUENRG_ACI), but it is related to Bluenrg-MS which is on supported shield.

In the spi driver for shield i see that LL_MODE is enabled, so I follow this in my own driver. Wether I set the LL_MODE with aci_write_config_data or not the behavior of application is if I did not transfer the service and characteristics to the client.

Is there a document describing this particular feature in detail? Documents I found so far did not helped (bluenrg-datasheet, UM1755, UM1865, UM2058,...)

MMate.3
Associate II

I did build the DTM example defining the LL_ONLY (using the TrueStudio), and flash it to the Bluenrg2.

The result is completely undefined behavior on the uart bus, not even initialization does work.

Can some of the ST engineers tell us how on earth use the Bluenrg2 with other stacks? Apparently there are some firmwares that can do this, as Bluenrg-ms does have support in the Zephyr rtos.

Thanks for the information in advance.