cancel
Showing results for 
Search instead for 
Did you mean: 

What is the maximum SPI speed and MCU system clock which can be configured for using BlueNRG2-M2SP module with it

darla14
Senior

Hello,

in the X-CUBE-BLE package this document STMicroelectronics.X-CUBE-BLE2_GettingStarted.pdf says the maximum SPI frequency could be 1Mbits/s .

In high perf MCU running at SysClock >500 Mhz , is it possibe to interface BlueNRG2 with it?

using Clock generator we are able to achieve the SPI speed < 1000 Kbits/s but i want to know the considerations which we need to take care as we are seeing some intermittent ble disconnection and some times no advertising.

Regards,

Darla

6 REPLIES 6
Sebastien DENOUAL
ST Employee

Hi @darla14​ ,

BlueNRG-M2SP integrates BleuNRG-2 chipset. Hence, you can rely on BleuNRG-2 datasheet for details on the different peripherals.

For SPI, you can check BlueNRg-2 Datasheet section 3.8 p43.

"Maximal supported baud rate is 1 MHz in slave mode and 8 MHz in master mode."

From my understanding, as you are using X-CUBE-BLE package, your BlueNRG-M2SP is used as "network processor" (interfaced using HCI/ACI commands over SPI). In this case, BlueNRG-2 SPI is configured in slave mode. So max SPI speed is 1Mhz.

Regards,

Sebastien.

One additional comment : Except if you have "bad" wiring or "bad" connection between your MCU and BlueNRG-M2SP, I doubt SPI speed could be root cause ( we are used to have SPI speed closed to 1MHz)

Regards,

Seb

Thanks @Sebastien DENOUAL​  for the pointers toward the datasheet. No, wiring is good. Will increasing the system clock and adjusting the dividers ( such that SPI clock max remains < = 1Mhz) , affect the frequency of the BlueNRG2 SPI interrupt?

I think for every BlueNRG2 SPI interrupt EXTI servicing is invoked which calls registered: hci_tl_lowlevel_isr which in turns checks the data available on the BLE ( IsDataAvailable()).

So my question is if we increase the System clock will this Interrupt occurrence(frequency) will increase or decrease or remain the same and will it affect the behavior of BLE?

I am asking all this because I want to run the ble yet fully utilizing the max system clock of the high perf MCU .(as I have other tasks which require high freq)

Best Regards,

D

Sebastien DENOUAL
ST Employee

Hi @darla14​ ,

SPI speed has no impact on BLE behavior. Indeed, as soon as BlueNRG-2 is having some data to send to main MCU (BLE event), it will raise this IRQ high. This IRQ line will remains high until data are read over SPI by main MCU.

Whatever SPI speed, you will get same amount of BLE event (considering same BLE exchange). So you will get same amount of IRQ. Only difference is the timing, as you will read data with higher datarate, IRQ will remain high for lower time but this has no impact on BLE behavior.

BLE timings are not linked to SPI speed - Advertising/connection interval and all other BLE timings are set via ACI/HCI commands.

Regards,

Sebastien.

darla14
Senior

ignore this

Thanks a lot @Sebastien DENOUAL (ST Employee)​ for the clarification. I will keep these points in mind now while thinking about the design

Regards,D