2025-11-13 3:27 AM
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).
SCK
MOSI
CS
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);
}
2025-11-13 4:10 AM - edited 2025-11-13 4:12 AM
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):
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
2025-11-13 4:47 AM
Hi,
make sure the SPI Clock is configured as SPI_PHASE_2EDGE:
What is the content of txData?
Rgds
BT
2025-11-13 5:22 AM
Hi,
I have it configured as on your screenshot, The content of txData is {127, 0}
Thanks for help,
AW
2025-11-14 5:31 AM
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?
2025-11-14 6:06 AM
Hi,
if the chip is supplied (VDD, VDD_IO) and the right commands are supplied then it will answer.
BR, Ulysses