2024-10-28 07:19 AM
Hello everyone!
I'm working with the NFC08A1 board (ST25R3916) and trying to use it in NFC Reader mode. At the moment, I’m focused on writing and reading the chip’s registers via the SPI protocol.
I've conducted several tests on the firmware side, but the registers are not being written correctly.
Specifically, I’m sending the write frame as defined in chapter 4.3.3 of the ST25R3916 datasheet to write data to certain registers; however, the subsequent read operation fails.
To verify the read functionality, I also tried reading the register at address 0x3F (IC Identity), but the operation doesn't work (the read value is always 0x00).
I’ve tried both the Transmit + Receive function and the TransmitReceive function, but the result is the same—all registers return 0x00.
I’m confident that the transmit frame is correct because I monitored it with an oscilloscope, and it matches the datasheet specifications. However, in the receive frame, I don’t see any data when the receive function starts.
Can you help me in this issue? If is necessary i can copy and paste my code here...thank you in advance!!
2024-11-04 02:04 AM
Hi,
can you provide some information about your setup:
Regarding the SPI communication issue, make sure the SPI CS/SS/BSS signal is properly configured ("Communication starts with the MCU pulling BSS low."). I suggest to connect a logic analyzer on the SPI (CLK, MOSI, MISO and CS) + IRQ pin and to send us the log file.
I also recommend to use the X-CUBE-NFC6 firmware package that provides the support of the X-NUCLEO-NFC08A1 expansion board. The code can be ported on various MCU.
Rgds
BT
2024-12-09 05:48 AM
Hi Brian!
Thanks for your response. I performed additional checks with the oscilloscope on all signals (MISO and MOSI), and they appeared correct. However, I was still experiencing issues with reading and writing registers via SPI.
I made some changes in the firmware by enabling the chip select (CS) pin right before sending the frame via SPI and disabling it immediately after using the HAL_SPI_Transmit function. I also added a step to disable the chip select during system startup.
With these changes, everything seems to be working correctly. I'm not sure why, but when I was enabling the chip select at the beginning of the function and not right before calling HAL_SPI_Transmit, I encountered problems with reading and writing the registers.
Do you have any idea why this might be happening? Could it be an issue in the code that I overlooked?
Thank you for your availability!
2024-12-10 07:57 AM
Hi,
difficult to answer without having a logic analyzer trace. Can you connect a logic analyzer on SPI (CLK/MISO/MOSI/CS) + IRQ_3916B and share the log file?
Rgds
BT