cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-MS IRQ

asafbit
Associate II
Posted on December 20, 2017 at 10:37

hi.

im running a provided example of HID periphProfiles.

using STEVAL-IDB005V1D on NXP platform (FRDM-KL43)

SPI lines are OK, i can read header from the blueNRG-MS.

the thing is IRQ always high. so that at the moment i configure the IRQ at NXP,

interrupt occurs and making NXP always tries to receive data from BlueNRG.

i've tested the original example earlier on nucleo platform, and it was working fine, but haven't checked the specific state of the IRQ.

Is it suppose to work this way? have i broken something in the porting process?

#bluenrg-ms #irq-bluenrg-ms

Note: this post was migrated and contained many threaded conversations, some content may be missing.
10 REPLIES 10
asafbit
Associate II
Posted on December 20, 2017 at 15:07

RST should be applied until the spi is ready to read.

Antonio Vilei
Senior III
Posted on December 21, 2017 at 10:39

For more information, please refer to the

http://www.st.com/content/ccc/resource/technical/document/application_note/46/0a/77/7b/04/f5/4c/b7/DM00116738.pdf/files/DM00116738.pdf/jcr:content/translations/en.DM00116738.pdf

 document, section 3 about the SPI interface.

Also take a look at Figure 3, which shows more details.

Posted on March 27, 2018 at 15:42

Hello, Antonio!

Is it right?

BlueNRG_Stack_Initialization();

while (GPIO_PIN_RESET == HAL_GPIO_ReadPin(BLE_SPI_IRQ_GPIO_Port, BLE_SPI_IRQ_Pin));

uint8_t d[6];

DWT_DelayMSC(1);

// First reply [0x02, 0x7F, 0x00, 0x00, 0x00]

BlueNRG_SPI_Read_All(NULL, 0);

DWT_DelayMSC(10);

// Second reply [0x02, 0x7F, 0x00, 0x06, 0x00]

// [04, FF, 03, 01, 00, 01]

BlueNRG_SPI_Read_All(d, 6);

if IRQ is disabled, there is  0x3 0x00 0x00 0x00 0x00 in the slave header.

Posted on March 28, 2018 at 12:21

Hi Aleksey,

What software are you currently using to test the device?

As a reference, you can use the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-ble1.html

 package, based on STM32Cube HAL.

There's also a C++ implementation available for ARM mbed, where it may be a bit easier to see whats steps are necessary to interface with the chip:

https://os.mbed.com/components/X-NUCLEO-IDB05A1-Bluetooth-Low-Energy/

 

Maybe I have misunderstood you question, but please note that the IRQ pin of the BlueNRG-MS chip will be set whenever there are data available.

If you're using the same implementation of the

BlueNRG_SPI_Read_All()

function included in X-CUBE-BLE1, there is no need to explicitly add a delay before calling it, as it already takes care of checking the slave header to make sure that the device is ready.

Best regards,

Antonio

Posted on March 28, 2018 at 12:46

Thank you for answer. 

I use SPBTLE-RF on own PCB. STM32L4A6 connect via SPI with SPBTLE-RF.

After exhange the headers IRQ must reset (in

BlueNRG_SPI_Read_All)

. But IRQ line is not 0.

STM32L4 gets normal slave header: 0x2 0x7F 0x00 0x06 0x00.

Posted on March 28, 2018 at 15:17

Do you have a pull-down resistor on the IRQ pin of your custom PCB?

In the

http://www.st.com/content/st_com/en/products/ecosystems/stm32-open-development-environment/stm32-nucleo-expansion-boards/stm32-ode-connect-hw/x-nucleo-idb05a1.html

board, based on the same SPBTLE-RF module, there is a 47k resistor, as you can see below.0690X0000060AIEQA2.png

If you can't make it work, I suggest to try running some of the examples provided with the 

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-ble1.html

 package along with a hardware configuration that is known to work, such as NUCLEO-L476RG and X-NUCLEO-IDB05A1.

Best regards,

Antonio

Posted on March 28, 2018 at 16:11

I use inner pull-down resistor in STM32L4.

Posted on March 29, 2018 at 10:53

Hi Aleksey,

the inner pull-down could be fine, but I've never tested this configuration. In all the boards that I am using, there is an external resistor.

If you can find a 

NUCLEO-L476RG and an X-NUCLEO-IDB05A1 board, you will have a working reference that should make it easier for you to check what is going on in your custom board.

Best regards,

Antonio

Posted on March 29, 2018 at 11:04

Hello Antonio,

thank you for anserwing. I buy the

X-NUCLEO-IDB05A1 board and test my code.

Best regards,

Aleksey.