cancel
Showing results for 
Search instead for 
Did you mean: 

ST25R3911B SPI Issues on custom board

qwdwdwwq
Associate

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);
  }
3 REPLIES 3
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

Hi, 

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

Thanks for help, 

AW