cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3911B SPI Issues on custom board

qwdwdwwq
Associate II

Hello,

I developing a board with ST25R3911B and STM32F103RFT6. Im trying to read Chip ID, but it always reads 255. On the scope i can see CS pin driven low, clock and MOSI line outputing signals, but no response on the MISO line. The solder joints look ok. Im attaching schematics, board project, soldering under the microscope and scope traces. 

The communication works in loopback (when i physically short MISO and MOSI).

qwdwdwwq_0-1763032156656.png

qwdwdwwq_2-1763032249075.png

 

 

qwdwdwwq_3-1763032803170.png

SCKSCKMOSIMOSICSCS

 

for(;;)
  {
	HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_SET);
	HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_RESET);
	HAL_SPI_TransmitReceive(&hspi1, txData, rxData, 2, 1000);
	if (rxData[1] == 255)
	{
		HAL_GPIO_TogglePin(LED_STATUS1_GPIO_Port, LED_STATUS1_Pin);
		HAL_GPIO_TogglePin(LED_STATUS2_GPIO_Port, LED_STATUS2_Pin);
	}
	else
	{
		HAL_GPIO_TogglePin(LED_WARNING_GPIO_Port, LED_WARNING_Pin);
		HAL_GPIO_TogglePin(LED_ERROR_GPIO_Port, LED_ERROR_Pin);
	}
	HAL_GPIO_WritePin(SPI1_CS_GPIO_Port, SPI1_CS_Pin, GPIO_PIN_SET);
    osDelay(250);
  }
5 REPLIES 5
Ulysses HERNIOSUS
ST Employee

Hi,

hard to judge from given data. MOSI data cannot be seen, no correlation of clock slopes and data, .....

Since you have a 4 channel oscilloscope: Please connect all (MOSI,MISO,SCLK,CS)!

Expected result is (returned ID value may be different):

3911_IC_ID.png

Looking at your second second scope shot: If this should MOSI then this is not 7F(Read IC Identity) because it is way too short: With the shown clock of 1MHz MOSI should stay high for ~7us.

BR, Ulysses

Brian TIDAL
ST Employee

Hi,

make sure the SPI Clock is configured as SPI_PHASE_2EDGE:

BrianTIDAL_0-1763037733663.png

What is the content of txData?

Rgds

BT

 

 

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
qwdwdwwq
Associate II

Hi, 

I have it configured as on your screenshot, The content of txData is {127, 0}

Thanks for help, 

AW

Hi, 

I have taken another shot of the MOSI line, it looks to be around 9us. unfortunately i cant connect 4 probes at the same time (no proper probing points available on the board).

So it looks like the MCU is outputing proper data to the ST25, any idea why it is not responding?

unnamed.jpg

 

 

Hi,

if the chip is supplied (VDD, VDD_IO) and the right commands are supplied then it will answer. 

  1. Verify the supplies: VDD, VDD_IO and also VSP_D
  2. Still, there might be an issue in the actual SPI. On this QFN it is possible solder thin magnet wire on the 4 pins. You will likely need such observation possibility anyhow.
  3. Could be the MISO is driven from MCU side and thus not driven sufficiently by ST25R3911B. Please provide scope shots of the pin when the ST25R3911B should be driving MISO.

 

BR, Ulysses