cancel
Showing results for 
Search instead for 
Did you mean: 

Why my BlueNRG-MS/SPBTLE-RF chip in not initializing/does not communicate with STM32L073RZ MCU?

CMARY.1
Associate

Hello,

In a working "version 1" of a cutom PCB, I used a SPBTLE-RF chip to communicate with my STM32 MCU.

MOSI, MISO, CLK, RST, and IRQ pins are wired to the MCU. RST is materially pulled-up, and IRQ is materially pulled-down. MOSI, MISO, CLK are configured as SPI bus lines in the ioc file, while RST and IRQ are materially wired but let as Reset_State pins (means high impedance?) in the ioc file so never used nor configurated in the code.

In my actual "version 2" of my custom PCB, MOSI, MISO, CLK, are wired to the MCU. RST and IRQ are notmaterially wired to the MCU anymore. BLE_RST remains materially pulled-up with same resistor value (10kOhms), and BLE_IRQ is materially pulled-down (10kOhms). The SPI initialization pins in the ioc files are exactly the same (data bits, baud rate...) in both version.

Issue : I cannot initialize the BLE chip.

I tried :

1. solder the BLE_RST to the MCU and set the pin in the ioc as GPIO output 0 default value. then, wait for the power supply to be stable, wait for all the peripherals to be initialized, then software toggle the ble reset pin and finally initialize the BLE.

Result : BLE still not initialized.

BLE_init function is as :

 /* Initialize the BlueNRG HCI */

 hci_init(user_notify, NULL);

 /* get the BlueNRG HW and FW versions */

 getBlueNRGVersion(&hwVersion, &fwVersion);

 /*

  * Reset BlueNRG SPI interface again otherwise we won't

  * be able to change its MAC address.

  * aci_hal_write_config_data() must be the first

  * command after reset otherwise it will fail.

  */

 hci_reset();

and inside getBlueNRGVersion there is status = hci_le_read_local_version(&hci_version, &hci_revision, &lmp_pal_version, &manufacturer_name, &lmp_pal_subversion); and the status is BLE_TIMEOUT, not BLE_SUCCESS.

Observation : when RST becomes high, IRQ becomes high (means data event from BLE chip is ready), CLK becomes low (ready for communication). But then CLK never high up again...

I could try to wire IRQ pin, but as the version 1 of my custom PCB works with IRQ pin let in Reset State in the ioc file, I don't know what to add in my firmware once it will be wired?

Any help would be greatly appreciated,

Thank you!

Chloé

1 REPLY 1
Sebastien DENOUAL
ST Employee

Hi Chloé,

From your description, I would first focus on HW/SPI connection. It looks your STM32 cannot discuss successfully with BlueNRG-MS

IN terms of SW, I suppose your code is the one from X-CUBE-BLE1 sw package.

Behavior of IRQ pin you described is the correct one. Indeed after reset, IRQ is raised high to inform MCU (STM32) that there is some data available for reading over SPI.

This IRQ is treated on STM32 side and a SPI transaction is started to read data :

At this stage, and using a scope on SPBTLE-RF pin : can you confirm SPI_CS line is correctly asserted by STM32 ?

If OK : did you checked SPI clock speed (max 8Mhz) ?

Here below AN note for bringing up BlueNRG-MS, of course on module it is not applicable but figure 3 page 7 shows a screenshot of 1st SPI transaction.

> https://www.st.com/resource/en/application_note/an4494-bringing-up-the-bluenrg-and-bluenrgms-devices-stmicroelectronics.pdf

Be informed that SPBTLE-RF is NRND, BlueNRG-M0 must be preferred (pin2pin compatible, no impact on STM32 FW).

Regards,

Sebastien.