2021-02-24 01:46 AM
Hello,
I'm trying to follow the test procedure for BlueNRG-MS (SPI) indicated in the Bringing up the BlueNRG and BlueNRG-MS devices - Application note (AN4494).
I'm using an STEVAL-IDB005V1D board (with a BLUENRG-MS chip) and an NUCLEO-F446RE board to read SPI signals.
Here is the test procedure (page 5/32 of AN4494) :
A BlueNRG hardware reset, performed by the microcontroller, generates an ACI event with a sequence described below and shown in Figure 3. BlueNRG SPI transaction on HW reset:
Steps 1 to 6 are working. Data are correctly received. However step 7 does not work. I receive [255,255,255,255,255,255], MISO stays always HIGH. Furthermore, IRQ does not go low at the end.
Here are my signals :
Here are the expected signals (AN4494) :
And here is my SPI configuration
Any idea ?
Thanks for reading,
Best regards,
Valentin
Solved! Go to Solution.
2021-03-01 06:03 PM
Didn't you send anything to MOSI? That could be the cause.
Refer to below figure:
In the 5-byte SPI header, the 1st byte of MOSI CTRL byte, the information telling the slave (BlueNRG-MS) that the master (MCU) is going to issue a write operation (0x0A) or a read operation (0x0B).
The following 4 bytes are dummy and shall be all zeros.
In your case, you need to send 0x0B in CTRL byte, so that BlueNRG-MS knows to output its 6-byte data to be read. After the data is read and no more data in buffer, the IRQ signal shall be cleared automatically.
2021-02-24 08:19 PM
Could you please try to configure clock phase (CPHA) to 0, leading edge?
2021-02-25 11:27 PM
Hello Winfred, thanks for your answer.
Actually, we only can set CPHA to "1 Edge" or "2 Edge", so I decided to test with CPHA = 2 Edges.
Unfortunately, the datas read by the STM32 are the same :
MISO stay high during the 3rd packets and the IRQ of the BlueNRG-MS stay HIGH.
2021-03-01 09:14 AM
I saw in another thread (https://community.st.com/s/question/0D50X00009XkezqSAB/bluenrgms-irq) that they were some data on MOSI line when we read data from BluenNRG-MS :
I didn't see anything describing this MOSI data in the documentation.
2021-03-01 05:54 PM
In the case CPHA having options of 1 Edge and 2 Edge, "1 Edge" is what i meant for 0 edge -- the "out" side changes the data on the trailing edge of the preceding clock cycle, while the "in" side captures the data on the LEADING edge of the clock cycle.
It looks that your configurations were good.
The issue could be in protocol.
2021-03-01 06:03 PM
Didn't you send anything to MOSI? That could be the cause.
Refer to below figure:
In the 5-byte SPI header, the 1st byte of MOSI CTRL byte, the information telling the slave (BlueNRG-MS) that the master (MCU) is going to issue a write operation (0x0A) or a read operation (0x0B).
The following 4 bytes are dummy and shall be all zeros.
In your case, you need to send 0x0B in CTRL byte, so that BlueNRG-MS knows to output its 6-byte data to be read. After the data is read and no more data in buffer, the IRQ signal shall be cleared automatically.
2021-03-02 02:04 AM
Hello Winfred,
I guess this is the answer, thanks. I'll try this tomorrow.
I didn't find this figure in the documents.
2021-03-02 11:51 PM
Hello Winfred,
I confirm that your answer solved the problem. Thank you for your help.
Best regards,
Valentin