2025-12-26 6:47 AM
Hello!
I am entering the world of NFC with a somewhat complex project, but I took the initiative to start it. The goal was to create a sensor that would work only with Energy Harvesting from the reader.
For this, I chose the ST25R300 chip to be the chip for my reader board and sensor power supply, mainly due to its high transmission power.
I'm having trouble getting it to work properly. I used GPT to create some diagnostic codes so I could get a basic idea of how the components are reacting and whether the antenna is working at all. However, I'm already having problems right from the start.
These are logs I obtained from my system.
I'll talk a little about my circuit now:
My circuit connects the ST25R300 chip to the STM32L0 via SPI, as shown in the DataSheet example. With a small matching circuit with the antenna.
I should have readings in RSSI, right? The problem is that no matter what I do in the system, the reading is always 0, and I also noticed that the voltage in VDD_A, which should be zero, is almost 6 volts.
int main(void)
{
HAL_Init();
nfc_reader.CS_port = GPIOB;
nfc_reader.CS_pin = ST25_CS_Pin;
nfc_reader.reset_port = GPIOA;
nfc_reader.reset_pin = GPIO_PIN_3;
nfc_reader.IRQ_port = GPIOA;
nfc_reader.IRQ_pin = GPIO_PIN_0;
nfc_reader.hSPIx = &hspi2;
DEBUG_PRINT("\n\n");
DEBUG_PRINT("╔═══════════════════════════════════════════════╗\n");
DEBUG_PRINT("║ ST25R300 NFC READER DIAGNOSTICS ║\n");
DEBUG_PRINT("╚═══════════════════════════════════════════════╝\n");
if (ST25R300_Init(&nfc_reader) != HAL_OK) {
DEBUG_PRINT("\n✗ CRITICAL: Initialization FAILED!\n");
Error_Handler();
}
if (ST25R300_Identity(&nfc_reader) == ST25_OK) {
DEBUG_PRINT("✓ ST25R300 Identified!\n\n");
} else {
DEBUG_PRINT("✗ ST25R300 Identification Failed\n");
Error_Handler();
}
if (ST25R300_ConfigureSingleEndedAntenna(&nfc_reader, ST25R300_RFO1) != HAL_OK) {
DEBUG_PRINT("✗ WARNING: Antenna configuration failed\n");
}
ST25R300_AntennaMode_t mode;
ST25R300_RFO_Select_t rfo;
if (ST25R300_GetAntennaConfig(&nfc_reader, &mode, &rfo) == HAL_OK) {
if (mode == ST25R300_ANTENNA_DIFFERENTIAL) {
DEBUG_PRINT("Antenna Mode: Differential\n");
} else {
DEBUG_PRINT("Antenna Mode: Single-Ended\n");
DEBUG_PRINT("Active Output: %s\n", (rfo == ST25R300_RFO1) ? "RFO1/RFI1" : "RFO2/RFI2");
}
}
ST25R300_DiagnosticReport_t report;
ST25R300_RunDiagnostics(&nfc_reader, &report);
while (1) {
ST25R300_RFMeasurements_t rf_data;
ST25R300_WriteRegister(&nfc_reader, ST25R300_REG_OPERATION, 0x38); // en, vdddr, rx_en
if (ST25R300_MeasureRSSI(&nfc_reader, &rf_data) == HAL_OK) {
DEBUG_PRINT("RSSI I: %d | RSSI Q: %d\r\n", rf_data.rssi_i, rf_data.rssi_q);
}
HAL_Delay(500);
}
}The above codes may contain several errors, I fully understand that, but as my knowledge of chips is limited, I needed some help to get things started here. If anyone can clarify whether there really is a problem with my system, I would be very grateful.