Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.3k views
in Technique[技术] by (71.8m points)

bluetooth lowenergy - BlueNRG wrong header

I bought STEVAL-MKSBOX1V1 of ST and wanted to write my own library to create a BLE application.

The BLE module on board is SPBTLE-1S which mounts BlueNRG-1, I wrote my own firmware in order to communicate using SPI protocol.

After resetting the module using the pin I send a read request from MCU to the BLE module,

 HAL_GPIO_WritePin(SPI1_CS_GPIO_Port,SPI1_CS_Pin,0);
 HAL_SPI_TransmitReceive(&hspi2,tx,rx,5,1);
 HAL_GPIO_WritePin(SPI1_CS_GPIO_Port,SPI1_CS_Pin,1);

I send:

{0x0b,0x00,0x00,0x00,0x00}

I get:

{0xff,0x08,0x00,0x06,0x00}

So apparently nothing good because the first byte is 0xff and not 0x02 (right?), but the 4th bit(0x06) should indicate the amount of data inside the read buffer.

If I read 6 bytes I get

{0x04,0xff,0x03,0x01,0x00,0x01}

And according to AN4494 It is exactly what I should read after the reset event on the module.

Then my question is why I keep getting {0xff,0x08,0x00,0x06,0x00} and not something like {0x02,....}?

Is there anything related to BlueNRG1 that is different from BlueNRG2? (It is so hard to find good documentation)

If anyone has some experience on SPI communication with this module I would like to have a bit of consulting.

Thanks in advance


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...