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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,159 次查看
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

 

标记 (1)
0 项奖励
1 解答
2,115 次查看
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 项奖励
4 回复数
2,147 次查看
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,145 次查看
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,135 次查看
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 项奖励
2,116 次查看
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 项奖励