cancel
Showing results for 
Search instead for 
Did you mean: 

Weird SPI data from BlueNRG-M2SA

Jaume
Associate II

Hello, 

I have designed a custom PCB for sensor acquisition and I am using an STM32U575 as main processor and then a BlueNRG-M2SA module configured as a coprocessor with the DTM_SPI.hex image. They are both connected through SPI but I can't seem to get past the verify_packet() function. I attach a zip file with my STM32 project in which I am using the X-CUBE-BLE2 middleware with the beacon application and HCI_TL set to Basic and HCI_TL_INTERFACE to UserBoard.

My SPI is configured with polarity set to low, 1 edge clock phase and with a frequency of 1MBit/s.

The problem I am having is that it seems like the packets I am receiving through SPI don't make sense completely and they seems to be a bit off. I have measured the SPI signals and the received header is {0xFF,0x09,0x01,0x06,0x00}. The measured signal is shown below together with the clock and the rising edges marked

header.jpg

 The data received after the header is {0x04, 0xFE, 0x06, 0x02, 0x00, 0x02}. The following image shows the first 4 measured outputs. The last two are all 0s and the same as the 4th.

data.jpg

 The problem lies on the received parameters that don't pass the verify_packet() function inside hci_tl.c as it returns 2. Wrong length due to the third parameter's value being 6 and the actual data being 3 bytes long.

Can someone help me find out what the problem is? Is the data I am receiving normal or correct? Thank you and let me know if I can provide any extra information or test something else.

0 REPLIES 0