What is the response to a CORE_RESET_CMD command with the PN7150 device?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

What is the response to a CORE_RESET_CMD command with the PN7150 device?

Jump to solution
2,976 Views
dominusdrr
Contributor IV

Hi.

I'm writing the code to manage the PN7150 with a 32-bit microcontroller.

I have found an example code for Arduino in the following link: https://github.com/ElectronicCats/ElectronicCats-PN7150 which I am taking as a guide to write my own code.

The first step is to "wake up NFC" using the CORE_RESET_CMD command. This I understand correctly.

uint8_t NCICoreReset[] = {0x20, 0x00, 0x01, 0x01};
uint16_t NbBytes = 0;

// Reset RF settings restauration flag
(void)writeData(NCICoreReset, 4);


After sending those four bytes (Command), proceed to read the response as follows;

getMessage(15);
NbBytes = rxMessageLength;
if ((NbBytes == 0) || (rxBuffer[0] != 0x40) || (rxBuffer[1] != 0x00))
{
   return ERROR;
}

 

My questions are:

How many bytes should it read? Apparently there are only 2.

Why must the first byte be equal to 0x40 and the second byte equal to 0x00?

Where do I get information on the responses to the commands?

I've been looking at the NCI spec, but can't find it.

Similarly, after reading the response, you must wait for the notification, in this case the first and second bytes must be 0x60 and 0x07, respectively.

Any comment or suggestion is welcome

 

Tags (1)
0 Kudos
Reply
1 Solution
2,932 Views
dominusdrr
Contributor IV

I answer to myself.

The response frame must satisfy the following:

187574837-ae0bb874-a024-4b43-a350-b48b280ec24f

 

So in the payload (which is 3 bytes) there would be the Status, NCI Version and Configuration Status

Regards

View solution in original post

0 Kudos
Reply
4 Replies
2,964 Views
dominusdrr
Contributor IV

I answer myself, in this table is what is answered to that command, and it is 3 bytes (RSP) and 2 bytes (NTF), I still have to verify what values it really returns

 

dominusdrr_0-1661888625951.png

 

 

 

2,962 Views
dominusdrr
Contributor IV

Again I answer to myself.

The response from the NFC has been exactly the one that generates an error in the Arduino example code in the OP. (0x40, 0x00 and 0x03)

dominusdrr_0-1661891102985.png


The first byte, which is 0x40, is supposed to be looked up in table 94, but there is no code status value.

dominusdrr_1-1661891278595.png

The same happens for the second and third byte. These values don't indicate the possible cause of the problem






2,952 Views
dominusdrr
Contributor IV

I answer to myself.

It seems that I just understood

I think that 0x40 is the header of the frame, it indicates a response to a command sent from the DH (microcontroller)

dominusdrr_0-1661897727129.png

 

0 Kudos
Reply
2,933 Views
dominusdrr
Contributor IV

I answer to myself.

The response frame must satisfy the following:

187574837-ae0bb874-a024-4b43-a350-b48b280ec24f

 

So in the payload (which is 3 bytes) there would be the Status, NCI Version and Configuration Status

Regards

0 Kudos
Reply