8 years, 2 months ago.

how to read response after HCI commands over SPI on BlueNRG?

how to read response after HCI commands over SPI on BlueNRG? and how exactly spi communication is organised with this chip? It is unclear in datasheats on official site. Thanks

Question relating to:

1 Answer

8 years, 2 months ago.

Hi Max,

Please notice that mbed has an abstract interface for Bluetooth LE defined by the BLE_API:

https://developer.mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/

What kind of application are you trying to build? I'm curious to know why you would like to use the BlueNRG HCI commands directly.

The SPI communication protocol and the format of HCI commands and events exchanged via SPI by the BlueNRG chip (X-NUCLEO-IDB04A1) is documented in UM1755, BlueNRG Bluetooth LE stack application command interface ACI:

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00114498.pdf

For the BlueNRG-MS chip (X-NUCLEO-IDB05A1), instead, you can refer to UM1865, BlueNRG-MS Bluetooth LE stack application command interface ACI:

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/DM00162667.pdf

Each of the documents above includes a specific section describing the SPI Interface (section 5).

The SPI communication in the mbed library for BlueNRG is implemented in the source/BlueNRGDevice.cpp and source/platform/stm32_bluenrg_ble.cpp files. If you want to check the messages being exchanged between the BlueNRG chip and the microcontroller, you can enable the PRINT_CSV_FORMAT preprocessor define in x-nucleo-idb0xa1/bluenrg-hci/debug.h

Accepted Answer