2020-12-14 11:03 AM
Here the details.
I'm writing my own firmware to read the NFC type A and B on a custom board based strictly on NUCLEO-NFC06A1. I found it difficult to work with the STM32L476RG-Nucleo_PollingTagDetect example. To debug and "reverse engineering" the code is too much and it would take too long.
A the moment I am able to set the registers to perform a request. I was able to check on the oscilloscope the signal generated and it works according to what I expected. However since I don't read any data I don't know if I set all the registers correctly.
My struggle come from this point. Now I'm trying to print out all the registers of the ST example to see how they change and compare it to the ST25R3916 datasheet in different points.
Can you help me out by pointing how to go about it or where to look?
I saw there is ST25R3916-DISCO that comes with a SOFTWARE GUI which allows you to debug more easily. Would this evaluation board be helpful?
Thank you in advance
Solved! Go to Solution.
2020-12-15 11:04 PM
Hi LRiva.1,
I don't see in your code setting the necessary registers in space B. In our Disco GUI they are mapped into virtual address space starting at 0x40. Also to be able to communicate with a tag you will need to respect some guard times after field-off: 5ms and in subsequent communication also FDT between responses and subsequent commands.
As for the next commands to retrieve UID, please consult NFC Forum digital specification or ISO14443.
Our software stack would be relieving you from caring about such details.
If you want to continue this route then I would recommend you to get a logic analyzer to be able to compare your SPI sequences against our demo board and also to be able to inspect the digital observation modes.
Regards, Ulysses
2020-12-15 03:08 AM
Hi GJaso.1,
yes you can try to use the ST25R3916-DISCO GUI to to send the commands you are requiring and see the registers for ISO14443A-106 and ISO14443B-106. Most of the registers can be set statically. However please watch out for setting the no response timer according to the type of command you are sending.
Also don't forget about issuing Reset RX Gain command before doing new transceives.
Best Regards, Ulysses
2020-12-15 03:32 AM
Hi Ulysses
Thank you for the reply.
I'm taking a look at the GUI Software installed on my PC although I don't have the ST25R3916-DISCO board yet, I see in the Analog Config tab is possible to load an Analog_config file, for instance in the installation directory I found the MB1414-B_v1_1.xml. Does this file represent the sequential "steps" it performs after I wrote it to board? In this case on the left side in the Mode section the number 1 is the CHIP_INIT and on the left are functions linked to it.
This would be helpful to implement and debug my own firmware.
Thank you
2020-12-15 03:59 AM
Hi GJaso.1,
yes, the modes represent the moments/modes in which certain registers are changed. Please beware that this is only part of the settings. Other registers are directly handled by software.
Regards, Ulysses
2020-12-15 06:31 AM
Dear all,
I am working with GJaso.1 and the following is the current code:
Write_CMD(0xC1); //Set default
Write_CMD(0xDF); //Measure power supply
Write_Reg(IO_CONF_REG1, 0x07);//Differential, SPI and MCU_CLK disabled
Write_Reg(IO_CONF_REG2, 0x1C);
Write_Reg(OP_CTRL_REG, 0x80);//enable oscillator
/*Wait until the interrupt shows that the oscillator is stable (IRQ when oscillator frequency is stable)*/
Write_Reg(MODE_DEF_REG, 0x08);//ISO14443A + OOK
Write_Reg(BITRATE_DEF_REG, 0x00);//bit rate 106
Write_Reg(ISO14443A_SET_REG, 0x00);
//////////////////////////////////////////
//the folloowing settings have been copied from the evaluation kit.
Write_Reg(0x08, 0x50);
Write_Reg(0x0A, 0x80);
Write_Reg(0x0B, 0x08);
Write_Reg(0x0C, 0x2D);
Write_Reg(0x0F, 0x0E);
Write_Reg(0x11, 0x23);
Write_Reg(0x12, 0x20);
Write_Reg(0x13, 0x02);
Write_Reg(0x14, 0xC8);
Write_Reg(0x15, 0x80);
Write_Reg(0x16, 0x83);
Write_Reg(0x17, 0xBF);
Write_Reg(0x18, 0x0F);
Write_Reg(0x19, 0xFB);
Write_Reg(0x25, 0xDD);
Write_Reg(0x26, 0x82);
Write_Reg(0x27, 0x82);
Write_Reg(0x28, 0x70);
Write_Reg(0x29, 0x5F);
Write_Reg(0x2A, 0x11);
Write_Reg(0x31, 0x10);
Write_Reg(0x2A, 0x11);
///////////////////////////////////////////////////////
Write_Reg(OP_CTRL_REG, 0xCB);//Enable RX, Enable TX, Enable external field detector auto
Write_CMD(ADJ_REG);//Adjust regulators
while(1)
{
Write_CMD(0xC2);// Stop all activities
Write_CMD(0xD5);//Reset RX gain
Write_CMD(0xC6);//Transmit REQA
}
After this code I receive an interrupt showing that the transmission has been terminated (IRQ due to end of transmission) but I don't get any interrupt showing that the tag is answering (IRQ due to start of receive or IRQ due to end of receive).
Is it possible to explain why I cannot see the receive IRQ and what I have to do next to correctly read the tag UID?
Thank you very much.
2020-12-15 01:11 PM
Hello,
I'm doing the same task and having hard time to find the library for st25r3916. Can you please, tell me what library/example are you using. I'm using yocto Linux on my NXP board.
2020-12-15 11:04 PM
Hi LRiva.1,
I don't see in your code setting the necessary registers in space B. In our Disco GUI they are mapped into virtual address space starting at 0x40. Also to be able to communicate with a tag you will need to respect some guard times after field-off: 5ms and in subsequent communication also FDT between responses and subsequent commands.
As for the next commands to retrieve UID, please consult NFC Forum digital specification or ISO14443.
Our software stack would be relieving you from caring about such details.
If you want to continue this route then I would recommend you to get a logic analyzer to be able to compare your SPI sequences against our demo board and also to be able to inspect the digital observation modes.
Regards, Ulysses
2020-12-15 11:06 PM
Hi HSidd.1,
you may want to have a look at STSW-ST25R013. It should be easily transferable to any Linux system.
Regards, Ulysses