2016-03-31 02:41 AM
Hi,
I'm currently working on using SPBTLE-RF module with the evaluation board of the KL25Z from Freescale.After I set up the SPI interface, I tried a byte-communication with the module by sending Write Header ( 0x0a, 0x00, 0x00,0x00, 0x00), some data (supposed to be HCI command, see further) and then the Read Header ( 0x0b, 0x00, 0x00,0x00, 0x00) in order to get something in return . Here is what I send/receive :---- START ----****
SLAVE HEADER WRITE
0x02 0x7F 0x00 0x07 0x00
****
Received : 0xFF
Sent : 0x01
Received : 0xFF
Sent : 0x09
Received : 0xFF
Sent : 0x04
Received : 0xFF
Sent : 0x00
****
SLAVE HEADER READ
0x02 0x00 0x00 0x00 0x00
****
---- END ----Whenever I try to read some data (by sending read header) coming from the module after performing a write operation (by sending write header, even without data), the slave seems to announce that he's ready (CTRL byte = 0x02) but he hasn't anything to offer (W/RBUF_lo/hi = 0x00).Plus, if I try to read data without sending any write request before, here is what I get :---- START ----
****
SLAVE HEADER READ
0x02 0x7D 0x00 0x07 0x00
****
READ RECEPTION BUFFER
Received : 0x04
Received : 0x0F
Received : 0x04
Received : 0x01
Received : 0x01
Received : 0x09
Received : 0x04
---- END ----I'm quite new to SPI communications, am I doing this right ? About using HCI commands, is there any special formatting step before sending that I could missed ? Is it even possible to send that kind of frame with direct bytes on the SPI bus ?Thanks,B.TOMAS #hci #spi #kl25z #spbtle-rf
2016-04-04 12:51 AM
I've managed to use some HCI commands provided for the STM32, but I still have the same issue with null buffers :
SLAVE HEADER READ0x02 0x00 0x00 0x00 0x00
But thanks to the HCI commands retrying mecanism, I received (randomly) some data from the module (like the BT address), immediatly followed by the HCI event ''Hardware Error'' : </colgroup>
Received : 0x04 HCI Event
Received : 0x10 Event Code Evt_Hardware_Error
Received : 0x01 Parameter Total Length 1
Received : 0x00
Some posts on this forum mentionned a firmware issue, that an update could resolve some problems, if anyone can confirme ?I'm now trying to integrate a new SPBTLE-RF chip to figure out if I'm facing a factory default or not.2016-12-09 04:44 AM
0x02 0x00 0x00 0x00 0x00 means that the controller needs some time to initialize buffers.
Try sending header again until buffers are initialized.
CS_HIgh
Wait(1ms)
CS_Low
Sending header
--> get Buffer Size
if(buffer > 0) {read/write data}
CS_High
2017-10-27 06:12 AM
I have the same problem interfacing the SPBTLE-RF and a STM32L4 on a custom board.
I received on the SPI the 0x02 (SPI OK) and then 0x00 for the buffer.
I tried to send the header several time, but it's not working either...
Tomas did you figure out what was the problem?
Thanks
2017-10-31 08:06 AM
Hi Jean,
I suggest to refer to the
software package, which comes with examples preconfigured for different STM32 Nucleo boards and includes support for STM32L4.This thread is very old and is related to a completely different setup, as the original poster wasn't using an STM32 microcontroller at all. If you have any issues with your hardware, you'd better start a new discussion where you add more details about your own configuration.
Best regards,
Antonio